#include <String.h>
Inheritance diagram for TString:
Public Member Functions | |
TString (void) | |
Constructor. | |
TString (const DWORD &size) | |
Constructor. | |
TString (const TString &str) | |
Copy constructor. | |
TString (const char *str) | |
Constructor. | |
~TString (void) | |
Destructor. | |
void | operator= (const TString &str) |
Operator =. | |
void | ReserveSize (const DWORD &newSize) |
Resize string. | |
void | Clear (void) |
Set this string to "". | |
void | ClearDeallocOff (void) |
Set this string to "". | |
void | Compact (void) |
Set this string to minimal required length (minimal is 1 byte allocated for ""). | |
DWORD | Length (void) const |
Returns length of string excluding terminating character. | |
DWORD | Capacity (void) const |
Returns space allocated for string in bytes. | |
DWORD | FreeCapacity (void) const |
Returns count of free characters in string == number characters which may be added without allocating new characters. | |
BOOL | Empty (void) const |
Determines whether string is empty. | |
const char * | GetString (void) const |
Return pointer to C-string. | |
const char * | c_str (void) const |
Return pointer to C-string. | |
void | Add (char c) |
Add character to end of string. | |
void | Add (const char *str) |
Add string to end of this string. | |
void | Add (const TString &str) |
Add another string to end of this string. | |
void | Set (char c) |
Set character to string. | |
void | Set (const char *str) |
Set string to this string. | |
void | Set (const TString &str) |
Add another string to end of this string. | |
const char & | At (const DWORD &index) const |
Returns character at given position. | |
char & | At (const DWORD &index) |
Returns character at given position. | |
const char & | operator[] (const DWORD &index) const |
Returns character at given position. | |
char & | operator[] (const DWORD &index) |
Returns character at given position. | |
BOOL | Compare (const char *str) const |
Compare two strings. | |
BOOL | Compare (const TString &str) const |
Compare two strings. | |
void | TrimSpacesLeft (void) |
This method removes all white spaces from left. | |
void | TrimSpacesRight (void) |
This method removes all white spaces from right. | |
void | TrimSpaces (void) |
This method removes all white spaces from left and right. | |
TString | Substring (const DWORD &startIndex) |
Return substring that begin at position startIndex and continues to end of original string. | |
TString | Substring (const DWORD &startIndex, const DWORD &length) |
Return substring that begin at position STARTINDEX and has length equal to COUNT parameter. | |
void | ToLower (void) |
Converts all characters in string to lowercase if its possible. | |
void | ToUpper (void) |
Converts all characters in string to uppercase if its possible. | |
int | ToInt (void) const |
Converts string to integer. | |
float | ToFloat (void) const |
Converts string to float. | |
Static Public Member Functions | |
static TString | FromDWORD (const DWORD &value) |
Convert DWORD value to string. | |
static TString | FromINT (const int &value) |
Convert integer value to string. | |
static TString | FromFloat (const float &value) |
Convert double value to string. |
Symbols are 8bits ASCII.
For returned values it's recommended to use pointers or references to this class.
Definition at line 27 of file String.h.
|
Constructor. Creates empty string - "". Definition at line 22 of file String.cpp. Referenced by FromDWORD(), FromFloat(), FromINT(), and Substring(). |
|
Constructor. Creates empty string - "" - and allocates specified number of bytes. Number of allocated bytes is always SIZE+1
Definition at line 37 of file String.cpp. |
|
Copy constructor. Creates identical copy of string.
Definition at line 51 of file String.cpp. |
|
Constructor. Creates string from C-string.
Definition at line 64 of file String.cpp. |
|
Destructor.
Definition at line 76 of file String.cpp. |
|
Add another string to end of this string.
Definition at line 266 of file String.cpp. References length, ReserveSize(), and text. Here is the call graph for this function: ![]() |
|
Add string to end of this string.
Definition at line 244 of file String.cpp. References ReserveSize(). Here is the call graph for this function: ![]() |
|
Add character to end of string.
Definition at line 228 of file String.cpp. References ReserveSize(). Referenced by NSFileSystem::TVirtualFileReal::ReadString(), NSFileSystem::TVirtualFileCabinet::ReadString(), TFile::ReadString(), NSFileSystem::TVirtualFileReal::ReadUntil(), NSFileSystem::TVirtualFileCabinet::ReadUntil(), TFile::ReadUntil(), TFile::ReadWord(), NSFileSystem::TFSFileSystem::RegisterMultipleCabinets(), and NSFileSystem::TFSFileSystem::RegisterMultiplePaths(). Here is the call graph for this function: ![]() |
|
Returns character at given position. Position must be in range!!!
|
|
Returns character at given position. Position must be in range!!!
Definition at line 154 of file String.h. Referenced by NSFileSystem::TFSFileSystem::RegisterMultipleCabinets(), NSFileSystem::TFSFileSystem::RegisterMultiplePaths(), and NSFileSystem::TFSFileSystem::RegisterPath(). |
|
Return pointer to C-string.
Definition at line 142 of file String.h. Referenced by NSFileSystem::TFSFileSystem::Exists(), NSMeshes::TDeclarationManager::Initialize(), NSMeshes::TMeshManager::LoadRendererResources(), NSFileSystem::TVirtualFileReal::OpenFile(), NSFileSystem::TVirtualFileCabinet::OpenFile(), TFile::Write(), and TLogFile::WriteSTRING(). |
|
Returns space allocated for string in bytes.
|
|
Set this string to "". Allocated items doesnt change. Definition at line 137 of file String.cpp. Referenced by TFile::ReadString(), TFile::ReadUntil(), and TFile::ReadWord(). |
|
Set this string to "". Allocated items doesnt change. Method is identical with Clear method. Definition at line 148 of file String.cpp. Referenced by NSFileSystem::TVirtualFileReal::ReadString(), NSFileSystem::TVirtualFileCabinet::ReadString(), NSFileSystem::TVirtualFileReal::ReadUntil(), NSFileSystem::TVirtualFileCabinet::ReadUntil(), NSFileSystem::TFSFileSystem::RegisterMultipleCabinets(), and NSFileSystem::TFSFileSystem::RegisterMultiplePaths(). |
|
Set this string to minimal required length (minimal is 1 byte allocated for ""). Reallocated items to minimal required size (length+1). This method helps reduce required memory. Definition at line 159 of file String.cpp. |
|
Compare two strings. Returns only TRUE(strings are equal) or NO(not equal). Comparing is case sensitive. Before comparsion length of strings is compared, only strings with identical length will be compared.
Definition at line 209 of file String.cpp. |
|
Compare two strings.
Returns only TRUE(strings are equal) or NO(not equal). Comparing is case sensitive.
Definition at line 184 of file String.cpp. References FALSE. Referenced by NSXLoader::TXFrame::GetFrameByName(). |
|
Determines whether string is empty.
|
|
Returns count of free characters in string == number characters which may be added without allocating new characters.
|
|
Convert DWORD value to string.
Definition at line 473 of file String.cpp. References TString(). Here is the call graph for this function: ![]() |
|
Convert double value to string.
Definition at line 495 of file String.cpp. References TString(). Here is the call graph for this function: ![]() |
|
Convert integer value to string.
Definition at line 484 of file String.cpp. References TString(). Here is the call graph for this function: ![]() |
|
Return pointer to C-string.
Definition at line 133 of file String.h. Referenced by TFile::Erase(), NSConfigFile::TConfigFile::LoadConfigFile(), NSConfigFile::TConfigFile::LoadConfigFileFromVFS(), NSMeshes::TDeclarationLoader::LoadDeclarationFromFile(), NSMeshes::TMeshLoader::LoadMeshDataFromFile(), NSMeshes::TMeshLoader::LoadMeshFromFile(), TLogFile::Open(), and TFile::Open(). |
|
Returns length of string excluding terminating character. E.g. for string "test" is length 4.
Definition at line 99 of file String.h. Referenced by TGraphicTexture::LoadDDS(), NSFileSystem::TFSFileSystem::RegisterMultipleCabinets(), NSFileSystem::TFSFileSystem::RegisterMultiplePaths(), and NSFileSystem::TFSFileSystem::RegisterPath(). |
|
Operator =.
Definition at line 90 of file String.cpp. |
|
Returns character at given position. Position must be in range!!!
|
|
Returns character at given position. Position must be in range!!!
|
|
Resize string. Original string items are copy to new string. If size in parameter is less or equal than actual size then no changes are made.
Definition at line 119 of file String.cpp. Referenced by Add(). |
|
Add another string to end of this string.
Definition at line 335 of file String.cpp. |
|
Set string to this string. Identical with operator=.
Definition at line 308 of file String.cpp. |
|
Set character to string. After calling this method string contains only one character "c"
Definition at line 289 of file String.cpp. Referenced by TFile::Open(), and NSXLoader::TXMaterial::operator=(). |
|
Return substring that begin at position STARTINDEX and has length equal to COUNT parameter.
Definition at line 443 of file String.cpp. References TString(). Here is the call graph for this function: ![]() |
|
Return substring that begin at position startIndex and continues to end of original string. If position is invalid empty string is returned.
Definition at line 424 of file String.cpp. References TString(). Here is the call graph for this function: ![]() |
|
Converts string to float.
|
|
Converts string to integer.
Definition at line 197 of file String.h. Referenced by NSConfigFile::TConfigFileSection::GetValueBOOL(), NSConfigFile::TConfigFileSection::GetValueDWORD(), NSConfigFile::TConfigFileSection::GetValueINT(), and NSMeshes::TDeclarationManager::Initialize(). |
|
Converts all characters in string to lowercase if its possible.
Definition at line 359 of file String.cpp. |
|
Converts all characters in string to uppercase if its possible.
Definition at line 370 of file String.cpp. |
|
This method removes all white spaces from left and right.
Definition at line 412 of file String.cpp. References TrimSpacesLeft(), and TrimSpacesRight(). Here is the call graph for this function: ![]() |
|
This method removes all white spaces from left.
Definition at line 381 of file String.cpp. Referenced by TrimSpaces(). |
|
This method removes all white spaces from right.
Definition at line 401 of file String.cpp. Referenced by TrimSpaces(). |