Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::StrBuilder Class Reference

#include <StrBuilder.h>

Inheritance diagram for Gray::StrBuilder:
Gray::cMemBlock Gray::StrBuilderAlloc

Public Member Functions

 StrBuilder (void *p, StrLen_t nSize)
 
 StrBuilder (cMemBlock &m)
 
void ResetStr ()
 
StrLen_t get_Length () const
 
const char * get_Str () const noexcept
 
StrLen_t get_LenLeft () const
 
bool isOverflow () const
 
StrLen_t _cdecl AddFormat (const char *pszFormat,...)
 
StrLen_t AddStr (const char *pszStr)
 
void AddCRLF ()
 
void AddChar (char ch)
 
void AddCharRepeat (char ch, int iRepeat)
 
void AddBytesRaw (const void *p, size_t nSize)
 
void AddBytes (const void *p, size_t nSize)
 
- Public Member Functions inherited from Gray::cMemBlock
 cMemBlock () noexcept
 
 cMemBlock (const void *pData, size_t nSize) noexcept
 
 cMemBlock (const cMemBlock &block) noexcept
 
 cMemBlock (const cMemBlock *pBlock) noexcept
 
size_t get_DataSize () const noexcept
 
void * get_Data () const noexcept
 
BYTE * get_DataBytes () const noexcept
 
char * get_DataA () const noexcept
 
 operator const BYTE * () const noexcept
 
bool isValidPtr () const noexcept
 
bool IsValidIndex (size_t i) const noexcept
 
bool IsValidIndex2 (size_t i) const noexcept
 
bool IsValidPtr (const void *p) const noexcept
 
bool IsValidPtr2 (const void *p) const noexcept
 
bool IsZeros () const noexcept
 
bool IsEqualData (const void *pData, size_t nSize) const noexcept
 
bool IsEqualData (const cMemBlock *pData) const noexcept
 
bool IsEqualData (const cMemBlock &data) const noexcept
 
BYTE * GetOffset (size_t nOffset) const
 
const void * get_DataEnd () const noexcept
 
void put_DataPtr (void *pStart) noexcept
 
void put_Size (size_t nSize) noexcept
 
void SetBlock (void *pData, size_t nSize) noexcept
 
void SetEmptyBlock () noexcept
 
void InitZeros () noexcept
 
StrLen_t ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const
 

Public Attributes

char * m_pCur
 
StrLen_t m_nLenLeft
 

Protected Member Functions

void Advance (StrLen_t nLen)
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cMemBlock
static COMPARE_t __stdcall Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2)
 
- Protected Attributes inherited from Gray::cMemBlock
size_t m_nSize
 size_t of m_pData in bytes. May be determined at runtime. More...
 
void * m_pData
 

Detailed Description

Similar to .NET StringBuilder Fill a buffer with stuff. Track how much space is left.

Constructor & Destructor Documentation

◆ StrBuilder() [1/2]

Gray::StrBuilder::StrBuilder ( void *  p,
StrLen_t  nSize 
)
inline

◆ StrBuilder() [2/2]

Gray::StrBuilder::StrBuilder ( cMemBlock m)
inline

Member Function Documentation

◆ AddBytes()

void Gray::StrBuilder::AddBytes ( const void *  p,
size_t  nSize 
)
inline

◆ AddBytesRaw()

void Gray::StrBuilder::AddBytesRaw ( const void *  p,
size_t  nSize 
)
inline

◆ AddChar()

void Gray::StrBuilder::AddChar ( char  ch)
inline

◆ AddCharRepeat()

void Gray::StrBuilder::AddCharRepeat ( char  ch,
int  iRepeat 
)
inline

◆ AddCRLF()

void Gray::StrBuilder::AddCRLF ( )
inline

◆ AddFormat()

StrLen_t _cdecl Gray::StrBuilder::AddFormat ( const char *  pszFormat,
  ... 
)
inline

◆ AddStr()

StrLen_t Gray::StrBuilder::AddStr ( const char *  pszStr)
inline

◆ Advance()

void Gray::StrBuilder::Advance ( StrLen_t  nLen)
inlineprotected

◆ get_Length()

StrLen_t Gray::StrBuilder::get_Length ( ) const
inline

get Length used.

◆ get_LenLeft()

StrLen_t Gray::StrBuilder::get_LenLeft ( ) const
inline

◆ get_Str()

const char* Gray::StrBuilder::get_Str ( ) const
inlinenoexcept

◆ isOverflow()

bool Gray::StrBuilder::isOverflow ( ) const
inline

Assume truncation occurred. DISP_E_BUFFERTOOSMALL

◆ ResetStr()

void Gray::StrBuilder::ResetStr ( )
inline

Member Data Documentation

◆ m_nLenLeft

StrLen_t Gray::StrBuilder::m_nLenLeft

◆ m_pCur

char* Gray::StrBuilder::m_pCur

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