CStrA Struct Reference

Blob based case sensitive ANSI/UTF-8 string. More...

#include <str.hpp>

Inheritance diagram for CStrA:

CBlobT< char > CBlobBaseSimple

Public Types

typedef CBlobT< char > base
 base class

Public Member Functions

FORCEINLINE CStrA ()
 Create an empty CStrT.
FORCEINLINE CStrA (const OnTransfer &ot)
 Take over ownership constructor.
FORCEINLINE char * GrowSizeNC (bsize_t count)
 Grow the actual buffer and fix the trailing zero at the end.
FORCEINLINE void AppendStr (const char *str)
 Append zero-ended C string.
FORCEINLINE CStrAoperator= (const char *src)
 Assignment from C string.
FORCEINLINE bool operator< (const CStrA &other) const
 Lower-than operator (to support stl collections).
int AddFormatL (const char *format, va_list args)
 Add formated string (like vsprintf) at the end of existing contents.
int AddFormat (const char *format,...)
 Add formated string (like sprintf) at the end of existing contents.
int Format (const char *format,...)
 Assign formated string (like sprintf).

Detailed Description

Blob based case sensitive ANSI/UTF-8 string.

Definition at line 20 of file str.hpp.


Member Function Documentation

FORCEINLINE char* CStrA::GrowSizeNC ( bsize_t  count  )  [inline]

Grow the actual buffer and fix the trailing zero at the end.

Definition at line 36 of file str.hpp.

References CBlobBaseSimple::FixTail(), and CBlobT< char >::GrowSizeNC().

Referenced by AddFormatL(), and DumpTarget::WriteIndent().

FORCEINLINE void CStrA::AppendStr ( const char *  str  )  [inline]

Append zero-ended C string.

Definition at line 44 of file str.hpp.

References CBlobT< char >::Append(), CBlobBaseSimple::FixTail(), and StrEmpty().

Referenced by DumpTarget::BeginStruct(), operator=(), and DumpTarget::WriteLine().

FORCEINLINE CStrA& CStrA::operator= ( const char *  src  )  [inline]

Assignment from C string.

Definition at line 53 of file str.hpp.

References AppendStr(), and CBlobBaseSimple::Clear().

int CStrA::AddFormatL ( const char *  format,
va_list  args 
) [inline]

Add formated string (like vsprintf) at the end of existing contents.

Definition at line 67 of file str.hpp.

References CBlobBaseSimple::FixTail(), CBlobT< char >::GetReserve(), GrowSizeNC(), and CBlobT< char >::MakeFreeSpace().

Referenced by AddFormat(), Format(), and DumpTarget::WriteLine().

int CStrA::AddFormat ( const char *  format,
  ... 
) [inline]

Add formated string (like sprintf) at the end of existing contents.

Definition at line 102 of file str.hpp.

References AddFormatL().

Referenced by DumpTarget::BeginStruct(), ComposeNameT(), DumpTarget::EndStruct(), DumpTarget::WriteTile(), and DumpTarget::WriteValue().

int CStrA::Format ( const char *  format,
  ... 
) [inline]

Assign formated string (like sprintf).

Definition at line 112 of file str.hpp.

References AddFormatL(), and CBlobT< char >::Free().

Referenced by TileStr(), and ValueStr().


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

Generated on Wed Dec 23 23:28:15 2009 for OpenTTD by  doxygen 1.5.6