OWBI1::StringBuffer Class Reference

#include <OWBI1_StringBuffer.hpp>

List of all members.

Public Member Functions

 StringBuffer (size_t allocSize=OWBI1_DEFAULT_ALLOCATION_UNIT)
 StringBuffer (const char *arg)
 StringBuffer (const String &arg)
 StringBuffer (const StringBuffer &arg)
 ~StringBuffer ()
StringBufferoperator= (const StringBuffer &arg)
StringBufferoperator= (const String &arg)
StringBufferoperator= (const char *str)
void swap (StringBuffer &x)
StringBufferappend (char c)
StringBufferappend (const char *str)
StringBufferappend (const char *str, const size_t len)
StringBufferappend (const String &arg)
StringBufferappend (const StringBuffer &arg)
StringBufferoperator+= (char c)
StringBufferoperator+= (Char16 c)
StringBufferoperator+= (const char *str)
StringBufferoperator+= (const String &arg)
StringBufferoperator+= (Bool v)
StringBufferoperator+= (UInt8 v)
StringBufferoperator+= (Int8 v)
StringBufferoperator+= (UInt16 v)
StringBufferoperator+= (Int16 v)
StringBufferoperator+= (UInt32 v)
StringBufferoperator+= (Int32 v)
StringBufferoperator+= (UInt64 v)
StringBufferoperator+= (Int64 v)
StringBufferoperator+= (Real32 v)
StringBufferoperator+= (Real64 v)
StringBufferoperator+= (const StringBuffer &arg)
char operator[] (size_t ndx) const
String toString () const
String releaseString ()
size_t length () const
void truncate (size_t index)
 Truncate the string at the given index.
const char * getLine (std::istream &is, bool resetBuffer=true)
 Fill this StringBuffer object with the next line from the given input stream.
bool endsWith (char ch) const
bool startsWith (char ch) const
void chop ()
void trim ()
size_t allocated () const
void reset ()
const char * c_str () const
bool equals (const char *arg) const
bool equals (const StringBuffer &arg) const

Static Public Attributes

static const size_t OWBI1_DEFAULT_ALLOCATION_UNIT = 128

Private Member Functions

void checkAvail (size_t len=1)

Private Attributes

size_t m_len
size_t m_allocated
char * m_bfr

Friends

OWBI1_OWBI1PROVIFC_API std::ostream & operator<< (std::ostream &ostr, const StringBuffer &b)


Detailed Description

Definition at line 49 of file OWBI1_StringBuffer.hpp.


Constructor & Destructor Documentation

OWBI1::StringBuffer::StringBuffer size_t  allocSize = OWBI1_DEFAULT_ALLOCATION_UNIT  ) 
 

Definition at line 62 of file OWBI1_StringBuffer.cpp.

References m_bfr.

Referenced by operator=().

OWBI1::StringBuffer::StringBuffer const char *  arg  ) 
 

Definition at line 70 of file OWBI1_StringBuffer.cpp.

References m_bfr.

OWBI1::StringBuffer::StringBuffer const String arg  ) 
 

Definition at line 78 of file OWBI1_StringBuffer.cpp.

References OWBI1::String::c_str(), and m_bfr.

OWBI1::StringBuffer::StringBuffer const StringBuffer arg  ) 
 

Definition at line 86 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

OWBI1::StringBuffer::~StringBuffer  )  [inline]
 

Definition at line 61 of file OWBI1_StringBuffer.hpp.


Member Function Documentation

size_t OWBI1::StringBuffer::allocated  )  const [inline]
 

Definition at line 145 of file OWBI1_StringBuffer.hpp.

StringBuffer& OWBI1::StringBuffer::append const StringBuffer arg  )  [inline]
 

Definition at line 84 of file OWBI1_StringBuffer.hpp.

References c_str(), and length().

StringBuffer& OWBI1::StringBuffer::append const String arg  )  [inline]
 

Definition at line 82 of file OWBI1_StringBuffer.hpp.

References OWBI1::String::c_str(), and OWBI1::String::length().

StringBuffer & OWBI1::StringBuffer::append const char *  str,
const size_t  len
 

Definition at line 266 of file OWBI1_StringBuffer.cpp.

References checkAvail(), m_bfr, and m_len.

StringBuffer& OWBI1::StringBuffer::append const char *  str  )  [inline]
 

Definition at line 73 of file OWBI1_StringBuffer.hpp.

StringBuffer& OWBI1::StringBuffer::append char  c  )  [inline]
 

Definition at line 66 of file OWBI1_StringBuffer.hpp.

Referenced by getLine(), and operator+=().

const char* OWBI1::StringBuffer::c_str  )  const [inline]
 

Definition at line 147 of file OWBI1_StringBuffer.hpp.

Referenced by append(), OWBI1::operator<<(), and OWBI1::operator==().

void OWBI1::StringBuffer::checkAvail size_t  len = 1  )  [inline, private]
 

Definition at line 152 of file OWBI1_StringBuffer.hpp.

Referenced by append().

void OWBI1::StringBuffer::chop  ) 
 

Definition at line 304 of file OWBI1_StringBuffer.cpp.

References m_len, and truncate().

bool OWBI1::StringBuffer::endsWith char  ch  )  const
 

Definition at line 290 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

bool OWBI1::StringBuffer::equals const StringBuffer arg  )  const
 

Definition at line 283 of file OWBI1_StringBuffer.cpp.

References m_bfr.

bool OWBI1::StringBuffer::equals const char *  arg  )  const
 

Definition at line 276 of file OWBI1_StringBuffer.cpp.

References m_bfr.

Referenced by OWBI1::operator==().

const char * OWBI1::StringBuffer::getLine std::istream &  is,
bool  resetBuffer = true
 

Fill this StringBuffer object with the next line from the given input stream.

Parameters:
is The input stream to retrieve the next line from
Returns:
const char* pointer to the line of text just read.

Definition at line 344 of file OWBI1_StringBuffer.cpp.

References append(), ch, m_bfr, reset(), and truncate().

size_t OWBI1::StringBuffer::length  )  const [inline]
 

Definition at line 121 of file OWBI1_StringBuffer.hpp.

Referenced by append(), OWBI1::operator<<(), and OWBI1::CIMObjectPath::toString().

StringBuffer& OWBI1::StringBuffer::operator+= const StringBuffer arg  )  [inline]
 

Definition at line 107 of file OWBI1_StringBuffer.hpp.

StringBuffer & OWBI1::StringBuffer::operator+= Real64  v  ) 
 

Definition at line 247 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Real32  v  ) 
 

Definition at line 231 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Int64  v  ) 
 

Definition at line 218 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= UInt64  v  ) 
 

Definition at line 206 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Int32  v  ) 
 

Definition at line 198 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= UInt32  v  ) 
 

Definition at line 190 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Int16  v  ) 
 

Definition at line 182 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= UInt16  v  ) 
 

Definition at line 174 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Int8  v  ) 
 

Definition at line 166 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= UInt8  v  ) 
 

Definition at line 158 of file OWBI1_StringBuffer.cpp.

References append().

StringBuffer & OWBI1::StringBuffer::operator+= Bool  v  ) 
 

Definition at line 149 of file OWBI1_StringBuffer.cpp.

References append(), and OWBI1::Bool::toString().

StringBuffer& OWBI1::StringBuffer::operator+= const String arg  )  [inline]
 

Definition at line 94 of file OWBI1_StringBuffer.hpp.

StringBuffer& OWBI1::StringBuffer::operator+= const char *  str  )  [inline]
 

Definition at line 92 of file OWBI1_StringBuffer.hpp.

StringBuffer& OWBI1::StringBuffer::operator+= Char16  c  )  [inline]
 

Definition at line 90 of file OWBI1_StringBuffer.hpp.

References OWBI1::Char16::toString().

StringBuffer& OWBI1::StringBuffer::operator+= char  c  )  [inline]
 

Definition at line 88 of file OWBI1_StringBuffer.hpp.

StringBuffer & OWBI1::StringBuffer::operator= const char *  str  ) 
 

Definition at line 101 of file OWBI1_StringBuffer.cpp.

References StringBuffer().

StringBuffer & OWBI1::StringBuffer::operator= const String arg  ) 
 

Definition at line 94 of file OWBI1_StringBuffer.cpp.

References StringBuffer().

StringBuffer & OWBI1::StringBuffer::operator= const StringBuffer arg  ) 
 

Definition at line 108 of file OWBI1_StringBuffer.cpp.

References StringBuffer().

char OWBI1::StringBuffer::operator[] size_t  ndx  )  const
 

Definition at line 142 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

String OWBI1::StringBuffer::releaseString  )  [inline]
 

Definition at line 115 of file OWBI1_StringBuffer.hpp.

References OWBI1::String::E_TAKE_OWNERSHIP.

Referenced by OWBI1::CIMObjectPath::unEscape().

void OWBI1::StringBuffer::reset  ) 
 

Definition at line 123 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

Referenced by getLine().

bool OWBI1::StringBuffer::startsWith char  ch  )  const
 

Definition at line 297 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

void OWBI1::StringBuffer::swap StringBuffer x  ) 
 

Definition at line 115 of file OWBI1_StringBuffer.cpp.

References m_allocated, m_bfr, m_len, and OW_NAMESPACE::swap().

String OWBI1::StringBuffer::toString  )  const [inline]
 

Definition at line 112 of file OWBI1_StringBuffer.hpp.

Referenced by OWBI1::CIMInstance::toString().

void OWBI1::StringBuffer::trim  ) 
 

Definition at line 314 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

void OWBI1::StringBuffer::truncate size_t  index  ) 
 

Truncate the string at the given index.

This doesn't change anything before the given index and does not free up any memory.

Parameters:
index The index to truncate the string buffer at. If this value is greater than the current length of the StringBuffer, then nothing is done.

Definition at line 131 of file OWBI1_StringBuffer.cpp.

References m_bfr, and m_len.

Referenced by chop(), and getLine().


Friends And Related Function Documentation

OWBI1_OWBI1PROVIFC_API std::ostream& operator<< std::ostream &  ostr,
const StringBuffer b
[friend]
 

Definition at line 387 of file OWBI1_StringBuffer.cpp.


Member Data Documentation

size_t OWBI1::StringBuffer::m_allocated [private]
 

Definition at line 167 of file OWBI1_StringBuffer.hpp.

Referenced by swap().

char* OWBI1::StringBuffer::m_bfr [private]
 

Definition at line 168 of file OWBI1_StringBuffer.hpp.

Referenced by append(), endsWith(), equals(), getLine(), operator[](), reset(), startsWith(), StringBuffer(), swap(), trim(), and truncate().

size_t OWBI1::StringBuffer::m_len [private]
 

Definition at line 166 of file OWBI1_StringBuffer.hpp.

Referenced by append(), chop(), endsWith(), operator[](), reset(), startsWith(), StringBuffer(), swap(), trim(), and truncate().

const size_t OWBI1::StringBuffer::OWBI1_DEFAULT_ALLOCATION_UNIT = 128 [static]
 

Definition at line 55 of file OWBI1_StringBuffer.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:18:44 2006 for openwbem by  doxygen 1.4.6