Skip to content

Commit

Permalink
New Version of couchbase
Browse files Browse the repository at this point in the history
  • Loading branch information
rickymediaengine committed May 31, 2019
1 parent f403d7d commit b28c60c
Show file tree
Hide file tree
Showing 77 changed files with 699 additions and 184 deletions.
Binary file removed lib/android/couchbase-lite-android-2.0.2.aar
Binary file not shown.
Binary file added lib/android/couchbase-lite-android-2.5.0.aar
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/ios/CouchbaseLite.framework.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<string>2.5.1</string>
<key>CFBundleVersion</key>
<string>10</string>
<string>1</string>
</dict>
</plist>
Binary file not shown.
Binary file removed lib/ios/CouchbaseLite.framework/CouchbaseLite
Binary file not shown.
1 change: 1 addition & 0 deletions lib/ios/CouchbaseLite.framework/CouchbaseLite
1 change: 1 addition & 0 deletions lib/ios/CouchbaseLite.framework/Headers
140 changes: 0 additions & 140 deletions lib/ios/CouchbaseLite.framework/Headers/CBLQueryRow.h

This file was deleted.

Binary file removed lib/ios/CouchbaseLite.framework/Info.plist
Binary file not shown.
1 change: 1 addition & 0 deletions lib/ios/CouchbaseLite.framework/Modules
1 change: 1 addition & 0 deletions lib/ios/CouchbaseLite.framework/PrivateHeaders
1 change: 1 addition & 0 deletions lib/ios/CouchbaseLite.framework/Resources
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// CBLConsoleLogger.h
// CouchbaseLite
//
// Copyright (c) 2018 Couchbase, Inc All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>
#import "CBLLogger.h"

NS_ASSUME_NONNULL_BEGIN

/** Console logger for writing log messages to the system console. */
@interface CBLConsoleLogger : NSObject <CBLLogger>

/** The minimum log level of the log messages to be logged. The default log level for
console logger is warning. */
@property (nonatomic) CBLLogLevel level;

/** The set of log domains of the log messages to be logged. By default, the log
messages of all domains will be logged. */
@property (nonatomic) CBLLogDomain domains;

/** Not available */
- (instancetype) init NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,17 @@
//

#import <Foundation/Foundation.h>
#import "CBLLogger.h"
@class CBLDatabaseConfiguration;
@class CBLDocument, CBLMutableDocument, CBLDocumentFragment;
@class CBLDatabaseChange, CBLDocumentChange;
@class CBLIndex;
@class CBLLog;
@protocol CBLConflictResolver;
@protocol CBLListenerToken;

NS_ASSUME_NONNULL_BEGIN

/**
Log domain. The log domains here are tentative and subject to change.
*/
typedef NS_ENUM(uint32_t, CBLLogDomain) {
kCBLLogDomainAll,
kCBLLogDomainDatabase,
kCBLLogDomainQuery,
kCBLLogDomainReplicator,
kCBLLogDomainNetwork,
};


/**
Log level. The default log level for all domains is kCBLLogLevelWarning.
The log levels here are tentative and subject to change.
*/
typedef NS_ENUM(uint32_t, CBLLogLevel) {
kCBLLogLevelDebug,
kCBLLogLevelVerbose,
kCBLLogLevelInfo,
kCBLLogLevelWarning,
kCBLLogLevelError,
kCBLLogLevelNone
};


/**
Concurruncy control type used when saving or deleting a document.
Expand Down Expand Up @@ -104,7 +81,7 @@ typedef NS_ENUM(uint32_t, CBLConcurrencyControl) {
*/
- (nullable instancetype) initWithName: (NSString*)name
config: (nullable CBLDatabaseConfiguration*)config
error: (NSError**)error NS_DESIGNATED_INITIALIZER;
error: (NSError**)error;

/** Not available */
- (instancetype) init NS_UNAVAILABLE;
Expand All @@ -114,11 +91,11 @@ typedef NS_ENUM(uint32_t, CBLConcurrencyControl) {


/**
Gets an existing CBLMutableDocument object with the given ID. If the document with the given ID
Gets an existing document with the given ID. If a document with the given ID
doesn't exist in the database, the value returned will be nil.
@param id The document ID.
@return The CBLMutableDocument object.
@return The CBLDocument object.
*/
- (nullable CBLDocument*) documentWithID: (NSString*)id;

Expand Down Expand Up @@ -204,6 +181,18 @@ typedef NS_ENUM(uint32_t, CBLConcurrencyControl) {
- (BOOL) purgeDocument: (CBLDocument*)document error: (NSError**)error;


/**
Purges the document for the given documentID from the database.
This is more drastic than deletion: it removes all traces of the document.
The purge will NOT be replicated to other databases.
@param documentID The ID of the document to be purged.
@param error On return, the error if any.
@return True on success, false on failure.
*/
- (BOOL) purgeDocumentWithID: (NSString*)documentID error: (NSError**)error;


#pragma mark - Batch Operation


Expand Down Expand Up @@ -290,12 +279,21 @@ typedef NS_ENUM(uint32_t, CBLConcurrencyControl) {
#pragma mark - Logging

/**
Sets log level for the given log domain.
This function is deprecated. Use CBLDatabase.log.console to set log level and domains instead.
@param level The log level.
@param domain The log domain.
*/
+ (void) setLogLevel: (CBLLogLevel)level domain: (CBLLogDomain)domain;
+ (void) setLogLevel: (CBLLogLevel)level domain: (CBLLogDomain)domain
__attribute__((deprecated("Use CBLDatabase.log.console instead.")));


/**
Log object used for configuring console, file, and custom logger.
@return log object
*/
+ (CBLLog*) log;

#pragma mark - Change Listener

Expand Down Expand Up @@ -382,6 +380,29 @@ typedef NS_ENUM(uint32_t, CBLConcurrencyControl) {
- (BOOL) deleteIndexForName: (NSString*)name error: (NSError**)error;


#pragma mark - DOCUMENT EXPIRATION

/**
Sets an expiration date on a document.
After this time the document will be purged from the database.
@param documentID The ID of the document to set the expiration date for
@param date The expiration date. Set nil date will reset the document expiration.
@param error error On return, the error if any.
@return True on success, false on failure.
*/
- (BOOL) setDocumentExpirationWithID: (NSString*)documentID
expiration: (nullable NSDate*)date
error: (NSError**)error;

/**
Returns the expiration time of a document, if exists, else nil.
@param documentID The ID of the document to set the expiration date for
@return the expiration time of a document, if one has been set, else nil.
*/
- (nullable NSDate*) getDocumentExpirationWithID: (NSString*)documentID;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// CBLDocumentFlags.h
// CouchbaseLite
//
// Copyright (c) 2017 Couchbase, Inc All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#pragma once

/** Document flags describing a replicated document. */
typedef NS_OPTIONS(NSUInteger, CBLDocumentFlags) {
kCBLDocumentFlagsDeleted = 1 << 0, ///< Indicating that the replicated document has been deleted.
kCBLDocumentFlagsAccessRemoved = 1 << 1 ///< Indicating that the document's access has been removed as a result of
/// removal from all Sync Gateway channels that a user has access to.
};
Loading

0 comments on commit b28c60c

Please sign in to comment.