1#if !defined(RESIP_RESIPFASTSTREAMS_HXX)
2#define RESIP_RESIPFASTSTREAMS_HXX
9#define RESIP_USE_STL_STREAMS
33 virtual ~ ResipStreamBuf(
void)
35 virtual size_t writebuf(
const char *s,
size_t count) = 0;
36 virtual size_t readbuf(
char *buf,
size_t count) = 0;
127 *this<<(static_cast<int32_t>(b));
133 *this<<(static_cast<int32_t>(i));
139 *this<<(static_cast<uint32_t>(ui));
150 snprintf(buf,33,
"%" PRId32,l);
151 size_t count = strlen(buf);
152 if (buf_->
writebuf(buf,count) < count)
167 snprintf(buf,33,
"%" PRIu32,ul);
168 size_t count = strlen(buf);
169 if (buf_->
writebuf(buf,count) < count)
185 snprintf(buf,66,
"%" PRId64,i64);
187 size_t count = strlen(buf);
188 if (buf_->
writebuf(buf,count) < count)
204 snprintf(buf,66,
"%" PRIu64,ui64);
206 size_t count = strlen(buf);
207 if (buf_->
writebuf(buf,count) < count)
217 *this<< (static_cast<double>(f));
231 size_t count = strlen(buf);
237 for (; count > 1; count--)
240 if (buf[idx] !=
'0' && buf[idx] !=
'.')
246 if (buf_->
writebuf(buf,count) < count)
263 size_t count = strlen(buf);
264 if (buf_->
writebuf(buf,count) < count)
282 if (_Pfn ==
static_cast<std::ostream& (*)(std::ostream&)
>(std::endl))
303 ostr.
write(str,strlen(str));
324 ostr.
write((
const char *)str,strlen((
const char *)str));
338 ostr.
write((
const char *)str,strlen((
const char *)str));
345 ostr.
write(str.c_str(),str.size());
404 virtual size_t writebuf(
const char *s,
size_t count)
423 virtual size_t readbuf(
char *buf,
size_t count)
460#ifdef RESIP_USE_STL_STREAMS
461#define EncodeStream std::ostream
462#define DecodeStream std::istream
463#define resipCerr std::cerr
464#define resipCout std::cout
466#define EncodeStream resip::ResipFastOStream
467#define DecodeStream resip::ResipFastIStream
468extern ResipStdCOStream resipFastCerr;
469extern ResipStdCOStream resipFastCout;
470#define resipCerr resip::resipFastCerr
471#define resipCout resip::resipFastCout
#define resip_assert(x)
This file needs to work for both C and C++ code.
~ResipBasicIOStream(void)
virtual ~ResipFastIStream(void)
ResipFastIStream & read(char *s, size_t count)
ResipFastIStream(ResipStreamBuf *buf)
ResipStreamBuf * rdbuf(void) const
std::ostream replacement.
ResipFastOStream & operator<<(int16_t i)
ResipStreamBuf * rdbuf(void) const
ResipFastOStream & operator<<(bool b)
ResipFastOStream & operator<<(int32_t l)
ResipFastOStream & operator<<(float f)
ResipFastOStream & flush(void)
ResipFastOStream(ResipStreamBuf *buf)
ResipFastOStream & write(const char *s, size_t count)
virtual uint64_t tellp(void)
ResipFastOStream & operator<<(uint16_t ui)
void rdbuf(ResipStreamBuf *buf)
ResipFastOStream & operator<<(uint32_t ul)
virtual ~ResipFastOStream(void)
ResipFastOStream & operator<<(int64_t i64)
ResipFastOStream & operator<<(std::ostream &(*_Pfn)(std::ostream &))
ResipFastOStream & operator<<(const void *vp)
ResipFastOStream & operator<<(double d)
ResipFastOStream & put(char ch)
ResipFastOStream & operator<<(uint64_t ui64)
Used to replace std::cerr, std::cout, etc.
virtual size_t readbuf(char *buf, size_t count)
virtual size_t writebuf(const char *s, size_t count)
virtual void flushbuf(void)
virtual uint64_t tellpbuf(void)
virtual size_t putbuf(char ch)
ResipStdBuf(BufType type)
A direct replacement for std::cout, std::cerr, etc.
ResipStdCOStream(ResipStdBuf::BufType type)
virtual void flushbuf(void)=0
virtual size_t putbuf(char ch)=0
virtual uint64_t tellpbuf(void)=0
virtual size_t writebuf(const char *s, size_t count)=0
virtual size_t readbuf(char *buf, size_t count)=0
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
#define SNPRINTF_1(buffer, sizeofBuffer, count, format, var1)
#define GCVT(f, sigdigits, buffer, bufferlen)
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
ResipStdCOStream resipFastNull
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)