Buffer Class Reference

#include <Buffer.hxx>

Inheritance diagram for Buffer:

Serializable Countable List of all members.

Public Member Functions

void toFile (const Path &file, unsigned char eType) const
void append (const void *s, ocmoff_t len)
void append (ByteString s)
void append (std::string s)
void freeze ()
GCPtr< Buffercompress (int level) const
GCPtr< Bufferdecompress () const
ocmoff_t length () const
Chunk getChunk (ocmoff_t pos, ocmoff_t len) const
void read (void *vp, ocmoff_t pos, ocmoff_t len) const
int getc (ocmoff_t pos) const
TrueName getContentTrueName () const
hash32_t computeAffinity ()

Static Public Member Functions

static GCPtr< BufferFromFile (const Path &file, unsigned char eType)

Classes

struct  Chunk

Detailed Description

Definition at line 44 of file Buffer.hxx.


Member Function Documentation

void Buffer::append std::string  s  )  [inline]
 

Definition at line 72 of file Buffer.hxx.

References append().

void Buffer::append ByteString  s  )  [inline]
 

Definition at line 68 of file Buffer.hxx.

References append().

void Buffer::append const void *  s,
ocmoff_t  len
 

Definition at line 115 of file Buffer.cxx.

References BLKNDX, and BUFFER_BLOCK_SIZE.

Referenced by append().

GCPtr< Buffer > Buffer::compress int  level  )  const
 

Definition at line 262 of file Buffer.cxx.

References ExBadValue, format(), getChunk(), Buffer::Chunk::len, length(), Buffer::Chunk::ptr, THROW, logger::trace(), and ZLIB_BUFFER_SIZE.

hash32_t Buffer::computeAffinity  )  [inline]
 

Definition at line 100 of file Buffer.hxx.

References Serializable::getTrueName(), and TrueName::hash().

GCPtr< Buffer > Buffer::decompress  )  const
 

Definition at line 374 of file Buffer.cxx.

References ExBadValue, format(), getChunk(), Buffer::Chunk::len, length(), Buffer::Chunk::ptr, THROW, logger::trace(), xassert, and ZLIB_BUFFER_SIZE.

void Buffer::freeze  ) 
 

Definition at line 102 of file Buffer.cxx.

GCPtr< Buffer > Buffer::FromFile const Path file,
unsigned char  eType
[static]
 

Definition at line 194 of file Buffer.cxx.

References BUFFER_BLOCK_SIZE, Path::c_str(), ExTruncated, format(), THROW, xfclose, and xfopen.

Referenced by WsEntity::BufferContent(), get_message(), WsEntity::RecomputeStatus(), WsEntity::UploadTo(), and WsEntity::WsEntity().

int Buffer::getc ocmoff_t  pos  )  const
 

Definition at line 163 of file Buffer.cxx.

References BLKNDX, BLKOFF, ExOverrun, and THROW.

Buffer::Chunk Buffer::getChunk ocmoff_t  pos,
ocmoff_t  len
const
 

Definition at line 144 of file Buffer.cxx.

References BLKNDX, BLKOFF, BUFFER_BLOCK_SIZE, ExOverrun, Buffer::Chunk::len, min, Buffer::Chunk::ptr, and THROW.

Referenced by PublicKey::checkSignature(), compress(), decompress(), getContentTrueName(), read(), PrivateKey::signThis(), and toFile().

TrueName Buffer::getContentTrueName  )  const
 

Definition at line 481 of file Buffer.cxx.

References OpenSHA::append(), OpenSHA::finish(), getChunk(), Buffer::Chunk::len, and Buffer::Chunk::ptr.

ocmoff_t Buffer::length  )  const
 

Definition at line 108 of file Buffer.cxx.

Referenced by sdr::BufIStream::BufIStream(), PublicKey::checkSignature(), compress(), decompress(), PrivateKey::signThis(), and toFile().

void Buffer::read void *  vp,
ocmoff_t  pos,
ocmoff_t  len
const
 

Definition at line 177 of file Buffer.cxx.

References getChunk(), Buffer::Chunk::len, and Buffer::Chunk::ptr.

void Buffer::toFile const Path file,
unsigned char  eType
const
 

Definition at line 229 of file Buffer.cxx.

References Path::c_str(), Path::dirName(), ExTruncated, format(), getChunk(), Buffer::Chunk::len, length(), Buffer::Chunk::ptr, Path::smkdir(), THROW, xfclose, and xfopen.


The documentation for this class was generated from the following files:
Generated on Sun Apr 23 22:42:40 2006 for OpenCM by  doxygen 1.4.6