Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CCString Class Reference

Smart String Value class. More...

#include <StdString.h>

Inheritance diagram for CCString:

KX_HashedString List of all members.

Public Methods

 CCString ()
 CCString (char c)
 CCString (char c, int len)
 CCString (const char *str)
 CCString (const char *str, int len)
 CCString (const CCString &str)
 CCString (const CCString & str, int len)
 CCString (const char *src1, int src1_len, const char *src2, int src2_len)
 CCString (int val)
 CCString (dword val)
 CCString (float val)
 CCString (double val)
 ~CCString ()
CCString& Format (const char *fmt, ...)
CCString& FormatAdd (const char *fmt, ...)
void Clear ()
const CCString& Reverse ()
bool IsUpper () const
bool IsLower () const
bool IsEmpty () const
int Length () const
CCString& SetLength (int len)
char GetAt (int pos) const
void SetAt (int pos, char c)
void SetAt (int pos, rcCCString str)
void SetAt (int pos, int num, rcCCString str)
void Replace (int pos, rcCCString str)
void Replace (int pos, int num, rcCCString str)
CCString Left (int num) const
CCString Right (int num) const
CCString Mid (int pos, int num = INT_MAX) const
int Compare (rcCCString rhs) const
int CompareNoCase (rcCCString rhs) const
bool IsEqual (rcCCString rhs) const
bool IsEqualNoCase (rcCCString rhs) const
int Find (char c, int pos = 0) const
int Find (const char *str, int pos = 0) const
int Find (rcCCString str, int pos = 0) const
int RFind (char c) const
int FindOneOf (const char *set, int pos = 0) const
int RFindOneOf (const char *set, int pos = 0) const
std::vector<CCString> Explode (char c) const
CCString& Upper ()
CCString& Lower ()
CCString& Capitalize ()
CCString& TrimLeft ()
CCString& TrimLeft (char *set)
CCString& TrimRight ()
CCString& TrimRight (char *set)
CCString& Trim ()
CCString& Trim (char *set)
CCString& TrimQuotes ()
 operator const char * () const
char* Ptr ()
const char* ReadPtr () const
float ToFloat () const
int ToInt () const
rcCCString operator= (const byte *rhs)
rcCCString operator= (rcCCString rhs)
rcCCString operator= (char rhs)
rcCCString operator= (const char *rhs)
rcCCString operator+= (const char *rhs)
rcCCString operator+= (rcCCString rhs)
rcCCString operator+= (char rhs)

Protected Methods

void AllocBuffer (int len, bool keep_contents)
rcCCString Copy (const char *src, int len)
rcCCString Concat (const char *data, int len)

Protected Attributes

char* pData
int Len
int Max

Static Protected Methods

bool isLower (char c)
bool isUpper (char c)
bool isSpace (char c)

Friends

bool operator< (rcCCString lhs, rcCCString rhs)
bool operator< (rcCCString lhs, const char *rhs)
bool operator< (const char *lhs, rcCCString rhs)
bool operator> (rcCCString lhs, rcCCString rhs)
bool operator> (rcCCString lhs, const char *rhs)
bool operator> (const char *lhs, rcCCString rhs)
bool operator<= (rcCCString lhs, rcCCString rhs)
bool operator<= (rcCCString lhs, const char *rhs)
bool operator<= (const char *lhs, rcCCString rhs)
bool operator>= (rcCCString lhs, rcCCString rhs)
bool operator>= (rcCCString lhs, const char *rhs)
bool operator>= (const char *lhs, rcCCString rhs)
bool operator== (rcCCString lhs, rcCCString rhs)
bool operator== (rcCCString lhs, const char *rhs)
bool operator== (const char *lhs, rcCCString rhs)
bool operator!= (rcCCString lhs, rcCCString rhs)
bool operator!= (rcCCString lhs, const char *rhs)
bool operator!= (const char *lhs, rcCCString rhs)

Detailed Description

Smart String Value class.

Is used by parser when an expression tree is build containing string.

Definition at line 27 of file StdString.h.


Constructor & Destructor Documentation

CCString::CCString ( )
 

Definition at line 26 of file StdString.cpp.

Referenced by Left(), Mid(), and Right().

CCString::CCString ( char c )
 

Definition at line 39 of file StdString.cpp.

CCString::CCString ( char c,
int len )
 

Definition at line 53 of file StdString.cpp.

CCString::CCString ( const char * str )
 

Definition at line 68 of file StdString.cpp.

CCString::CCString ( const char * str,
int len )
 

Definition at line 83 of file StdString.cpp.

CCString::CCString ( const CCString & str )
 

CCString::CCString ( const CCString & str,
int len )
 

CCString::CCString ( const char * src1,
int len1,
const char * src2,
int len2 )
 

Definition at line 130 of file StdString.cpp.

CCString::CCString ( int val ) [explicit]
 

Definition at line 146 of file StdString.cpp.

CCString::CCString ( dword val ) [explicit]
 

Definition at line 160 of file StdString.cpp.

CCString::CCString ( float val ) [explicit]
 

Definition at line 173 of file StdString.cpp.

CCString::CCString ( double val ) [explicit]
 

Definition at line 186 of file StdString.cpp.

CCString::~CCString ( ) [inline]
 

Definition at line 43 of file StdString.h.


Member Function Documentation

void CCString::AllocBuffer ( int len,
bool keep_contents ) [protected]
 

Definition at line 205 of file StdString.cpp.

Referenced by Concat(), Copy(), Format(), FormatAdd(), Replace(), and SetLength().

CCString & CCString::Capitalize ( )
 

Definition at line 503 of file StdString.cpp.

void CCString::Clear ( ) [inline]
 

Definition at line 48 of file StdString.h.

Referenced by Explode().

int CCString::Compare ( rcCCString rhs ) const
 

Definition at line 439 of file StdString.cpp.

Referenced by IsEqual().

int CCString::CompareNoCase ( rcCCString rhs ) const
 

Definition at line 449 of file StdString.cpp.

Referenced by IsEqualNoCase().

rcCCString CCString::Concat ( const char * data,
int len ) [protected]
 

Definition at line 643 of file StdString.cpp.

Referenced by operator+=().

rcCCString CCString::Copy ( const char * src,
int len ) [protected]
 

Definition at line 624 of file StdString.cpp.

Referenced by operator=().

std::vector< CCString > CCString::Explode ( char c ) const
 

Definition at line 662 of file StdString.cpp.

int CCString::Find ( rcCCString str,
int pos = 0 ) const
 

Definition at line 340 of file StdString.cpp.

int CCString::Find ( const char * str,
int pos = 0 ) const
 

Definition at line 326 of file StdString.cpp.

int CCString::Find ( char c,
int pos = 0 ) const
 

Definition at line 312 of file StdString.cpp.

Referenced by Explode(), CValue::FindIdentifier(), and RAS_OpenGLRasterizer::Init().

int CCString::FindOneOf ( const char * set,
int pos = 0 ) const
 

Definition at line 366 of file StdString.cpp.

CCString & CCString::Format ( const char * fmt,
... )
 

Definition at line 232 of file StdString.cpp.

Referenced by CIntValue::GetText(), and CFloatValue::GetText().

CCString & CCString::FormatAdd ( const char * fmt,
... )
 

Definition at line 252 of file StdString.cpp.

char CCString::GetAt ( int pos ) const [inline]
 

Definition at line 63 of file StdString.h.

bool CCString::IsEmpty ( ) const [inline]
 

Definition at line 58 of file StdString.h.

bool CCString::IsEqual ( rcCCString rhs ) const [inline]
 

Definition at line 78 of file StdString.h.

bool CCString::IsEqualNoCase ( rcCCString rhs ) const [inline]
 

Definition at line 79 of file StdString.h.

bool CCString::IsLower ( ) const
 

Definition at line 292 of file StdString.cpp.

bool CCString::IsUpper ( ) const
 

Definition at line 278 of file StdString.cpp.

CCString CCString::Left ( int num ) const [inline]
 

Definition at line 71 of file StdString.h.

Referenced by Explode(), and CValue::FindIdentifier().

int CCString::Length ( ) const [inline]
 

Definition at line 59 of file StdString.h.

Referenced by BL_ConvertControllers(), Explode(), CValue::FindIdentifier(), SCA_ILogicBrick::GetText(), CParser::GetValue(), CParser::ProcessText(), KX_BlenderRenderTools::RenderText(), Replace(), CPropValue::ReplicaSetName(), CPropValue::SetName(), and KX_HashedString::hash().

CCString & CCString::Lower ( )
 

Definition at line 486 of file StdString.cpp.

CCString CCString::Mid ( int pos,
int num = INT_MAX ) const [inline]
 

Definition at line 73 of file StdString.h.

Referenced by Explode().

char * CCString::Ptr ( ) [inline]
 

Definition at line 106 of file StdString.h.

Referenced by CStringValue::ConvertValueToPython(), SDLRenderTools::RenderText2D(), KX_BlenderRenderTools::RenderText2D(), GlutRenderTools::RenderText2D(), gPyMakeScreenshot__doc__(), and initGamePythonScripting().

int CCString::RFind ( char c ) const
 

Definition at line 354 of file StdString.cpp.

int CCString::RFindOneOf ( const char * set,
int pos = 0 ) const
 

const char * CCString::ReadPtr ( ) const [inline]
 

Definition at line 107 of file StdString.h.

Referenced by BL_ConvertActuators(), BL_CreateSumoObjectNew(), and SCA_PropertySensor::CheckPropertyCondition().

void CCString::Replace ( int pos,
int num,
rcCCString str )
 

Definition at line 405 of file StdString.cpp.

void CCString::Replace ( int pos,
rcCCString str )
 

Definition at line 380 of file StdString.cpp.

const CCString & CCString::Reverse ( ) [inline]
 

Definition at line 49 of file StdString.h.

CCString CCString::Right ( int num ) const [inline]
 

Definition at line 72 of file StdString.h.

Referenced by CValue::FindIdentifier().

void CCString::SetAt ( int pos,
int num,
rcCCString str ) [inline]
 

void CCString::SetAt ( int pos,
rcCCString str ) [inline]
 

void CCString::SetAt ( int pos,
char c ) [inline]
 

Definition at line 64 of file StdString.h.

CCString & CCString::SetLength ( int len ) [inline]
 

Definition at line 62 of file StdString.h.

float CCString::ToFloat ( ) const [inline]
 

Definition at line 108 of file StdString.h.

int CCString::ToInt ( ) const [inline]
 

Definition at line 109 of file StdString.h.

CCString & CCString::Trim ( char * set )
 

Definition at line 589 of file StdString.cpp.

CCString & CCString::Trim ( )
 

Definition at line 550 of file StdString.cpp.

CCString & CCString::TrimLeft ( char * set )
 

Definition at line 562 of file StdString.cpp.

CCString & CCString::TrimLeft ( )
 

Definition at line 523 of file StdString.cpp.

Referenced by Trim().

CCString & CCString::TrimQuotes ( )
 

Definition at line 601 of file StdString.cpp.

CCString & CCString::TrimRight ( char * set )
 

Definition at line 576 of file StdString.cpp.

CCString & CCString::TrimRight ( )
 

Definition at line 537 of file StdString.cpp.

Referenced by Trim().

CCString & CCString::Upper ( )
 

Definition at line 469 of file StdString.cpp.

bool CCString::isLower ( char c ) [inline, static, protected]
 

Definition at line 150 of file StdString.h.

Referenced by IsUpper().

bool CCString::isSpace ( char c ) [inline, static, protected]
 

Definition at line 152 of file StdString.h.

Referenced by TrimLeft(), and TrimRight().

bool CCString::isUpper ( char c ) [inline, static, protected]
 

Definition at line 151 of file StdString.h.

Referenced by IsLower(), and isLower().

CCString::operator const char * ( ) const [inline]
 

Definition at line 105 of file StdString.h.

rcCCString CCString::operator+= ( char rhs ) [inline]
 

Definition at line 119 of file StdString.h.

rcCCString CCString::operator+= ( rcCCString rhs ) [inline]
 

Definition at line 118 of file StdString.h.

rcCCString CCString::operator+= ( const char * rhs ) [inline]
 

Definition at line 117 of file StdString.h.

rcCCString CCString::operator= ( const char * rhs ) [inline]
 

Definition at line 115 of file StdString.h.

rcCCString CCString::operator= ( char rhs ) [inline]
 

Definition at line 114 of file StdString.h.

rcCCString CCString::operator= ( rcCCString rhs ) [inline]
 

Definition at line 113 of file StdString.h.

rcCCString CCString::operator= ( const byte * rhs ) [inline]
 

Definition at line 112 of file StdString.h.


Friends And Related Function Documentation

bool operator!= ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 139 of file StdString.h.

bool operator!= ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 138 of file StdString.h.

bool operator!= ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 137 of file StdString.h.

bool operator< ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 124 of file StdString.h.

bool operator< ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 123 of file StdString.h.

bool operator< ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 122 of file StdString.h.

bool operator<= ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 130 of file StdString.h.

bool operator<= ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 129 of file StdString.h.

bool operator<= ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 128 of file StdString.h.

bool operator== ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 136 of file StdString.h.

bool operator== ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 135 of file StdString.h.

bool operator== ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 134 of file StdString.h.

bool operator> ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 127 of file StdString.h.

bool operator> ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 126 of file StdString.h.

bool operator> ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 125 of file StdString.h.

bool operator>= ( const char * lhs,
rcCCString rhs ) [friend]
 

Definition at line 133 of file StdString.h.

bool operator>= ( rcCCString lhs,
const char * rhs ) [friend]
 

Definition at line 132 of file StdString.h.

bool operator>= ( rcCCString lhs,
rcCCString rhs ) [friend]
 

Definition at line 131 of file StdString.h.


Member Data Documentation

int CCString::Len [protected]
 

Definition at line 155 of file StdString.h.

int CCString::Max [protected]
 

Definition at line 156 of file StdString.h.

char * CCString::pData [protected]
 

Definition at line 154 of file StdString.h.


The documentation for this class was generated from the following files:
Generated at Thu Feb 1 13:03:32 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000