A CBLScope represents a scope or namespace of the collections.
More...
A CBLScope represents a scope or namespace of the collections.
The scope implicitly exists when there is at least one collection created under the scope. The default scope is exceptional in that it will always exists even there are no collections under it.
CBLScope
Lifespan
CBLScope
is ref-counted. Same as the CBLCollection, the CBLScope objects retrieved from the database must be released after you are done using them. When the database is closed or released, the scope objects will become invalid, most operations on the invalid CBLCollection object will fail with kCBLErrorNotOpen error result.
◆ CBLScope
◆ CBLScope_Collection()
Returns an existing collection in the scope with the given name.
- Note
- You are responsible for releasing the returned collection.
- Parameters
-
scope | The scope. |
collectionName | The name of the collection. |
outError | On failure, the error will be written here. |
- Returns
- A CBLCollection instance, or NULL if the collection doesn't exist or an error occurred.
◆ CBLScope_CollectionNames()
Returns the names of all collections in the scope.
- Note
- You are responsible for releasing the returned array.
- Parameters
-
scope | The scope. |
outError | On failure, the error will be written here. |
- Returns
- The names of all collections in the scope, or NULL if an error occurred.
◆ CBLScope_Database()
Returns the scope's database.
- Note
- The database object is owned by the scope object; you do not need to release it.
- Parameters
-
- Returns
- The database of the scope.
◆ CBLScope_Name()
Returns the name of the scope.
- Parameters
-
- Returns
- The name of the scope.
◆ CBLScope_Release()
static void CBLScope_Release |
( |
const CBLScope * |
t | ) |
|
|
inlinestatic |
◆ CBLScope_Retain()
◆ kCBLDefaultScopeName
The default scope's name.