Couchbase Lite
Objective-C API for iOS and Mac OS
Instance Methods | Properties | List of all members
<CBLValidationContext> Protocol Reference

Context passed into a CBLValidationBlock. More...

#import <CBLDatabase.h>

Inheritance diagram for <CBLValidationContext>:

Instance Methods

(void) - reject
 Rejects the proposed new revision. More...
 
(void) - rejectWithMessage:
 Rejects the proposed new revision. More...
 
(BOOL) - validateChanges:
 Calls the 'enumerator' block for each key that's changed, passing both the old and new values. More...
 

Properties

CBLSavedRevisioncurrentRevision
 The contents of the current revision of the document, or nil if this is a new document. More...
 
NSArray * changedKeys
 Returns an array of all the keys whose values are different between the current and new revisions. More...
 

Detailed Description

Context passed into a CBLValidationBlock.

Method Documentation

- (void) reject

Rejects the proposed new revision.

- (void) rejectWithMessage: (NSString *)  message

Rejects the proposed new revision.

Any resulting error will contain the provided message; for example, if the change came from an external HTTP request, the message will be in the response status line. The default message is "invalid document".

- (BOOL) validateChanges: (CBLChangeEnumeratorBlock enumerator

Calls the 'enumerator' block for each key that's changed, passing both the old and new values.

If the block returns NO, the enumeration stops and rejects the revision, and the method returns NO; else the method returns YES.

Property Documentation

- (CBLSavedRevision*) currentRevision
readatomicassign

The contents of the current revision of the document, or nil if this is a new document.

- (NSArray*) changedKeys
readatomicassign

Returns an array of all the keys whose values are different between the current and new revisions.


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