HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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)
 
 ~UT_OStrStreamBuf () override
 
char * str ()
 
void freeze (bool isfrozen)
 
exint pcount () const
 

Protected Member Functions

int_type overflow (int_type c) override
 
pos_type seekoff (off_type _Off, std::ios_base::seekdir _Way, std::ios_base::openmode _Mode=std::ios::out) override
 
pos_type seekpos (pos_type _Off, std::ios_base::openmode _Mode=std::ios::out) override
 
std::streamsize xsputn (const char *s, std::streamsize num) override
 
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 77 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 
)
UT_OStrStreamBuf::~UT_OStrStreamBuf ( )
override

Member Function Documentation

void UT_OStrStreamBuf::freeze ( bool  isfrozen)
inline

Definition at line 109 of file UT_NTStreamUtil.h.

int_type UT_OStrStreamBuf::overflow ( int_type  c)
overrideprotected
exint UT_OStrStreamBuf::pcount ( ) const
inline

Definition at line 115 of file UT_NTStreamUtil.h.

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

Definition at line 103 of file UT_NTStreamUtil.h.

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

Member Data Documentation

char* UT_OStrStreamBuf::myBuf
protected

Definition at line 125 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::myEntries
protected

Definition at line 123 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::myOffset
protected

Definition at line 123 of file UT_NTStreamUtil.h.

bool UT_OStrStreamBuf::myOwnBuf
protected

Definition at line 124 of file UT_NTStreamUtil.h.

exint UT_OStrStreamBuf::mySize
protected

Definition at line 123 of file UT_NTStreamUtil.h.


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