LLMemoryStreamBuf Class Reference

This implements a wrapper around a piece of memory for istreams. More...

#include <llmemorystream.h>

List of all members.

Public Member Functions

 LLMemoryStreamBuf (const U8 *start, S32 length)
 ~LLMemoryStreamBuf ()
void reset (const U8 *start, S32 length)

Protected Member Functions

int underflow ()


Detailed Description

This implements a wrapper around a piece of memory for istreams.

This is a simple but effective optimization when you want to treat a chunk of memory as an istream. I wrote this to avoid turing a buffer into a string, and then throwing the string into an iostringstream just to parse it into another datatype, eg, LLSD.

The memory passed in is NOT owned by an instance. The caller must be careful to always pass in a valid memory location that exists for at least as long as this streambuf.

Definition at line 54 of file llmemorystream.h.


Constructor & Destructor Documentation

LLMemoryStreamBuf::LLMemoryStreamBuf ( const U8 start,
S32  length 
)

Definition at line 37 of file llmemorystream.cpp.

References reset().

Here is the call graph for this function:

LLMemoryStreamBuf::~LLMemoryStreamBuf (  ) 

Definition at line 42 of file llmemorystream.cpp.


Member Function Documentation

void LLMemoryStreamBuf::reset ( const U8 start,
S32  length 
)

Definition at line 46 of file llmemorystream.cpp.

Referenced by LLMemoryStreamBuf().

Here is the caller graph for this function:

int LLMemoryStreamBuf::underflow (  )  [protected]

Definition at line 51 of file llmemorystream.cpp.

References indra::ipc::tokenstream::EOF.


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

Generated on Fri May 16 08:52:35 2008 for SecondLife by  doxygen 1.5.5