MongoDB  2.7.0
Classes | Public Member Functions | List of all members
mongo::AlignedBuilder Class Reference

a page-aligned BufBuilder. More...

#include <alignedbuilder.h>

Public Member Functions

 AlignedBuilder (unsigned init_size)
 
void reset (unsigned sz)
 reset with a hint as to the upcoming needed size specified
 
void reset ()
 reset for a re-use. More...
 
const char * buf () const
 note this may be deallocated (realloced) if you keep writing or reset(). More...
 
size_t skip (unsigned n)
 leave room for some stuff later More...
 
char * atOfs (unsigned ofs)
 if buffer grows pointer no longer valid
 
char * cur ()
 if buffer grows pointer no longer valid
 
void appendChar (char j)
 
void appendNum (char j)
 
void appendNum (short j)
 
void appendNum (int j)
 
void appendNum (unsigned j)
 
void appendNum (bool j)
 
void appendNum (double j)
 
void appendNum (long long j)
 
void appendNum (unsigned long long j)
 
void appendBuf (const void *src, size_t len)
 
template<class T >
void appendStruct (const T &s)
 
void appendStr (const StringData &str, bool includeEOO=true)
 
unsigned len () const
 

Detailed Description

a page-aligned BufBuilder.

Member Function Documentation

const char* mongo::AlignedBuilder::buf ( ) const
inline

note this may be deallocated (realloced) if you keep writing or reset().

unsigned mongo::AlignedBuilder::len ( ) const
inline
Returns
the in-use length
void mongo::AlignedBuilder::reset ( )

reset for a re-use.

shrinks if > 128MB

size_t mongo::AlignedBuilder::skip ( unsigned  n)
inline

leave room for some stuff later

Returns
offset in the buffer that was our current position

The documentation for this class was generated from the following files: