#import <CDBFile.h>
Inherits CDBFile.
This is a thin Objective-C wrapper around Michael Tokarev's tinycdb library, which is itself a rewrite of Dan Bernstein's <a href="http://cr.yp.to/cdb.html>cdb.
Public Member Functions | |
(id) | - initWithFile: |
Creates a CDBWriter that will generate a new CDB file at the given path. | |
(BOOL) | - addValuePointer:forKey: |
Writes a key/value pair to the file. | |
(BOOL) | - addValuePointers:count:forKey: |
Adds a key/value pair to the file, where the value is written from one or more discontiguous memory blocks. |
- (id) initWithFile: | (NSString*) | path |
Creates a CDBWriter that will generate a new CDB file at the given path.
The file is not accessed until -open is called; then it will be created or truncated if necessary.
Writes a key/value pair to the file.
Writing the same key twice is legal, but will waste the disk space that was occupied by the first value.
Adds a key/value pair to the file, where the value is written from one or more discontiguous memory blocks.
This has the same effect as the regular addValuePointer:forKey: method, but saves memory and time if the value needs to be assembled from multiple pieces. For example, CDBStore uses this call internally to prefix the user-supplied value with a tag byte, without having to copy the tag and value into a temporary buffer.