Couchbase Lite C
Couchbase Lite C API
Fleece+CoreFoundation.h
Go to the documentation of this file.
1//
2// Fleece+CoreFoundation.h
3//
4// Copyright 2016-Present Couchbase, Inc.
5//
6// Use of this software is governed by the Business Source License included
7// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
8// in that file, in accordance with the Business Source License, use of this
9// software will be governed by the Apache License, Version 2.0, included in
10// the file licenses/APL2.txt.
11//
12
13#pragma once
14#include <CoreFoundation/CFBase.h>
16
17#ifdef __OBJC__
18#import <Foundation/NSMapTable.h>
19#endif
20
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
33
34
38
39
42
43
44#ifdef __OBJC__
45 // Equivalents of the above functions that take & return Objective-C object types:
46
49 FLEECE_PUBLIC bool FLEncoder_WriteNSObject(FLEncoder, id) FLAPI;
50
51
53 FLEECE_PUBLIC NSMapTable* FLCreateSharedStringsTable(void) FLAPI;
54
55
57 FLEECE_PUBLIC id FLValue_GetNSObject(FLValue FL_NULLABLE, NSMapTable* FL_NULLABLE sharedStrings) FLAPI;
58
59
61 FLEECE_PUBLIC FLValue FLDict_GetWithNSString(FLDict FL_NULLABLE, NSString*) FLAPI;
62
63
65 FLEECE_PUBLIC NSString* FLDictIterator_GetKeyAsNSString(const FLDictIterator *i,
66 NSMapTable* FL_NULLABLE sharedStrings) FLAPI;
67
69 FLEECE_PUBLIC NSData* FLEncoder_FinishWithNSData(FLEncoder, NSError** FL_NULLABLE) FLAPI;
70
71
73 FLEECE_PUBLIC extern NSString* const FLErrorDomain;
74
75
76 @interface NSObject (Fleece)
81 - (void) fl_encodeToFLEncoder: (FLEncoder)enc;
82 @end
83#endif
84
87#ifdef __cplusplus
88}
89#endif
90
#define FL_NULLABLE
Definition: CompilerSupport.h:74
#define FLEECE_PUBLIC
Definition: CompilerSupport.h:241
#define FL_ASSUME_NONNULL_BEGIN
Definition: CompilerSupport.h:72
#define FL_ASSUME_NONNULL_END
Definition: CompilerSupport.h:73
#define FLAPI
Definition: CompilerSupport.h:247
FLEECE_PUBLIC bool FLEncoder_WriteCFObject(FLEncoder, CFTypeRef)
Writes a Core Foundation (or Objective-C) object to an Encoder.
FLEECE_PUBLIC FLValue FLDict_GetWithCFString(FLDict FL_NULLABLE, CFStringRef)
Same as FLDictGet, but takes the key as a CFStringRef.
FLEECE_PUBLIC CFTypeRef FLValue_CopyCFObject(FLValue FL_NULLABLE)
Returns a Value as a corresponding CoreFoundation object.
const struct _FLDict * FLDict
A reference to a dictionary (map) value.
Definition: FLBase.h:37
struct _FLEncoder * FLEncoder
A reference to an encoder.
Definition: FLBase.h:41
const struct _FLValue * FLValue
A reference to a value of any type.
Definition: FLBase.h:35
Opaque dictionary iterator.
Definition: FLCollections.h:144