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

std::ostream replacement. More...

#include <resipfaststreams.hxx>

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

List of all members.

Public Member Functions

 ResipFastOStream (ResipStreamBuf *buf)
virtual ~ResipFastOStream (void)
virtual UInt64 tellp (void)
ResipStreamBufrdbuf (void) const
void rdbuf (ResipStreamBuf *buf)
ResipFastOStreamflush (void)
ResipFastOStreamwrite (const char *s, size_t count)
ResipFastOStreamput (char ch)
ResipFastOStreamoperator<< (bool b)
ResipFastOStreamoperator<< (short s)
ResipFastOStreamoperator<< (unsigned short us)
ResipFastOStreamoperator<< (int i)
ResipFastOStreamoperator<< (unsigned int ui)
ResipFastOStreamoperator<< (long l)
ResipFastOStreamoperator<< (unsigned long ul)
ResipFastOStreamoperator<< (UInt64 ui64)
ResipFastOStreamoperator<< (float f)
ResipFastOStreamoperator<< (double d)
ResipFastOStreamoperator<< (const void *vp)
ResipFastOStreamoperator<< (std::ostream &(*_Pfn)(std::ostream &))

Private Attributes

ResipStreamBufbuf_

Detailed Description

std::ostream replacement.

Definition at line 95 of file resipfaststreams.hxx.


Constructor & Destructor Documentation

resip::ResipFastOStream::ResipFastOStream ( ResipStreamBuf buf) [inline]

Definition at line 98 of file resipfaststreams.hxx.

References resip::ResipBasicIOStream::good_.

                                           :buf_(buf)
      {
         good_ = true;
      }
virtual resip::ResipFastOStream::~ResipFastOStream ( void  ) [inline, virtual]

Definition at line 102 of file resipfaststreams.hxx.

      {}

Member Function Documentation

ResipFastOStream& resip::ResipFastOStream::flush ( void  ) [inline]

Definition at line 124 of file resipfaststreams.hxx.

References resip::ResipStreamBuf::flushbuf(), and rdbuf().

      {
         if (rdbuf())
         {
            rdbuf()->flushbuf();
         }
         return *this;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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;
      }

Here is the call graph for this function:

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<<().

      {
         if (rdbuf())
         {
            rdbuf()->putbuf(ch);
         }
         return *this;
      }

Here is the call graph for this function:

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]

Definition at line 119 of file resipfaststreams.hxx.

References buf_.

      {
         buf_ = buf;
      }
virtual UInt64 resip::ResipFastOStream::tellp ( void  ) [inline, virtual]

Definition at line 105 of file resipfaststreams.hxx.

References rdbuf(), and resip::ResipStreamBuf::tellpbuf().

      {
         if (rdbuf())
         {
            return rdbuf()->tellpbuf();
         }
         return 0;
      }

Here is the call graph for this function:

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<<().

      {
         if (rdbuf())
         {
            rdbuf()->writebuf(s,count);
         }
         return *this;
      }

Here is the call graph for this function:


Member Data Documentation

Reimplemented in resip::ResipStdCOStream.

Definition at line 363 of file resipfaststreams.hxx.

Referenced by operator<<(), and rdbuf().


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