Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

STR_String Class Reference

#include <STR_String.h>

Inheritance diagram for STR_String:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 STR_String ()
 STR_String (char c)
 STR_String (char c, int len)
 STR_String (const char *str)
 STR_String (const char *str, int len)
 STR_String (const STR_String &str)
 STR_String (const STR_String &str, int len)
 STR_String (const char *src1, int src1_len, const char *src2, int src2_len)
 STR_String (int val)
 STR_String (dword val)
 STR_String (float val)
 STR_String (double val)
 ~STR_String ()
STR_StringFormat (const char *fmt,...)
STR_StringFormatAdd (const char *fmt,...)
void Clear ()
const STR_StringReverse ()
bool IsUpper () const
bool IsLower () const
bool IsEmpty () const
int Length () const
STR_StringSetLength (int len)
char GetAt (int pos) const
void SetAt (int pos, char c)
void SetAt (int pos, rcSTR_String str)
void SetAt (int pos, int num, rcSTR_String str)
void Replace (int pos, rcSTR_String str)
void Replace (int pos, int num, rcSTR_String str)
STR_String Left (int num) const
STR_String Right (int num) const
STR_String Mid (int pos, int num=INT_MAX) const
int Compare (rcSTR_String rhs) const
int CompareNoCase (rcSTR_String rhs) const
bool IsEqual (rcSTR_String rhs) const
bool IsEqualNoCase (rcSTR_String rhs) const
int Find (char c, int pos=0) const
int Find (const char *str, int pos=0) const
int Find (rcSTR_String 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
vector< STR_StringExplode (char c) const
STR_StringUpper ()
STR_StringLower ()
STR_StringCapitalize ()
STR_StringTrimLeft ()
STR_StringTrimLeft (char *set)
STR_StringTrimRight ()
STR_StringTrimRight (char *set)
STR_StringTrim ()
STR_StringTrim (char *set)
STR_StringTrimQuotes ()
 operator const char * () const
char * Ptr ()
const char * ReadPtr () const
float ToFloat () const
int ToInt () const
rcSTR_String operator= (const byte *rhs)
rcSTR_String operator= (rcSTR_String rhs)
rcSTR_String operator= (char rhs)
rcSTR_String operator= (const char *rhs)
rcSTR_String operator+= (const char *rhs)
rcSTR_String operator+= (rcSTR_String rhs)
rcSTR_String operator+= (char rhs)

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

char * pData
int Len
int Max

Friends

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

Detailed Description

Smart String Value class. Is used by parser when an expression tree is build containing string.

Definition at line 74 of file STR_String.h.


Constructor & Destructor Documentation

STR_String::STR_String ( )

Copyright (C) 2001 NaN Technologies B.V. This file was formerly known as: GEN_StdString.cpp.

Date:
April, 25, 2001

Definition at line 59 of file STR_String.cpp.

References pData.

STR_String::STR_String ( char  c)

Definition at line 72 of file STR_String.cpp.

References pData.

STR_String::STR_String ( char  c,
int  len 
)

Definition at line 86 of file STR_String.cpp.

References assertd, len(), NULL, and pData.

STR_String::STR_String ( const char *  str)

Definition at line 102 of file STR_String.cpp.

References assertd, Len, Max, NULL, pData, str, and strlen().

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

Definition at line 124 of file STR_String.cpp.

References assertd, len(), NULL, and pData.

STR_String::STR_String ( const STR_String str)
STR_String::STR_String ( const STR_String str,
int  len 
)
STR_String::STR_String ( const char *  src1,
int  src1_len,
const char *  src2,
int  src2_len 
)

Definition at line 171 of file STR_String.cpp.

References assertd, NULL, and pData.

STR_String::STR_String ( int  val) [explicit]

Definition at line 187 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String::STR_String ( dword  val) [explicit]

Definition at line 201 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String::STR_String ( float  val) [explicit]

Definition at line 214 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String::STR_String ( double  val) [explicit]

Definition at line 227 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String::~STR_String ( ) [inline]

Definition at line 90 of file STR_String.h.


Member Function Documentation

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

Definition at line 246 of file STR_String.cpp.

References assertd, Len, Max, NULL, and pData.

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

STR_String & STR_String::Capitalize ( )

Definition at line 544 of file STR_String.cpp.

References assertd, i, Len, NULL, and pData.

void STR_String::Clear ( ) [inline]

Definition at line 95 of file STR_String.h.

Referenced by Explode().

int STR_String::Compare ( rcSTR_String  rhs) const

Definition at line 480 of file STR_String.cpp.

References pData.

int STR_String::CompareNoCase ( rcSTR_String  rhs) const

Definition at line 490 of file STR_String.cpp.

References pData.

rcSTR_String STR_String::Concat ( const char *  data,
int  len 
) [protected]

Definition at line 686 of file STR_String.cpp.

References AllocBuffer(), assertd, len(), Len, NULL, and pData.

rcSTR_String STR_String::Copy ( const char *  src,
int  len 
) [protected]

Definition at line 667 of file STR_String.cpp.

References AllocBuffer(), assertd, len(), Len, NULL, and pData.

vector< STR_String > STR_String::Explode ( char  c) const

Definition at line 705 of file STR_String.cpp.

References Clear(), Find(), Left(), Length(), and Mid().

Referenced by main(), and KX_Dome::ParseWarpMesh().

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

Definition at line 353 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

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

int STR_String::Find ( rcSTR_String  str,
int  pos = 0 
) const

Definition at line 381 of file STR_String.cpp.

References assertd, Len, NULL, pData, and ReadPtr().

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

Definition at line 367 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

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

Definition at line 407 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String & STR_String::Format ( const char *  fmt,
  ... 
)
STR_String & STR_String::FormatAdd ( const char *  fmt,
  ... 
)

Definition at line 293 of file STR_String.cpp.

References AllocBuffer(), assertd, Len, NULL, and pData.

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

Definition at line 110 of file STR_String.h.

References assertd.

Referenced by split_string().

bool STR_String::IsEmpty ( ) const [inline]
bool STR_String::IsEqual ( rcSTR_String  rhs) const [inline]

Definition at line 125 of file STR_String.h.

bool STR_String::IsEqualNoCase ( rcSTR_String  rhs) const [inline]

Definition at line 126 of file STR_String.h.

bool STR_String::IsLower ( ) const

Definition at line 333 of file STR_String.cpp.

References i, isUpper(), Len, and pData.

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

Definition at line 197 of file STR_String.h.

Referenced by IsUpper().

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

Definition at line 199 of file STR_String.h.

Referenced by TrimLeft(), and TrimRight().

bool STR_String::IsUpper ( ) const

Definition at line 319 of file STR_String.cpp.

References i, isLower(), Len, and pData.

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

Definition at line 198 of file STR_String.h.

Referenced by IsLower().

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

Definition at line 118 of file STR_String.h.

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

int STR_String::Length ( ) const [inline]
STR_String & STR_String::Lower ( )

Definition at line 527 of file STR_String.cpp.

References assertd, i, Len, NULL, and pData.

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

Definition at line 120 of file STR_String.h.

Referenced by Explode(), and split_string().

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

Definition at line 152 of file STR_String.h.

rcSTR_String STR_String::operator+= ( rcSTR_String  rhs) [inline]

Definition at line 165 of file STR_String.h.

References Length(), and ReadPtr().

rcSTR_String STR_String::operator+= ( const char *  rhs) [inline]

Definition at line 164 of file STR_String.h.

References strlen().

rcSTR_String STR_String::operator+= ( char  rhs) [inline]

Definition at line 166 of file STR_String.h.

rcSTR_String STR_String::operator= ( const byte rhs) [inline]

Definition at line 159 of file STR_String.h.

References strlen().

rcSTR_String STR_String::operator= ( char  rhs) [inline]

Definition at line 161 of file STR_String.h.

rcSTR_String STR_String::operator= ( rcSTR_String  rhs) [inline]

Definition at line 160 of file STR_String.h.

References Length(), and ReadPtr().

rcSTR_String STR_String::operator= ( const char *  rhs) [inline]

Definition at line 162 of file STR_String.h.

References strlen().

char* STR_String::Ptr ( ) [inline]
const char* STR_String::ReadPtr ( ) const [inline]
void STR_String::Replace ( int  pos,
rcSTR_String  str 
)

Definition at line 421 of file STR_String.cpp.

References AllocBuffer(), Len, Length(), pData, and ReadPtr().

void STR_String::Replace ( int  pos,
int  num,
rcSTR_String  str 
)

Definition at line 446 of file STR_String.cpp.

References AllocBuffer(), assertd, Len, Length(), pData, and ReadPtr().

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

Definition at line 96 of file STR_String.h.

References swap().

int STR_String::RFind ( char  c) const

Definition at line 395 of file STR_String.cpp.

References assertd, NULL, and pData.

int STR_String::RFindOneOf ( const char *  set,
int  pos = 0 
) const
STR_String STR_String::Right ( int  num) const [inline]

Definition at line 119 of file STR_String.h.

Referenced by CValue::FindIdentifier().

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

Definition at line 111 of file STR_String.h.

References assertd.

void STR_String::SetAt ( int  pos,
int  num,
rcSTR_String  str 
) [inline]
void STR_String::SetAt ( int  pos,
rcSTR_String  str 
) [inline]
STR_String& STR_String::SetLength ( int  len) [inline]

Definition at line 109 of file STR_String.h.

References len().

float STR_String::ToFloat ( ) const [inline]

Definition at line 155 of file STR_String.h.

int STR_String::ToInt ( ) const [inline]

Definition at line 156 of file STR_String.h.

STR_String & STR_String::Trim ( )

Definition at line 592 of file STR_String.cpp.

References TrimLeft(), and TrimRight().

STR_String & STR_String::Trim ( char *  set)

Definition at line 632 of file STR_String.cpp.

References TrimLeft(), and TrimRight().

STR_String & STR_String::TrimLeft ( char *  set)

Definition at line 604 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String & STR_String::TrimLeft ( )

Definition at line 564 of file STR_String.cpp.

References assertd, isSpace(), Len, NULL, and pData.

Referenced by Trim().

STR_String & STR_String::TrimQuotes ( )

Definition at line 644 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String & STR_String::TrimRight ( )

Definition at line 579 of file STR_String.cpp.

References assertd, isSpace(), Len, NULL, and pData.

Referenced by Trim().

STR_String & STR_String::TrimRight ( char *  set)

Definition at line 619 of file STR_String.cpp.

References assertd, Len, NULL, and pData.

STR_String & STR_String::Upper ( )

Definition at line 510 of file STR_String.cpp.

References assertd, i, Len, NULL, and pData.

Referenced by SCA_PropertySensor::CheckPropertyCondition().


Friends And Related Function Documentation

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

Definition at line 184 of file STR_String.h.

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

Definition at line 185 of file STR_String.h.

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

Definition at line 186 of file STR_String.h.

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

Definition at line 170 of file STR_String.h.

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

Definition at line 169 of file STR_String.h.

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

Definition at line 171 of file STR_String.h.

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

Definition at line 177 of file STR_String.h.

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

Definition at line 176 of file STR_String.h.

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

Definition at line 175 of file STR_String.h.

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

Definition at line 183 of file STR_String.h.

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

Definition at line 181 of file STR_String.h.

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

Definition at line 182 of file STR_String.h.

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

Definition at line 172 of file STR_String.h.

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

Definition at line 174 of file STR_String.h.

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

Definition at line 173 of file STR_String.h.

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

Definition at line 178 of file STR_String.h.

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

Definition at line 180 of file STR_String.h.

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

Definition at line 179 of file STR_String.h.


Member Data Documentation

int STR_String::Len [protected]
int STR_String::Max [protected]

Definition at line 203 of file STR_String.h.

Referenced by AllocBuffer(), and STR_String().

char* STR_String::pData [protected]

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