public static FLValue *FLDict_GetSharedKey(FLDict *d, byte[] keyString, FLSharedKeys *sk) { fixed(byte *keyString_ = keyString) { return(NativeRaw.FLDict_GetSharedKey(d, new FLSlice(keyString_, (ulong)keyString.Length), sk)); } }
public static FLDictKey FLDictKey_InitWithSharedKeys(byte[] @string, FLSharedKeys *sharedKeys) { fixed(byte *@string_ = @string) { return(NativeRaw.FLDictKey_InitWithSharedKeys(new FLSlice(@string_, (ulong)@string.Length), sharedKeys)); } }
public static FLKeyPath *FLKeyPath_New(byte[] specifier, FLSharedKeys *shared, FLError *error) { fixed(byte *specifier_ = specifier) { return(NativeRaw.FLKeyPath_New(new FLSlice(specifier_, (ulong)specifier.Length), shared, error)); } }
public static FLValue *FLKeyPath_EvalOnce(byte[] specifier, FLSharedKeys *shared, FLValue *root, FLError *error) { fixed(byte *specifier_ = specifier) { return(NativeRaw.FLKeyPath_EvalOnce(new FLSlice(specifier_, (ulong)specifier.Length), shared, root, error)); } }
public static FLDoc *FLDoc_FromData(byte[] data, FLTrust x, FLSharedKeys *shared, byte[] externData) { fixed(byte *data_ = data) fixed(byte *externData_ = externData) { return(NativeRaw.FLDoc_FromData(new FLSlice(data_, (ulong)data.Length), x, shared, new FLSlice(externData_, (ulong)externData.Length))); } }
/// <summary> /// Creates a database given a name and some configuration /// </summary> /// <param name="name">The name of the database</param> /// <param name="configuration">The configuration to open it with</param> public Database(string name, DatabaseConfiguration configuration = null) { Name = CBDebug.MustNotBeNull(Log.To.Database, Tag, nameof(name), name); Config = configuration?.Freeze() ?? new DatabaseConfiguration(true); Open(); FLSharedKeys *keys = null; ThreadSafety.DoLocked(() => keys = Native.c4db_getFLSharedKeys(_c4db)); _sharedStrings = new SharedStringCache(keys); }
// Note: Allocates unmanaged heap memory; should only be used with constants public static FLDictKey FLDictKey_InitWithSharedKeys(string str, FLSharedKeys *sk) { return(NativeRaw.FLDictKey_InitWithSharedKeys(FLSlice.Constant(str), sk)); }
public static extern FLSharedKeys *FLSharedKeys_Retain(FLSharedKeys *shared);
public static extern FLDictKey FLDictKey_InitWithSharedKeys(FLSlice @string, FLSharedKeys *sharedKeys);
public static extern FLValue *FLDict_GetSharedKey(FLDict *d, FLSlice keyString, FLSharedKeys *sk);
public static extern bool FLEncoder_WriteValueWithSharedKeys(FLEncoder *encoder, FLValue *value, FLSharedKeys *shared);
public static extern FLSlice FLSharedKeys_Decode(FLSharedKeys *shared, int key);
public static extern int FLSharedKeys_Encode(FLSharedKeys *shared, FLSlice str, [MarshalAs(UnmanagedType.U1)] bool add);
public static extern FLSliceResult FLSharedKeys_GetStateData(FLSharedKeys *shared);
public static string FLSharedKeys_Decode(FLSharedKeys *shared, int key) { return(NativeRaw.FLSharedKeys_Decode(shared, key).CreateString()); }
public static int FLSharedKeys_Encode(FLSharedKeys *shared, string str, bool add) { using (var str_ = new C4String(str)) { return(NativeRaw.FLSharedKeys_Encode(shared, (FLSlice)str_.AsFLSlice(), add)); } }
public static byte[] FLSharedKeys_GetStateData(FLSharedKeys *shared) { using (var retVal = NativeRaw.FLSharedKeys_GetStateData(shared)) { return(((FLSlice)retVal).ToArrayFast()); } }
public static extern void FLSharedKeys_Release(FLSharedKeys *shared);
public static extern void FLEncoder_SetSharedKeys(FLEncoder *encoder, FLSharedKeys *shared);
public static extern FLDoc *FLDoc_FromResultData(FLSliceResult data, FLTrust x, FLSharedKeys *shared, FLSlice externData);
public static extern FLSliceResult FLValue_ToJSONX(FLValue *v, FLSharedKeys *sk, [MarshalAs(UnmanagedType.U1)] bool json5, [MarshalAs(UnmanagedType.U1)] bool canonicalForm);
public static string FLValue_ToJSONX(FLValue *v, FLSharedKeys *sk, bool json5, bool canonicalForm) { using (var retVal = NativeRaw.FLValue_ToJSONX(v, sk, json5, canonicalForm)) { return(((FLSlice)retVal).CreateString()); } }
public static extern FLSlice FLSharedKey_GetKeyString(FLSharedKeys *sk, int keyCode, FLError *outError);
public static extern FLValue *FLKeyPath_EvalOnce(FLSlice specifier, FLSharedKeys *shared, FLValue *root, FLError *error);
public static extern FLKeyPath *FLKeyPath_New(FLSlice specifier, FLSharedKeys *shared, FLError *error);
public MRoot(FLSlice fleeceData, FLSharedKeys *sk = null, bool isMutable = true) : this(fleeceData, sk, NativeRaw.FLValue_FromData(fleeceData), isMutable) { }
public MRoot(FLSlice fleeceData, FLSharedKeys *sk, FLValue *value, bool isMutable = true) : this(new MContext(fleeceData, sk), isMutable) { }
public static string FLSharedKey_GetKeyString(FLSharedKeys *sk, int keyCode, FLError *outError) { return(NativeRaw.FLSharedKey_GetKeyString(sk, keyCode, outError).CreateString()); }
public static object AsObject(FLSlice fleeceData, FLSharedKeys *sk = null, bool mutableContainers = true) { using (var root = new MRoot(fleeceData, sk, mutableContainers)) { return(root.AsObject()); } }
public static extern void FLDictIterator_BeginShared(FLDict *dict, FLDictIterator *i, FLSharedKeys *shared);