|
reSIProcate/rutil
9694
|
std::ostream replacement. More...
#include <resipfaststreams.hxx>


Public Member Functions | |
| ResipFastOStream (ResipStreamBuf *buf) | |
| virtual | ~ResipFastOStream (void) |
| virtual UInt64 | tellp (void) |
| ResipStreamBuf * | rdbuf (void) const |
| void | rdbuf (ResipStreamBuf *buf) |
| ResipFastOStream & | flush (void) |
| ResipFastOStream & | write (const char *s, size_t count) |
| ResipFastOStream & | put (char ch) |
| ResipFastOStream & | operator<< (bool b) |
| ResipFastOStream & | operator<< (short s) |
| ResipFastOStream & | operator<< (unsigned short us) |
| ResipFastOStream & | operator<< (int i) |
| ResipFastOStream & | operator<< (unsigned int ui) |
| ResipFastOStream & | operator<< (long l) |
| ResipFastOStream & | operator<< (unsigned long ul) |
| ResipFastOStream & | operator<< (UInt64 ui64) |
| ResipFastOStream & | operator<< (float f) |
| ResipFastOStream & | operator<< (double d) |
| ResipFastOStream & | operator<< (const void *vp) |
| ResipFastOStream & | operator<< (std::ostream &(*_Pfn)(std::ostream &)) |
Private Attributes | |
| ResipStreamBuf * | buf_ |
std::ostream replacement.
Definition at line 95 of file resipfaststreams.hxx.
| resip::ResipFastOStream::ResipFastOStream | ( | ResipStreamBuf * | buf | ) | [inline] |
Definition at line 98 of file resipfaststreams.hxx.
References resip::ResipBasicIOStream::good_.
| virtual resip::ResipFastOStream::~ResipFastOStream | ( | void | ) | [inline, virtual] |
Definition at line 102 of file resipfaststreams.hxx.
{}
| ResipFastOStream& resip::ResipFastOStream::flush | ( | void | ) | [inline] |
Definition at line 124 of file resipfaststreams.hxx.
References resip::ResipStreamBuf::flushbuf(), and rdbuf().

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | bool | b | ) | [inline] |
Definition at line 151 of file resipfaststreams.hxx.
{
//int i = (b == true) ? (1):(0);
*this<<(static_cast<long>(b));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | short | s | ) | [inline] |
Definition at line 158 of file resipfaststreams.hxx.
{
*this<<(static_cast<long>(s));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | unsigned short | us | ) | [inline] |
Definition at line 164 of file resipfaststreams.hxx.
{
*this<<(static_cast<unsigned long>(us));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | int | i | ) | [inline] |
Definition at line 170 of file resipfaststreams.hxx.
{
*this<<(static_cast<long>(i));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | unsigned int | ui | ) | [inline] |
Definition at line 184 of file resipfaststreams.hxx.
{
*this<<(static_cast<unsigned long>(ui));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | long | l | ) | [inline] |
Definition at line 191 of file resipfaststreams.hxx.
References buf_, resip::ResipBasicIOStream::good_, LTOA, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
char buf[33];
LTOA(l,buf,33,10);
size_t count = strlen(buf);
if (buf_->writebuf(buf,count) < count)
{
good_ = false;
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | unsigned long | ul | ) | [inline] |
Definition at line 208 of file resipfaststreams.hxx.
References buf_, resip::ResipBasicIOStream::good_, ULTOA, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
char buf[33];
ULTOA(ul,buf,33,10);
size_t count = strlen(buf);
if (buf_->writebuf(buf,count) < count)
{
good_ = false;
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | UInt64 | ui64 | ) | [inline] |
Definition at line 261 of file resipfaststreams.hxx.
References buf_, resip::ResipBasicIOStream::good_, UI64TOA, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
char buf[66];
UI64TOA(ui64,buf,66,10);
size_t count = strlen(buf);
if (buf_->writebuf(buf,count) < count)
{
good_ = false;
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | float | f | ) | [inline] |
Definition at line 281 of file resipfaststreams.hxx.
{
*this<< (static_cast<double>(f));
return *this;
}
| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | double | d | ) | [inline] |
Definition at line 288 of file resipfaststreams.hxx.
References _CVTBUFSIZE, buf_, GCVT, resip::ResipBasicIOStream::good_, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
char buf[_CVTBUFSIZE];
GCVT(d,6,buf,_CVTBUFSIZE);//6 significant digits is the default for %f
size_t count = strlen(buf);
#ifndef WIN32
//not using the non-standard microsoft conversion functions
//remove any trailing zeros. Note that resipfastreams does not support STL stream width or precision
//modifiers
size_t idx=0;
for (; count > 1; count--)
{
idx = count-1;
if (buf[idx] != '0' && buf[idx] != '.')
{
break;
}
}
#endif
if (buf_->writebuf(buf,count) < count)
{
good_ = false;
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | const void * | vp | ) | [inline] |
Definition at line 320 of file resipfaststreams.hxx.
References _TRUNCATE, buf_, resip::ResipBasicIOStream::good_, SNPRINTF_1, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
char buf[32];
SNPRINTF_1(buf,32,_TRUNCATE,"%p",vp);
size_t count = strlen(buf);
if (buf_->writebuf(buf,count) < count)
{
good_ = false;
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::operator<< | ( | std::ostream &(*)(std::ostream &) | _Pfn | ) | [inline] |
Definition at line 340 of file resipfaststreams.hxx.
References buf_, resip::ResipBasicIOStream::good_, and resip::ResipStreamBuf::writebuf().
{
if (!buf_)
{
return *this;
}
if (_Pfn == static_cast<std::ostream& (*)(std::ostream&)>(std::endl))
{
if (buf_->writebuf("\n",1) < 1)
{
good_ = false;
}
}
else
{
assert(0);
}
return *this;
}

| ResipFastOStream& resip::ResipFastOStream::put | ( | char | ch | ) | [inline] |
Definition at line 142 of file resipfaststreams.hxx.
References resip::ResipStreamBuf::putbuf(), and rdbuf().
Referenced by resip::operator<<().

| ResipStreamBuf* resip::ResipFastOStream::rdbuf | ( | void | ) | const [inline] |
Definition at line 114 of file resipfaststreams.hxx.
References buf_.
Referenced by flush(), put(), resip::ResipStdCOStream::ResipStdCOStream(), tellp(), and write().
{
return buf_;
}
| void resip::ResipFastOStream::rdbuf | ( | ResipStreamBuf * | buf | ) | [inline] |
| virtual UInt64 resip::ResipFastOStream::tellp | ( | void | ) | [inline, virtual] |
Definition at line 105 of file resipfaststreams.hxx.
References rdbuf(), and resip::ResipStreamBuf::tellpbuf().

| ResipFastOStream& resip::ResipFastOStream::write | ( | const char * | s, |
| size_t | count | ||
| ) | [inline] |
Definition at line 133 of file resipfaststreams.hxx.
References rdbuf(), and resip::ResipStreamBuf::writebuf().
Referenced by resip::operator<<().

ResipStreamBuf* resip::ResipFastOStream::buf_ [private] |
Reimplemented in resip::ResipStdCOStream.
Definition at line 363 of file resipfaststreams.hxx.
Referenced by operator<<(), and rdbuf().
1.7.5.1