コード例 #1
0
ファイル: C4Test.cs プロジェクト: ShaoboFeng/cbforest
 public virtual void SetUp()
 {
     Native.c4log_register(C4LogLevel.Warning, Log);
     Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
     var dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "forest_temp.fdb");
     C4Error error;
     _db = Native.c4db_open(dbPath, C4DatabaseFlags.Create, EncryptionKey, &error);
     Assert.IsFalse(_db == null);
 }
コード例 #2
0
 public static extern bool c4db_deleteIndex(C4Database *database, C4Slice name, C4Error *outError);
コード例 #3
0
 public static C4Query *c4query_new(C4Database *database, string expression, C4Error *error)
 {
     using (var expression_ = new C4String(expression)) {
         return(NativeRaw.c4query_new(database, expression_.AsC4Slice(), error));
     }
 }
コード例 #4
0
 public static C4DocEnumerator *c4db_enumerateChanges(C4Database *database, ulong since, C4EnumeratorOptions *options, C4Error *outError) => Impl.c4db_enumerateChanges(database, since, options, outError);
コード例 #5
0
 public static extern C4Query *c4query_new(C4Database *database, C4Slice expression, C4Error *error);
コード例 #6
0
 public static bool c4db_endTransaction(C4Database *database, bool commit, C4Error *outError) => Impl.c4db_endTransaction(database, commit, outError);
コード例 #7
0
 public static C4RawDocument *c4raw_get(C4Database *database, string storeName, string docID, C4Error *outError) => Impl.c4raw_get(database, storeName, docID, outError);
コード例 #8
0
 public static bool c4db_rekey(C4Database *database, C4EncryptionKey *newKey, C4Error *outError) => Impl.c4db_rekey(database, newKey, outError);
コード例 #9
0
 public static string c4db_getPath(C4Database *db) => Impl.c4db_getPath(db);
コード例 #10
0
 public static bool c4db_free(C4Database *database) => Impl.c4db_free(database);
コード例 #11
0
 public static bool c4db_delete(C4Database *database, C4Error *outError) => Impl.c4db_delete(database, outError);
コード例 #12
0
 public static C4Database *c4db_retain(C4Database *db) => Impl.c4db_retain(db);
コード例 #13
0
 public static C4Database *c4db_openAgain(C4Database *db, C4Error *outError) => Impl.c4db_openAgain(db, outError);
コード例 #14
0
 public static C4BlobStore *c4db_getBlobStore(C4Database *db, C4Error *outError) => Impl.c4db_getBlobStore(db, outError);
コード例 #15
0
 public static C4SliceResult c4db_getCookies(C4Database *db, C4Address request, C4Error *error) => Impl.c4db_getCookies(db, request, error);
コード例 #16
0
 public static C4DatabaseConfig *c4db_getConfig(C4Database *db) => Impl.c4db_getConfig(db);
コード例 #17
0
 public static bool c4db_beginTransaction(C4Database *database, C4Error *outError) => Impl.c4db_beginTransaction(database, outError);
コード例 #18
0
 public static ulong c4db_getDocumentCount(C4Database *database) => Impl.c4db_getDocumentCount(database);
コード例 #19
0
 public static bool c4db_isInTransaction(C4Database *database) => Impl.c4db_isInTransaction(database);
コード例 #20
0
 public static ulong c4db_getLastSequence(C4Database *database) => Impl.c4db_getLastSequence(database);
コード例 #21
0
 public static bool c4raw_put(C4Database *database, string storeName, string key, string meta, string body, C4Error *outError) => Impl.c4raw_put(database, storeName, key, meta, body, outError);
コード例 #22
0
 public static ulong c4db_nextDocExpiration(C4Database *database) => Impl.c4db_nextDocExpiration(database);
コード例 #23
0
 public static C4DocEnumerator *c4db_enumerateAllDocs(C4Database *database, C4EnumeratorOptions *options, C4Error *outError) => Impl.c4db_enumerateAllDocs(database, options, outError);
コード例 #24
0
 public static uint c4db_getMaxRevTreeDepth(C4Database *database) => Impl.c4db_getMaxRevTreeDepth(database);
コード例 #25
0
 public static extern bool c4db_createIndex(C4Database *database, C4Slice name, C4Slice expressionsJSON, C4IndexType indexType, C4IndexOptions *indexOptions, C4Error *outError);
コード例 #26
0
 public static void c4db_setMaxRevTreeDepth(C4Database *database, uint maxRevTreeDepth) => Impl.c4db_setMaxRevTreeDepth(database, maxRevTreeDepth);
コード例 #27
0
 public static extern C4SliceResult c4db_getIndexes(C4Database *database, C4Error *outError);
コード例 #28
0
 public static bool c4db_getUUIDs(C4Database *database, C4UUID *publicUUID, C4UUID *privateUUID, C4Error *outError) => Impl.c4db_getUUIDs(database, publicUUID, privateUUID, outError);
コード例 #29
0
 public static bool c4db_deleteIndex(C4Database *database, string name, C4Error *outError)
 {
     using (var name_ = new C4String(name)) {
         return(NativeRaw.c4db_deleteIndex(database, name_.AsC4Slice(), outError));
     }
 }
コード例 #30
0
 public static bool c4db_compact(C4Database *database, C4Error *outError) => Impl.c4db_compact(database, outError);
コード例 #31
0
ファイル: C4DatabaseTest.cs プロジェクト: ShaoboFeng/cbforest
 public TransactionHelper(C4Database *db)
 {
     C4Error error;
     Assert.IsTrue(Native.c4db_beginTransaction(db, &error));
     _db = db;
 }
コード例 #32
0
 public static bool c4db_setCookie(C4Database *db, C4Slice setCookieHeader, C4Slice fromHost, C4Slice fromPath, C4Error *outError) => Impl.c4db_setCookie(db, setCookieHeader, fromHost, fromPath, outError);