39#include "blocxx/BLOCXX_config.h"
46#if defined(BLOCXX_HAVE_ISTREAM) && defined(BLOCXX_HAVE_OSTREAM)
58#if defined(BLOCXX_AIX)
62StringBuffer::StringBuffer(size_t allocSize) :
72 m_allocated(m_len + BLOCXX_DEFAULT_ALLOCATION_UNIT),
80 m_allocated(m_len + BLOCXX_DEFAULT_ALLOCATION_UNIT),
87 m_len(
arg.m_len), m_allocated(
arg.m_allocated),
117 std::swap(
m_len,
x.m_len);
119 std::swap(
m_bfr,
x.m_bfr);
153#if defined(BLOCXX_WIN32)
154#define snprintf _snprintf
204#if defined(BLOCXX_INT32_IS_INT) && defined(BLOCXX_INT64_IS_LONG_LONG)
227#if BLOCXX_SIZEOF_LONG_INT == 8
239#if BLOCXX_SIZEOF_LONG_INT == 8
253#if defined(BLOCXX_REAL32_IS_FLOAT)
255#elif defined(BLOCXX_REAL32_IS_DOUBLE)
259#error "The formula for computing the number of digits of precision for a floating point needs to be implmented. It's ceiling(bits * log(FLT_RADIX) / log(10))"
269#if defined(BLOCXX_REAL64_IS_DOUBLE)
271#elif defined(BLOCXX_REAL64_IS_LONG_DOUBLE)
275#error "The formula for computing the number of digits of precision for a floating point needs to be implmented. It's ceiling(bits * log(FLT_RADIX) / log(10))"
279#if defined(BLOCXX_WIN32)
303 return ::strcmp(
arg.m_bfr,
m_bfr) == 0;
372 std::streambuf *
sb =
is.rdbuf();
376 int ch =
sb->sbumpc();
379 is.setstate(count == 0
380 ? (std::ios::failbit | std::ios::eofbit) : std::ios::eofbit);
395 const char*
p = ::strchr(
m_bfr,
'\r');
407 ostr.write(
b.c_str(),
b.length());
426 return x.equals(
y.c_str());
438 return x.equals(
y.c_str());
The Bool class is an abstraction for the boolean data type.
StringBuffer(size_t allocSize=BLOCXX_DEFAULT_ALLOCATION_UNIT)
void swap(StringBuffer &x)
StringBuffer & append(char c)
bool endsWith(char ch) const
const char * getLine(std::istream &is, bool resetBuffer=true)
Fill this StringBuffer object with the next line from the given input stream.
StringBuffer & operator+=(char c)
static const size_t BLOCXX_DEFAULT_ALLOCATION_UNIT
void truncate(size_t index)
Truncate the string at the given index.
bool startsWith(char ch) const
bool equals(const char *arg) const
char operator[](size_t ndx) const
StringBuffer & operator=(const StringBuffer &arg)
void checkAvail(size_t len=1)
This String class is an abstract data type that represents as NULL terminated string of characters.
bool operator==(const Array< T > &x, const Array< T > &y)
ostream & operator<<(ostream &ostrm, const Bool &arg)
bool operator!=(const Array< T > &x, const Array< T > &y)
Determine two Arrays are not equal.