C# Class CBForest.Native

Bridge into CBForest-Interop.dll
Show file Open project: buzzfeed/cbforest

Public Methods

Method Description
c4db_close ( C4Database db, C4Error outError ) : bool

Closes the database and frees the object.

c4db_delete ( C4Database db, C4Error outError ) : bool

Closes the database, deletes the file, and frees the object

c4db_enumerateAllDocs ( C4Database db, C4Slice startDocID, C4Slice endDocID, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
c4db_enumerateAllDocs ( C4Database db, string startDocID, string endDocID, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*

Creates an enumerator ordered by docID. Options have the same meanings as in Couchbase Lite. There's no 'limit' option; just stop enumerating when you're done. Caller is responsible for freeing the enumerator when finished with it.

c4db_enumerateChanges ( C4Database db, ulong since, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*

Creates an enumerator ordered by sequence. Caller is responsible for freeing the enumerator when finished with it.

c4db_enumerateSomeDocs ( C4Database db, string docIDs, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
c4db_open ( C4Slice path, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4Database*
c4db_open ( string path, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4Database*

Opens a database.

c4db_purgeDoc ( C4Database db, string docId, C4Error outError ) : bool
c4doc_free ( C4Document doc ) : void
c4doc_get ( C4Database db, C4Slice docID, bool mustExist, C4Error outError ) : C4Document*
c4doc_get ( C4Database db, string docID, bool mustExist, C4Error outError ) : C4Document*

Gets a document from the database. If there's no such document, the behavior depends on the mustExist flag.If it's true, NULL is returned. If it's false, a valid C4Document The current revision is selected(if the document exists.)

c4doc_getType ( C4Document doc ) : string

Returns the document type (as set by setDocType.) This value is ignored by CBForest itself; by convention Couchbase Lite sets it to the value of the current revision's "type" property, and uses it as an optimization when indexing a view.

c4doc_insertRevision ( C4Document doc, string revID, string body, bool deleted, bool hasAttachments, bool allowConflict, C4Error outError ) : int

Adds a revision to a document, as a child of the currently selected revision (or as a root revision if there is no selected revision.) On success, the new revision will be selected. Must be called within a transaction.

c4doc_insertRevisionWithHistory ( C4Document doc, string body, bool deleted, bool hasAttachments, string history, C4Error outError ) : int
c4doc_purgeRevision ( C4Document doc, string revId, C4Error outError ) : int
c4doc_selectRevision ( C4Document doc, string revID, bool withBody, C4Error outError ) : bool

Selects a specific revision of a document (or no revision, if revID is NULL.)

c4doc_setType ( C4Document doc, string docType, C4Error outError ) : bool

Sets a document's docType. (By convention this is the value of the "type" property of the current revision's JSON; this value can be used as optimization when indexing a view.) The change will not be persisted until the document is saved.

c4enum_free ( C4DocEnumerator e ) : void
c4enum_nextDocument ( C4DocEnumerator e, C4Error outError ) : C4Document*

Returns the next document from an enumerator, or NULL if there are no more. The caller is responsible for freeing the C4Document. Don't forget to free the enumerator itself when finished with it.

c4indexer_begin ( C4Database db, C4View views, C4Error outError ) : C4Indexer*

Creates an indexing task on one or more views in a database.

c4indexer_emit ( C4Indexer indexer, C4Document document, uint viewNumber, C4Key emittedKeys, C4Slice emittedValues, C4Error outError ) : bool

Emits new keys/values derived from one document, for one view. This function needs to be called once for each(document, view) pair.Even if the view's map function didn't emit anything, the old keys/values need to be cleaned up. Values are uninterpreted by CBForest, but by convention are JSON. A special value "*" (a single asterisk) is used as a placeholder for the entire document.

c4indexer_emit ( C4Indexer indexer, C4Document document, uint viewNumber, C4Key emittedKeys, string emittedValues, C4Error outError ) : bool
c4indexer_end ( C4Indexer indexer, bool commit, C4Error outError ) : bool

Finishes an indexing task and frees the indexer reference.

c4indexer_enumerateDocuments ( C4Indexer indexer, C4Error outError ) : C4DocEnumerator*
c4key_addMapKey ( C4Key key, string s ) : void

Adds a map key, before the next value. When adding to a map, every value must be preceded by a key.

c4key_addString ( C4Key key, string s ) : void

Adds a string to a C4Key.

c4key_free ( C4Key key ) : void

Frees a C4Key.

c4key_new ( ) : C4Key*

Creates a new empty C4Key.

c4key_readString ( C4KeyReader reader ) : string

Reads a string value

c4key_toJSON ( C4KeyReader reader ) : string

Converts a C4KeyReader to JSON.

c4key_withBytes ( C4Slice slice ) : C4Key*
c4key_withBytes ( IEnumerable bytes ) : C4Key*

Creates a C4Key by copying the data, which must be in the C4Key binary format.

c4log_register ( C4LogLevel level, string>.Action callback ) : void
c4queryenum_free ( C4QueryEnumerator e ) : void

Frees a query enumerator.

c4raw_free ( C4RawDocument rawDoc ) : void

Frees the storage occupied by a raw document.

c4raw_get ( C4Database db, C4Slice storeName, C4Slice docID, C4Error outError ) : C4RawDocument*
c4raw_get ( C4Database db, string storeName, string docID, C4Error outError ) : C4RawDocument*

Reads a raw document from the database. In Couchbase Lite the store named "info" is used for per-database key/value pairs, and the store "_local" is used for local documents.

c4raw_put ( C4Database db, string storeName, string key, string meta, string body, C4Error outError ) : bool

Writes a raw document to the database, or deletes it if both meta and body are NULL.

c4view_close ( C4View view, C4Error outError ) : bool

Closes the view and frees the object.

c4view_delete ( C4View view, C4Error outError ) : bool

Deletes the database file and closes/frees the C4View.

c4view_open ( C4Database db, C4Slice path, C4Slice viewName, C4Slice version, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4View*
c4view_open ( C4Database db, string path, string viewName, string version, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4View*

Opens a view, or creates it if the file doesn't already exist.

c4view_query ( C4View view, C4QueryOptions options, C4Error outError ) : C4QueryEnumerator*

Runs a query and returns an enumerator for the results. The enumerator's fields are not valid until you call c4queryenum_next(), though.

Private Methods

Method Description
BridgeSlice ( Func nativeFunc ) : string
CheckMemoryLeaks ( ) : void
_c4db_close ( C4Database db, C4Error outError ) : bool
_c4db_delete ( C4Database db, C4Error outError ) : bool
_c4db_enumerateAllDocs ( C4Database db, C4Slice startDocID, C4Slice endDocID, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
_c4db_enumerateChanges ( C4Database db, ulong since, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
_c4db_enumerateSomeDocs ( C4Database db, C4Slice docIDs, uint docIDsCount, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
_c4db_open ( C4Slice path, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4Database*
_c4doc_free ( C4Document doc ) : void
_c4doc_get ( C4Database db, C4Slice docID, [ mustExist, C4Error outError ) : C4Document*
_c4doc_getType ( C4Document doc ) : C4Slice
_c4enum_free ( C4DocEnumerator e ) : void
_c4enum_nextDocument ( C4DocEnumerator e, C4Error outError ) : C4Document*
_c4indexer_begin ( C4Database db, C4View views, int viewCount, C4Error outError ) : C4Indexer*
_c4indexer_end ( C4Indexer indexer, [ commit, C4Error outError ) : bool
_c4indexer_enumerateDocuments ( C4Indexer indexer, C4Error outError ) : C4DocEnumerator*
_c4key_free ( C4Key key ) : void
_c4key_new ( ) : C4Key*
_c4key_readString ( C4KeyReader reader ) : C4Slice
_c4key_toJSON ( C4KeyReader reader ) : C4Slice
_c4key_withBytes ( C4Slice slice ) : C4Key*
_c4queryenum_free ( C4QueryEnumerator e ) : void
_c4raw_free ( C4RawDocument rawDoc ) : void
_c4raw_get ( C4Database db, C4Slice storeName, C4Slice docID, C4Error outError ) : C4RawDocument*
_c4view_close ( C4View view, C4Error outError ) : bool
_c4view_delete ( C4View view, C4Error outError ) : bool
_c4view_open ( C4Database db, C4Slice path, C4Slice viewName, C4Slice version, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4View*
_c4view_query ( C4View view, C4QueryOptions options, C4Error outError ) : C4QueryEnumerator*
c4db_beginTransaction ( C4Database db, C4Error outError ) : bool
c4db_compact ( C4Database db, C4Error outError ) : bool
c4db_endTransaction ( C4Database db, [ commit, C4Error outError ) : bool
c4db_getDocumentCount ( C4Database db ) : ulong
c4db_getLastSequence ( C4Database db ) : ulong
c4db_isInTransaction ( C4Database db ) : bool
c4db_purgeDoc ( C4Database db, C4Slice docId, C4Error outError ) : bool
c4db_rekey ( C4Database db, C4EncryptionKey newKey, C4Error outError ) : bool
c4doc_getBySequence ( C4Database db, ulong sequence, C4Error outError ) : C4Document*
c4doc_hasRevisionBody ( C4Document doc ) : bool
c4doc_insertRevision ( C4Document doc, C4Slice revID, C4Slice body, [ deleted, [ hasAttachments, [ allowConflict, C4Error outError ) : int
c4doc_insertRevisionWithHistory ( C4Document doc, C4Slice body, [ deleted, [ hasAttachments, C4Slice history, uint historyCount, C4Error outError ) : int
c4doc_loadRevisionBody ( C4Document doc, C4Error outError ) : bool
c4doc_purgeRevision ( C4Document doc, C4Slice revId, C4Error outError ) : int
c4doc_save ( C4Document doc, uint maxRevTreeDepth, C4Error outError ) : bool
c4doc_selectCurrentRevision ( C4Document doc ) : bool
c4doc_selectNextLeafRevision ( C4Document doc, [ includeDeleted, [ withBody, C4Error outError ) : bool
c4doc_selectNextRevision ( C4Document doc ) : bool
c4doc_selectParentRevision ( C4Document doc ) : bool
c4doc_selectRevision ( C4Document doc, C4Slice revID, [ withBody, C4Error outError ) : bool
c4doc_setType ( C4Document doc, C4Slice docType, C4Error outError ) : bool
c4indexer_emit ( C4Indexer indexer, C4Document document, uint viewNumber, uint emitCount, C4Key emittedKeys, C4Slice emittedValues, C4Error outError ) : bool
c4key_addBool ( C4Key key, [ b ) : void
c4key_addMapKey ( C4Key key, C4Slice s ) : void
c4key_addNull ( C4Key key ) : void
c4key_addNumber ( C4Key key, double d ) : void
c4key_addString ( C4Key key, C4Slice s ) : void
c4key_beginArray ( C4Key key ) : void
c4key_beginMap ( C4Key key ) : void
c4key_endArray ( C4Key key ) : void
c4key_endMap ( C4Key key ) : void
c4key_peek ( C4KeyReader reader ) : C4KeyToken
c4key_read ( C4Key key ) : C4KeyReader
c4key_readBool ( C4KeyReader reader ) : bool
c4key_readNumber ( C4KeyReader reader ) : double
c4key_skipToken ( C4KeyReader reader ) : void
c4log_register ( C4LogLevel level, C4LogCallback callback ) : void
c4log_wedge ( C4LogLevel level, C4Slice message ) : void
c4queryenum_next ( C4QueryEnumerator e, C4Error outError ) : bool
c4raw_put ( C4Database db, C4Slice storeName, C4Slice key, C4Slice meta, C4Slice body, C4Error outError ) : bool
c4slice_free ( C4Slice slice ) : void
c4view_eraseIndex ( C4View view, C4Error outError ) : bool
c4view_getLastSequenceChangedAt ( C4View view ) : ulong
c4view_getLastSequenceIndexed ( C4View view ) : ulong
c4view_getTotalRows ( C4View view ) : ulong
c4view_rekey ( C4View view, C4EncryptionKey newKey, C4Error outError ) : bool
memcmp ( void b1, void b2, UIntPtr count ) : int
memcpy ( void dest, void src, UIntPtr count ) : int

Method Details

c4db_close() public static method

Closes the database and frees the object.
public static c4db_close ( C4Database db, C4Error outError ) : bool
db C4Database The DB object to close
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4db_delete() public static method

Closes the database, deletes the file, and frees the object
public static c4db_delete ( C4Database db, C4Error outError ) : bool
db C4Database The DB object to delete
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4db_enumerateAllDocs() public static method

public static c4db_enumerateAllDocs ( C4Database db, C4Slice startDocID, C4Slice endDocID, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
db C4Database
startDocID C4Slice
endDocID C4Slice
options C4EnumeratorOptions
outError C4Error
return C4DocEnumerator*

c4db_enumerateAllDocs() public static method

Creates an enumerator ordered by docID. Options have the same meanings as in Couchbase Lite. There's no 'limit' option; just stop enumerating when you're done. Caller is responsible for freeing the enumerator when finished with it.
public static c4db_enumerateAllDocs ( C4Database db, string startDocID, string endDocID, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
db C4Database The database to operate on
startDocID string The document ID to begin at
endDocID string The document ID to end at
options C4EnumeratorOptions Enumeration options (NULL for defaults)
outError C4Error The error that occurred if the operation doesn't succeed
return C4DocEnumerator*

c4db_enumerateChanges() public static method

Creates an enumerator ordered by sequence. Caller is responsible for freeing the enumerator when finished with it.
public static c4db_enumerateChanges ( C4Database db, ulong since, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
db C4Database The database to operate on
since ulong The sequence number to start _after_.Pass 0 to start from the beginning.
options C4EnumeratorOptions Enumeration options (NULL for defaults).
outError C4Error The error that occurred if the operation doesn't succeed
return C4DocEnumerator*

c4db_enumerateSomeDocs() public static method

public static c4db_enumerateSomeDocs ( C4Database db, string docIDs, C4EnumeratorOptions options, C4Error outError ) : C4DocEnumerator*
db C4Database
docIDs string
options C4EnumeratorOptions
outError C4Error
return C4DocEnumerator*

c4db_open() public static method

public static c4db_open ( C4Slice path, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4Database*
path C4Slice
flags C4DatabaseFlags
encryptionKey C4EncryptionKey
outError C4Error
return C4Database*

c4db_open() public static method

Opens a database.
public static c4db_open ( string path, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4Database*
path string The path to the DB file
flags C4DatabaseFlags
encryptionKey C4EncryptionKey The option encryption key used to encrypt the database
outError C4Error The error that occurred if the operation doesn't succeed
return C4Database*

c4db_purgeDoc() public static method

public static c4db_purgeDoc ( C4Database db, string docId, C4Error outError ) : bool
db C4Database
docId string
outError C4Error
return bool

c4doc_free() public static method

public static c4doc_free ( C4Document doc ) : void
doc C4Document
return void

c4doc_get() public static method

public static c4doc_get ( C4Database db, C4Slice docID, bool mustExist, C4Error outError ) : C4Document*
db C4Database
docID C4Slice
mustExist bool
outError C4Error
return C4Document*

c4doc_get() public static method

Gets a document from the database. If there's no such document, the behavior depends on the mustExist flag.If it's true, NULL is returned. If it's false, a valid C4Document The current revision is selected(if the document exists.)
public static c4doc_get ( C4Database db, string docID, bool mustExist, C4Error outError ) : C4Document*
db C4Database The database to retrieve from
docID string The ID of the document to retrieve
mustExist bool Whether or not to create the document on demand
outError C4Error The error that occurred if the operation doesn't succeed
return C4Document*

c4doc_getType() public static method

Returns the document type (as set by setDocType.) This value is ignored by CBForest itself; by convention Couchbase Lite sets it to the value of the current revision's "type" property, and uses it as an optimization when indexing a view.
public static c4doc_getType ( C4Document doc ) : string
doc C4Document The document to operate on
return string

c4doc_insertRevision() public static method

Adds a revision to a document, as a child of the currently selected revision (or as a root revision if there is no selected revision.) On success, the new revision will be selected. Must be called within a transaction.
public static c4doc_insertRevision ( C4Document doc, string revID, string body, bool deleted, bool hasAttachments, bool allowConflict, C4Error outError ) : int
doc C4Document The document to operate on
revID string The ID of the revision being inserted
body string The (JSON) body of the revision
deleted bool True if this revision is a deletion (tombstone)
hasAttachments bool True if this revision contains an _attachments dictionary
allowConflict bool If false, and the parent is not a leaf, a 409 error is returned
outError C4Error The error that occurred if the operation doesn't succeed
return int

c4doc_insertRevisionWithHistory() public static method

public static c4doc_insertRevisionWithHistory ( C4Document doc, string body, bool deleted, bool hasAttachments, string history, C4Error outError ) : int
doc C4Document The document to operate on
body string The (JSON) body of the revision
deleted bool True if this revision is a deletion (tombstone)
hasAttachments bool True if this revision contains an _attachments dictionary
history string The ancestors' revision IDs, starting with the parent, in reverse order
outError C4Error The error that occurred if the operation doesn't succeed
return int

c4doc_purgeRevision() public static method

public static c4doc_purgeRevision ( C4Document doc, string revId, C4Error outError ) : int
doc C4Document
revId string
outError C4Error
return int

c4doc_selectRevision() public static method

Selects a specific revision of a document (or no revision, if revID is NULL.)
public static c4doc_selectRevision ( C4Document doc, string revID, bool withBody, C4Error outError ) : bool
doc C4Document The document to operate on
revID string The revID of the revision to select
withBody bool Whether or not to load the body of the revision
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4doc_setType() public static method

Sets a document's docType. (By convention this is the value of the "type" property of the current revision's JSON; this value can be used as optimization when indexing a view.) The change will not be persisted until the document is saved.
public static c4doc_setType ( C4Document doc, string docType, C4Error outError ) : bool
doc C4Document The document to operate on
docType string The document type to set
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4enum_free() public static method

public static c4enum_free ( C4DocEnumerator e ) : void
e C4DocEnumerator
return void

c4enum_nextDocument() public static method

Returns the next document from an enumerator, or NULL if there are no more. The caller is responsible for freeing the C4Document. Don't forget to free the enumerator itself when finished with it.
public static c4enum_nextDocument ( C4DocEnumerator e, C4Error outError ) : C4Document*
e C4DocEnumerator The enumerator to operate on
outError C4Error The error that occurred if the operation doesn't succeed
return C4Document*

c4indexer_begin() public static method

Creates an indexing task on one or more views in a database.
public static c4indexer_begin ( C4Database db, C4View views, C4Error outError ) : C4Indexer*
db C4Database The database to operate on
views C4View An array of views whose indexes should be updated in parallel.
outError C4Error The error that occurred if the operation doesn't succeed
return C4Indexer*

c4indexer_emit() public static method

Emits new keys/values derived from one document, for one view. This function needs to be called once for each(document, view) pair.Even if the view's map function didn't emit anything, the old keys/values need to be cleaned up. Values are uninterpreted by CBForest, but by convention are JSON. A special value "*" (a single asterisk) is used as a placeholder for the entire document.
public static c4indexer_emit ( C4Indexer indexer, C4Document document, uint viewNumber, C4Key emittedKeys, C4Slice emittedValues, C4Error outError ) : bool
indexer C4Indexer The indexer to operate on
document C4Document The document being indexed
viewNumber uint The position of the view in the indexer's views[] array
emittedKeys C4Key Array of keys being emitted
emittedValues C4Slice Array of values being emitted. (JSON by convention.)
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4indexer_emit() public static method

public static c4indexer_emit ( C4Indexer indexer, C4Document document, uint viewNumber, C4Key emittedKeys, string emittedValues, C4Error outError ) : bool
indexer C4Indexer
document C4Document
viewNumber uint
emittedKeys C4Key
emittedValues string
outError C4Error
return bool

c4indexer_end() public static method

Finishes an indexing task and frees the indexer reference.
public static c4indexer_end ( C4Indexer indexer, bool commit, C4Error outError ) : bool
indexer C4Indexer The indexer to operate on
commit bool True to commit changes to the indexes, false to abort
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4indexer_enumerateDocuments() public static method

public static c4indexer_enumerateDocuments ( C4Indexer indexer, C4Error outError ) : C4DocEnumerator*
indexer C4Indexer
outError C4Error
return C4DocEnumerator*

c4key_addMapKey() public static method

Adds a map key, before the next value. When adding to a map, every value must be preceded by a key.
public static c4key_addMapKey ( C4Key key, string s ) : void
key C4Key The key to operate on
s string The value to store
return void

c4key_addString() public static method

Adds a string to a C4Key.
public static c4key_addString ( C4Key key, string s ) : void
key C4Key
s string The value to store
return void

c4key_free() public static method

Frees a C4Key.
public static c4key_free ( C4Key key ) : void
key C4Key The key to free
return void

c4key_new() public static method

Creates a new empty C4Key.
public static c4key_new ( ) : C4Key*
return C4Key*

c4key_readString() public static method

Reads a string value
public static c4key_readString ( C4KeyReader reader ) : string
reader C4KeyReader The reader to operate on
return string

c4key_toJSON() public static method

Converts a C4KeyReader to JSON.
public static c4key_toJSON ( C4KeyReader reader ) : string
reader C4KeyReader The reader to operate on
return string

c4key_withBytes() public static method

public static c4key_withBytes ( C4Slice slice ) : C4Key*
slice C4Slice
return C4Key*

c4key_withBytes() public static method

Creates a C4Key by copying the data, which must be in the C4Key binary format.
public static c4key_withBytes ( IEnumerable bytes ) : C4Key*
bytes IEnumerable The data to use in the C4Key
return C4Key*

c4log_register() public static method

public static c4log_register ( C4LogLevel level, string>.Action callback ) : void
level C4LogLevel
callback string>.Action
return void

c4queryenum_free() public static method

Frees a query enumerator.
public static c4queryenum_free ( C4QueryEnumerator e ) : void
e C4QueryEnumerator The enumerator to free
return void

c4raw_free() public static method

Frees the storage occupied by a raw document.
public static c4raw_free ( C4RawDocument rawDoc ) : void
rawDoc C4RawDocument
return void

c4raw_get() public static method

public static c4raw_get ( C4Database db, C4Slice storeName, C4Slice docID, C4Error outError ) : C4RawDocument*
db C4Database
storeName C4Slice
docID C4Slice
outError C4Error
return C4RawDocument*

c4raw_get() public static method

Reads a raw document from the database. In Couchbase Lite the store named "info" is used for per-database key/value pairs, and the store "_local" is used for local documents.
public static c4raw_get ( C4Database db, string storeName, string docID, C4Error outError ) : C4RawDocument*
db C4Database The database to operate on
storeName string The name of the store to read from
docID string The ID of the document to retrieve
outError C4Error The error that occurred if the operation doesn't succeed
return C4RawDocument*

c4raw_put() public static method

Writes a raw document to the database, or deletes it if both meta and body are NULL.
public static c4raw_put ( C4Database db, string storeName, string key, string meta, string body, C4Error outError ) : bool
db C4Database The database to operate on
storeName string The store to write to
key string The key to store
meta string The metadata to store
body string The body to store
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4view_close() public static method

Closes the view and frees the object.
public static c4view_close ( C4View view, C4Error outError ) : bool
view C4View The view to close
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4view_delete() public static method

Deletes the database file and closes/frees the C4View.
public static c4view_delete ( C4View view, C4Error outError ) : bool
view C4View The view to operate on
outError C4Error The error that occurred if the operation doesn't succeed
return bool

c4view_open() public static method

public static c4view_open ( C4Database db, C4Slice path, C4Slice viewName, C4Slice version, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4View*
db C4Database
path C4Slice
viewName C4Slice
version C4Slice
flags C4DatabaseFlags
encryptionKey C4EncryptionKey
outError C4Error
return C4View*

c4view_open() public static method

Opens a view, or creates it if the file doesn't already exist.
public static c4view_open ( C4Database db, string path, string viewName, string version, C4DatabaseFlags flags, C4EncryptionKey encryptionKey, C4Error outError ) : C4View*
db C4Database The database the view is associated with
path string The file that the view is stored in
viewName string The name of the view
version string The version of the view's map function
flags C4DatabaseFlags The flags for opening the view file
encryptionKey C4EncryptionKey The option encryption key used to encrypt the database
outError C4Error The error that occurred if the operation doesn't succeed
return C4View*

c4view_query() public static method

Runs a query and returns an enumerator for the results. The enumerator's fields are not valid until you call c4queryenum_next(), though.
public static c4view_query ( C4View view, C4QueryOptions options, C4Error outError ) : C4QueryEnumerator*
view C4View The view to operate on
options C4QueryOptions The query options
outError C4Error The error that occurred if the operation doesn't succeed
return C4QueryEnumerator*