10#if defined(WIN32) && !defined(__GNUC__)
11#pragma warning( disable : 4355 )
19#ifdef RESIP_USE_STL_STREAMS
20 char* gbuf =
const_cast<char*
>(
mStr.mBuf);
23 setp(gbuf+
mStr.mSize, gbuf+
mStr.mCapacity);
30#ifndef RESIP_USE_STL_STREAMS
36size_t DataBuffer::readbuf(
char *buf,
size_t count)
51 size_t toread = (cursize < count) ? (cursize) : (count);
61size_t DataBuffer::writebuf(
const char *str,
size_t count)
71size_t DataBuffer::putbuf(
char ch)
84 size_t pos = gptr() - eback();
86 char* gbuf =
const_cast<char*
>(
mStr.
data());
88 setg(gbuf, gbuf+pos, gbuf+
mStr.
size());
90 setp(gbuf +
mStr.mSize, gbuf +
mStr.mCapacity);
105 size_t pos = gptr() - eback();
111 mStr.resize(((
mStr.mCapacity+16)*3)/2,
true);
113 char* gbuf =
const_cast<char*
>(
mStr.mBuf);
115 setg(gbuf, gbuf+pos, gbuf+
mStr.mSize);
117 setp(gbuf +
mStr.mSize, gbuf +
mStr.mCapacity);
156#ifdef RESIP_USE_STL_STREAMS
158 char* gbuf =
const_cast<char*
>(
mStr.mBuf);
160 setp(gbuf+
mStr.mSize, gbuf+
mStr.mCapacity);
#define resip_assert(x)
This file needs to work for both C and C++ code.
Implementation of std::streambuf used to back the DataStream, iDataStream, and oDataStream.
virtual int overflow(int c=-1)
~DataStream()
Calls flush on itself to force the update to the Data reference passed into the constructor.
DataStream(Data &str)
Constructs a DataStream with a Data to operate on.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
@ Share
The Data instance will use the buffer in a read-only mode.
Data & append(const char *str, size_type len)
Appends the specified number of bytes to the end of this Data.
Data substr(size_type first, size_type count=Data::npos) const
Copies a portion of this Data into a new Data.
size_type size() const noexcept
Returns the number of bytes in this Data.
const char * begin() const noexcept
Returns a pointer to the beginning of the buffer used by the Data.
Data & clear()
Clears the contents of this Data.
const char * data() const noexcept
Returns a pointer to the contents of this Data.
std::ostream replacement.
iDataStream(Data &str)
Constructs a iDataStream with a Data to operate on.
void reset()
Clears the underlying Data reference.
oDataStream(Data &str)
Constructs a oDataStream with a Data to operate on.
~oDataStream()
Calls flush on itself to force the update to the Data reference passed into the constructor.
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
#define RESIP_USE_STL_STREAMS