private static extern C4QueryEnumerator* _c4view_query(C4View *view, C4QueryOptions *options, C4Error *outError);
/// <summary> /// Runs a query and returns an enumerator for the results. /// The enumerator's fields are not valid until you call c4queryenum_next(), though. /// </summary> /// <param name="view">The view to operate on</param> /// <param name="options">The query options</param> /// <param name="outError">The error that occurred if the operation doesn't succeed</param> /// <returns>A pointer to the enumerator on success, otherwise null</returns> public static C4QueryEnumerator *c4view_query(C4View *view, C4QueryOptions *options, C4Error *outError) { #if DEBUG var retVal = _c4view_query(view, options, outError); if(retVal != null) { _AllocatedObjects[(IntPtr)retVal] = "C4QueryEnumerator"; #if ENABLE_LOGGING Console.WriteLine("[c4view_query] Allocated 0x{0}", ((IntPtr)retVal).ToString("X")); #endif } return retVal; #else return _c4view_query(view, options, outError); #endif }
private static extern C4Indexer* _c4indexer_begin(C4Database *db, C4View** views, int viewCount, C4Error *outError);
/// <summary> /// Creates an indexing task on one or more views in a database. /// </summary> /// <param name="db">The database to operate on</param> /// <param name="views">An array of views whose indexes should be updated in parallel.</param> /// <param name="outError">The error that occurred if the operation doesn't succeed</param> /// <returns>A pointer to the indexer on success, otherwise null</returns> public static C4Indexer* c4indexer_begin(C4Database* db, C4View*[] views, C4Error* outError) { fixed(C4View** viewPtr = views) { #if DEBUG var retVal = _c4indexer_begin(db, viewPtr, views.Length, outError); if(retVal != null) { _AllocatedObjects[(IntPtr)retVal] = "C4Indexer"; #if ENABLE_LOGGING Console.WriteLine("[c4indexer_begin] Allocated 0x{0}", ((IntPtr)retVal).ToString("X")); #endif } return retVal; #else return _c4indexer_begin(db, viewPtr, views.Length, outError); #endif } }
public static extern ulong c4view_getLastSequenceChangedAt(C4View *view);
public static extern bool c4view_rekey(C4View *view, C4EncryptionKey *newKey, C4Error *outError);
public static extern ulong c4view_getLastSequenceIndexed(C4View *view);
public static extern ulong c4view_getTotalRows(C4View *view);
/// <summary> /// Deletes the database file and closes/frees the C4View. /// </summary> /// <param name="view">The view to operate on</param> /// <param name="outError">The error that occurred if the operation doesn't succeed</param> /// <returns>true on success, false otherwise</returns> public static bool c4view_delete(C4View *view, C4Error *outError) { #if DEBUG var ptr = (IntPtr)view; #if ENABLE_LOGGING if(ptr != IntPtr.Zero && !_AllocatedObjects.ContainsKey(ptr)) { Console.WriteLine("WARNING: [c4view_delete] freeing object 0x{0} that was not found in allocated list", ptr.ToString("X")); } else { #endif _AllocatedObjects.Remove(ptr); #if ENABLE_LOGGING } #endif #endif return _c4view_delete(view, outError); }
private static extern bool _c4view_delete(C4View *view, C4Error *outError);
public static extern bool c4view_eraseIndex(C4View *view, C4Error *outError);