Couchbase Lite
Objective-C API for iOS and Mac OS
Instance Methods | Properties | List of all members
CBLRevision Class Reference

A revision of a CBLDocument. More...

#import <CBLRevision.h>

Inheritance diagram for CBLRevision:
CBLSavedRevision CBLUnsavedRevision

Instance Methods

(NSArray *) - getRevisionHistory:
 Returns the ancestry of this revision as an array of CBLRevisions, in chronological order. More...
 
(id) - propertyForKey:
 Shorthand for [self.properties objectForKey: key]. More...
 
(id) - objectForKeyedSubscript:
 Same as -propertyForKey:. More...
 
(CBLAttachment *) - attachmentNamed:
 Looks up the attachment with the given name (without fetching its contents yet). More...
 

Properties

CBLDocumentdocument
 The document this is a revision of. More...
 
CBLDatabasedatabase
 The database this revision's document belongs to. More...
 
BOOL isDeletion
 Does this revision mark the deletion of its document? (In other words, does it have a "_deleted" property?) More...
 
BOOL isGone
 Does this revision mark the deletion or removal (from available channels) of its document ? (In other words, does it have a "_deleted_ or "_removed" property?) More...
 
NSString * revisionID
 The ID of this revision. More...
 
CBLSavedRevisionparentRevision
 The revision this one is a child of. More...
 
NSString * parentRevisionID
 The ID of the parentRevision. More...
 
NSDictionary * properties
 The revision's contents as parsed from JSON. More...
 
NSDictionary * userProperties
 The user-defined properties, without the ones reserved by CouchbaseLite. More...
 
NSArray * attachmentNames
 The names of all attachments (an array of strings). More...
 
NSArray * attachments
 All attachments, as CBLAttachment objects. More...
 

Detailed Description

A revision of a CBLDocument.

This is the abstract base class of CBLSavedRevision (existing revisions) and CBLNewRevision (revisions yet to be saved).

Method Documentation

- (NSArray*) getRevisionHistory: (NSError **)  outError

Returns the ancestry of this revision as an array of CBLRevisions, in chronological order.

Older revisions are NOT guaranteed to have their properties available.

- (id) propertyForKey: (NSString *)  key

Shorthand for [self.properties objectForKey: key].

- (id) objectForKeyedSubscript: (NSString *)  key

Same as -propertyForKey:.

Enables "[]" access in Xcode 4.4+

- (CBLAttachment*) attachmentNamed: (NSString *)  name

Looks up the attachment with the given name (without fetching its contents yet).

Property Documentation

- (CBLDocument*) document
readatomicweak

The document this is a revision of.

- (CBLDatabase*) database
readatomicassign

The database this revision's document belongs to.

- (BOOL) isDeletion
readatomicassign

Does this revision mark the deletion of its document? (In other words, does it have a "_deleted" property?)

- (BOOL) isGone
readatomicassign

Does this revision mark the deletion or removal (from available channels) of its document ? (In other words, does it have a "_deleted_ or "_removed" property?)

- (NSString*) revisionID
readatomicassign

The ID of this revision.

Will be nil if this is an unsaved CBLNewRevision.

- (CBLSavedRevision*) parentRevision
readatomicassign

The revision this one is a child of.

- (NSString*) parentRevisionID
readatomicassign

The ID of the parentRevision.

- (NSDictionary*) properties
readatomiccopy

The revision's contents as parsed from JSON.

Keys beginning with "_" are defined and reserved by CouchbaseLite; others are app-specific. The first call to this method may need to fetch the properties from disk, but subsequent calls are very cheap.

- (NSDictionary*) userProperties
readatomiccopy

The user-defined properties, without the ones reserved by CouchbaseLite.

This is based on -properties, with every key whose name starts with "_" removed.

- (NSArray*) attachmentNames
readatomicassign

The names of all attachments (an array of strings).

- (NSArray*) attachments
readatomicassign

All attachments, as CBLAttachment objects.


The documentation for this class was generated from the following file: