reSIProcate/rutil  9694
Public Member Functions | Private Member Functions
resip::oDataStream Class Reference

An ostream that operates on an existing Data. More...

#include <DataStream.hxx>

Inheritance diagram for resip::oDataStream:
Inheritance graph
[legend]
Collaboration diagram for resip::oDataStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 oDataStream (Data &str)
 Constructs a oDataStream with a Data to operate on.
 ~oDataStream ()
 Calls flush on itself to force the update to the Data reference passed into the constructor.
void reset ()
 Clears the underlying Data reference.

Private Member Functions

 oDataStream (const oDataStream &)
oDataStreamoperator= (const oDataStream &)

Detailed Description

An ostream that operates on an existing Data.

The data is appended to the reference passed to the constructor. The data is valid after DataStream's destructor is called.

Definition at line 103 of file DataStream.hxx.


Constructor & Destructor Documentation

oDataStream::oDataStream ( Data str)

Constructs a oDataStream with a Data to operate on.

Parameters:
strA Data to operate on.

Definition at line 138 of file DataStream.cxx.

References resip::Data::mShareEnum, and resip::Data::Share.

   : DataBuffer(str), 
   EncodeStream(this)
{
   // don't call this with a read-only buffer!
   assert(str.mShareEnum != Data::Share);
}
oDataStream::~oDataStream ( )

Calls flush on itself to force the update to the Data reference passed into the constructor.

Definition at line 146 of file DataStream.cxx.

{
   flush();
}
resip::oDataStream::oDataStream ( const oDataStream ) [private]

Member Function Documentation

oDataStream& resip::oDataStream::operator= ( const oDataStream ) [private]
void oDataStream::reset ( )

Clears the underlying Data reference.

Definition at line 152 of file DataStream.cxx.

Referenced by main().

{
   flush();
   mStr.clear();
#ifdef RESIP_USE_STL_STREAMS
   // reset the underlying buffer state
   char* gbuf = const_cast<char*>(mStr.mBuf);
   setg(gbuf, gbuf, gbuf+mStr.size());
   setp(gbuf+mStr.mSize, gbuf+mStr.mCapacity);
#endif
}

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