CDBWriter Class Reference

#import <CDBFile.h>

Inherits CDBFile.

List of all members.


Detailed Description

Writes out new CDB files.

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.


Member Function Documentation

- (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.

- (BOOL) addValuePointer: (CDBData value
forKey: (CDBData key 

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.

- (BOOL) addValuePointers: (const CDBData[])  values
count: (unsigned)  count
forKey: (CDBData key 

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.


The documentation for this class was generated from the following files:
Generated on Thu Mar 6 12:20:55 2008 for CDBStore by  doxygen 1.5.4