-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathLDBWriteBatch.h
77 lines (56 loc) · 1.75 KB
/
LDBWriteBatch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// WriteBatch.h
//
// Copyright 2013 Storm Labs.
// See LICENCE for details.
//
#import <Foundation/Foundation.h>
#import "LevelDB.h"
@interface LDBWritebatch : NSObject
@property (nonatomic, assign) id db;
/**
Remove a key (and its associated value) from the database
@param key The key to remove from the database
*/
- (void) removeObjectForKey:(id)key;
/**
Remove a set of keys (and their associated values) from the database
@param keyArray An array of keys to remove from the database
*/
- (void) removeObjectsForKeys:(NSArray *)keyArray;
/**
Remove all objects from the database
*/
- (void) removeAllObjects;
/**
Set the raw data associated with a key in the database
The instance's encoder block will *not* be used to produce a NSData instance from the provided value.
@param data The raw data value to put in the database
@param key The key at which the value can be found
*/
- (void) setData:(NSData *)data forKey:(id)key;
/**
Set the value associated with a key in the database
The instance's encoder block will be used to produce a NSData instance from the provided value.
@param value The value to put in the database
@param key The key at which the value can be found
*/
- (void) setObject:(id)value forKey:(id)key;
/**
* Same as `[self setObject:forKey:]`
* */
- (void) setObject:(id)value forKeyedSubscript:(id)key;
/**
Same as `[self setObject:forKey:]`
*/
- (void) setValue:(id)value forKey:(NSString *)key;
/**
Take all key-value pairs in the provided dictionary and insert them in the database
@param dictionary A dictionary from which key-value pairs will be inserted
*/
- (void) addEntriesFromDictionary:(NSDictionary *)dictionary;
/**
Apply the write batch to the underlying database
*/
- (void) apply;
@end