HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_OStrStreamBuf Class Reference

#include <UT_NTStreamUtil.h>

+ Inheritance diagram for UT_OStrStreamBuf:

Public Member Functions

 UT_OStrStreamBuf ()
 
 UT_OStrStreamBuf (exint initialsize)
 
 UT_OStrStreamBuf (char *pch, exint len)
 
virtual ~UT_OStrStreamBuf ()
 
char * str ()
 
void freeze (bool isfrozen)
 
exint pcount () const
 

Protected Member Functions

virtual int_type overflow (int_type c)
 
virtual pos_type seekoff (off_type _Off, std::ios_base::seekdir _Way, std::ios_base::openmode=std::ios::out)
 
virtual pos_type seekpos (pos_type _Off, std::ios_base::openmode _Mode=std::ios::out)
 
virtual std::streamsize xsputn (const char *s, std::streamsize num)
 
bool resizeBuf (exint minnewsize)
 

Protected Attributes

exint mySize
 
exint myEntries
 
exint myOffset
 
bool myOwnBuf
 
char * myBuf
 

Detailed Description

We build our own stream buffer to work around a shortcoming in the C++ standard. pbump() and pcount() are defined to use int, not streamsize, so much sadness occurs as you cross 2gb boundaries. See Bug: 45419

Note this isn't a buffered implementation - we don't invoke setpbuf to update pbase, etc. The logic is that may bring us back to the broken pbump land. Hopefully implementations use xsputn anyways.

exints are chosen rather than streamsize or int_type or pos_type because I have lost all faith in how those are defined.

Definition at line 74 of file UT_NTStreamUtil.h.

Constructor & Destructor Documentation

UT_OStrStreamBuf::UT_OStrStreamBuf ( )
UT_OStrStreamBuf::UT_OStrStreamBuf ( exint  initialsize)
explicit
UT_OStrStreamBuf::UT_OStrStreamBuf ( char *  pch,
exint  len 
)
virtual UT_OStrStreamBuf::~UT_OStrStreamBuf ( )
virtual

Member Function Documentation

void UT_OStrStreamBuf::freeze ( bool  isfrozen)
inline

Definition at line 104 of file UT_NTStreamUtil.h.

virtual int_type UT_OStrStreamBuf::overflow ( int_type  c)
protectedvirtual
exint UT_OStrStreamBuf::pcount ( ) const
inline

Definition at line 110 of file UT_NTStreamUtil.h.

bool UT_OStrStreamBuf::resizeBuf ( exint  minnewsize)
protected
virtual pos_type UT_OStrStreamBuf::seekoff ( off_type  _Off,
std::ios_base::seekdir  _Way,
std::ios_base::openmode  = std::ios::out 
)
protectedvirtual
virtual pos_type UT_OStrStreamBuf::seekpos ( pos_type  _Off,
std::ios_base::openmode  _Mode = std::ios::out 
)
protectedvirtual
char* UT_OStrStreamBuf::str ( )
inline

Definition at line 98 of file UT_NTStreamUtil.h.

virtual std::streamsize UT_OStrStreamBuf::xsputn ( const char *  s,
std::streamsize  num 
)
protectedvirtual

Member Data Documentation

char* UT_OStrStreamBuf::myBuf
protected

Definition at line 120 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::myEntries
protected

Definition at line 118 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::myOffset
protected

Definition at line 118 of file UT_NTStreamUtil.h.

bool UT_OStrStreamBuf::myOwnBuf
protected

Definition at line 119 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::mySize
protected

Definition at line 118 of file UT_NTStreamUtil.h.


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