3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
cStr Class Reference

Classes

struct  CodePage
 

Public Member Functions

 cStr (const cStr &Src)
 
 cStr (const cStr &Src, const int StartIndex, const int Count)
 
 cStr (const char *Src)
 
 cStr (const char *Src, const int StartIndex, const int Count)
 
 cStr (const wchar_t *Src)
 
 cStr (const int Length, const char Fill=' ')
 
void Copy (const cStr &)
 
void Copy (const cStr &, const int StartIndex, const int Count)
 
void Copy (const char *)
 
void Copy (const char *, const int StartIndex, const int Count)
 
void Copy (const wchar_t *)
 
void operator= (const cStr &)
 
void operator= (const char *)
 
void operator= (int)
 
const char * ToCharPtr () const
 
char * ToNonConstCharPtr ()
 
 operator const char * () const
 
char operator[] (const int CharIndex) const
 
char & operator[] (const int CharIndex)
 
int Length () const
 
void SetLength (const int Length, const char Fill=' ')
 
void CalcLength ()
 
void Fill (const char c)
 
bool IsEmpty () const
 
bool empty () const
 
void Clear ()
 
bool Equals (const char *) const
 
bool StartsWith (const char *Str, const bool NoCase=false) const
 
bool EndsWith (const char *Str, const bool NoCase=false) const
 
void Append (const cStr &)
 
void Append (const cStr &, const int StartIndex, const int Count)
 
void Append (const char *)
 
void Append (const wchar_t *)
 
void Append (const char *, const int StartIndex, const int Count)
 
void Append (const char)
 
void Append (const char, const int Count)
 
void Append (const bool)
 
void Append (const int)
 
void Append (const float, const int Prec=2)
 
void Append (const double, const int Prec=6)
 
void AppendWithEndLn (const cStr &)
 
void operator+= (const cStr &)
 
void operator+= (const char *)
 
void operator+= (const wchar_t *)
 
void operator+= (const char)
 
void operator+= (const bool)
 
void operator+= (const int)
 
void operator+= (const float)
 
void operator+= (const double)
 
cStroperator<< (const cStr &)
 
cStroperator<< (const char *)
 
cStroperator<< (const wchar_t *)
 
cStroperator<< (const char)
 
cStroperator<< (const bool)
 
cStroperator<< (const int)
 
cStroperator<< (const float)
 
cStroperator<< (const double)
 
void AppendPath (const char *Path)
 
void AppendFormat (const char *Format,...)
 
void Insert (const int Index, const cStr &)
 
void Insert (const int Index, const cStr &, const int StartIndex, const int Count)
 
void Insert (const int Index, const char *)
 
void Insert (const int Index, const char *, const int StartIndex, const int Count)
 
void Insert (const int Index, const char)
 
void Insert (const int Index, const char, const int Count)
 
void Insert (const int Index, const bool)
 
void Insert (const int Index, const int)
 
void Insert (const int Index, const float, const int Prec=2)
 
void Insert (const int Index, const double, const int Prec=6)
 
void Remove (const int StartIndex)
 
void Remove (const int StartIndex, const int Count)
 
void Replace (const char Char, const char WithChar)
 
void ReplaceCommaWithDot ()
 
void Replace (const char Char, const char WithChar, const int StartIndex, const int Count)
 
int Replace (const char *String, const char *WithString, const bool NoCase=false)
 
int Replace (const char *String, const char *WithString, const int StartIndex, const bool NoCase=false)
 
int Replace (const char *String, const char *WithString, const int StartIndex, const int Count, const bool NoCase=false)
 
int ReplaceFirst (const char *String, const char *WithString, const bool NoCase=false)
 
int ReplaceFirst (const char *String, const char *WithString, const int StartIndex, const int Count, const bool NoCase=false)
 
void ReplaceAny (const char *Chars, const char WithChar)
 
void ReplaceAny (const char *Chars, const char WithChar, const int StartIndex, const int Count)
 
const cStr Substring (const int StartIndex) const
 
const cStr Substring (const int StartIndex, const int Count) const
 
void TrimStart (const char *TrimChars)
 
void TrimEnd (const char *TrimChars)
 
void Trim (const char *TrimChars)
 
void PadLeft (const int TotalWidth, const char PaddingChar=' ')
 
void PadRight (const int TotalWidth, const char PaddingChar=' ')
 
bool Contains (const char c) const
 
bool Contains (const char *Str, const bool NoCase=false) const
 
int IndexOf (const char c) const
 
int IndexOf (const char c, const int StartIndex) const
 
int IndexOf (const char c, const int StartIndex, const int Count) const
 
int IndexOf (const char *Str, const bool NoCase=false) const
 
int IndexOf (const char *Str, const int StartIndex, const bool NoCase=false) const
 
int IndexOf (const char *Str, const int StartIndex, const int Count, const bool NoCase=false) const
 
int IndexOfAny (const char *Chars) const
 
int IndexOfAny (const char *Chars, const int StartIndex) const
 
int IndexOfAny (const char *Chars, const int StartIndex, const int Count) const
 
int LastIndexOf (const char c) const
 
int LastIndexOf (const char c, const int StartIndex) const
 
int LastIndexOf (const char c, const int StartIndex, const int Count) const
 
int LastIndexOf (const char *Str, const bool NoCase=false) const
 
int LastIndexOf (const char *Str, const int StartIndex, const bool NoCase=false) const
 
int LastIndexOf (const char *Str, const int StartIndex, const int Count, const bool NoCase=false) const
 
int LastIndexOfAny (const char *Chars) const
 
int LastIndexOfAny (const char *Chars, const int StartIndex) const
 
int LastIndexOfAny (const char *Chars, const int StartIndex, const int Count) const
 
void MakeLower (int start=0)
 
void MakeUpper (int start=0)
 
const cStr ToLower () const
 
const cStr ToUpper () const
 
void Split (cList< cStr > *List, const char *Delimiters=" ,;\t") const
 
int GetHashCode (const bool NoCase=false) const
 
const cStr GetFileExtension () const
 
const cStr GetFileName () const
 
const cStr GetFileBase () const
 
const cStr GetFilePath () const
 
void RemoveFileExtension ()
 
void RemoveFileName ()
 
void RemoveFilePath ()
 
void RemoveFileAbsPath (const char *AbsPath)
 
void AppendFileRelPath (const char *RelPath)
 
void SetFileExtension (const char *Extension)
 
void SetFileDefaultExtension (const char *DefaultExtension)
 
void SetFilePath (const char *Path)
 
void SetFileDefaultPath (const char *DefaultPath)
 
void EnsureTrailingBackslash ()
 
void EnsureTrailingSlash ()
 
void EnsureTrailingPlatformSlash ()
 
void SlashesToBackSlashes ()
 
void BackSlashesToSlashes ()
 
void MakePlatformSlashes ()
 
void Decode (const CodePage::Enum _CodePage, cList< word > *UniChars) const
 
bool DecodeUTF8 (cList< word > *UniChars) const
 
int CalcUTF8Length (const int StartIndex) const
 
void Init ()
 
void Free ()
 
 cStr (const ::std::wstring &Src)
 
 cStr (const std::string &Src)
 
void Copy (const ::std::wstring &)
 
void Copy (const ::std::string &)
 
void operator= (const ::std::wstring &)
 
void operator= (const ::std::string &)
 
void toWstring (::std::wstring &ws)
 
std::wstring toWstring ()
 
void Append (const std::string &)
 
void Append (const std::wstring &)
 
void operator+= (const std::string &)
 
void operator+= (const std::wstring &)
 
cStroperator<< (const std::string &)
 
cStroperator<< (const std::wstring &)
 

Static Public Member Functions

static int Length (const char *Str)
 
static bool Equals (const char *, const char *)
 
static bool Equals (const char *, const cStr &)
 
static bool Equals (const cStr &, const char *)
 
static bool Equals (const cStr &, const cStr &)
 
static bool Equals (const cStr *, const cStr *)
 
static bool Equals (const char *, const char *, const int MaxLength)
 
static bool Equals (const char *, const cStr &, const int MaxLength)
 
static bool Equals (const cStr &, const char *, const int MaxLength)
 
static bool Equals (const cStr &, const cStr &, const int MaxLength)
 
static bool EqualsNoCase (const char *, const char *)
 
static bool EqualsNoCase (const char *, const cStr &)
 
static bool EqualsNoCase (const cStr &, const char *)
 
static bool EqualsNoCase (const cStr &, const cStr &)
 
static bool EqualsNoCase (const cStr *, const cStr *)
 
static bool EqualsNoCase (const char *, const char *, const int MaxLength)
 
static bool EqualsNoCase (const char *, const cStr &, const int MaxLength)
 
static bool EqualsNoCase (const cStr &, const char *, const int MaxLength)
 
static bool EqualsNoCase (const cStr &, const cStr &, const int MaxLength)
 
static int Compare (const char *, const char *)
 
static int Compare (const char *, const cStr &)
 
static int Compare (const cStr &, const char *)
 
static int Compare (const cStr &, const cStr &)
 
static int Compare (const cStr *, const cStr *)
 
static int Compare (const char *, const char *, const int MaxLength)
 
static int Compare (const char *, const cStr &, const int MaxLength)
 
static int Compare (const cStr &, const char *, const int MaxLength)
 
static int Compare (const cStr &, const cStr &, const int MaxLength)
 
static int CompareNoCase (const char *, const char *)
 
static int CompareNoCase (const char *, const cStr &)
 
static int CompareNoCase (const cStr &, const char *)
 
static int CompareNoCase (const cStr &, const cStr &)
 
static int CompareNoCase (const cStr *, const cStr *)
 
static int CompareNoCase (const char *, const char *, const int MaxLength)
 
static int CompareNoCase (const char *, const cStr &, const int MaxLength)
 
static int CompareNoCase (const cStr &, const char *, const int MaxLength)
 
static int CompareNoCase (const cStr &, const cStr &, const int MaxLength)
 
static bool EqualsPath (const char *, const char *)
 
static bool EqualsPath (const char *, const cStr &)
 
static bool EqualsPath (const cStr &, const char *)
 
static bool EqualsPath (const cStr &, const cStr &)
 
static bool EqualsPath (const cStr *, const cStr *)
 
static bool EqualsPath (const char *, const char *, const int MaxLength)
 
static bool EqualsPath (const char *, const cStr &, const int MaxLength)
 
static bool EqualsPath (const cStr &, const char *, const int MaxLength)
 
static bool EqualsPath (const cStr &, const cStr &, const int MaxLength)
 
static int ComparePath (const char *, const char *)
 
static int ComparePath (const char *, const cStr &)
 
static int ComparePath (const cStr &, const char *)
 
static int ComparePath (const cStr &, const cStr &)
 
static int ComparePath (const cStr *, const cStr *)
 
static int ComparePath (const char *, const char *, const int MaxLength)
 
static int ComparePath (const char *, const cStr &, const int MaxLength)
 
static int ComparePath (const cStr &, const char *, const int MaxLength)
 
static int ComparePath (const cStr &, const cStr &, const int MaxLength)
 
static const cStr ToString (const bool)
 
static const cStr ToString (const int)
 
static const cStr ToString (const int, const int Prec)
 
static const cStr ToString (const int *IntArray, const int Count, const char *Separator=" ")
 
static const cStr ToString (const float, const int Prec=2)
 
static const cStr ToString (const float *FloatArray, const int Count, const int Prec=2, const char *Separator=" ")
 
static const cStr ToString (const double, const int Prec=6)
 
static const cStr ToString (const double *DoubleArray, const int Count, const int Prec=6, const char *Separator=" ")
 
static const cStr ToHex (const dword dw)
 
static const cStr ToHex (const qword qw)
 
static const cStr ToHex (const void *Ptr)
 
static const cStr ToSize (const qword, const bool Pow2=false)
 "cStr::ToSize" converts "qword" into short rounded size using Greek prefix
 
static int IndexOf (const char *Src, const char c)
 
static char ToLower (const char c)
 
static char ToUpper (const char c)
 
static const cStr Join (const char *Separator, const cList< cStr > &Strings)
 
static const cStr Join (const char *Separator, const cList< cStr > &Strings, const int StartIndex, const int Count)
 
static void Split (const char *Src, cList< cStr > *List, const char *Delimiters=" ,;\t")
 
static const cStr Format (const char *Format,...)
 
static const cStr Formatv (const char *Format, va_list Args)
 
static bool CharIsLower (const int c)
 
static bool CharIsUpper (const int c)
 
static bool CharIsAlpha (const int c)
 
static bool CharIsNumeric (const int c)
 
static bool CharIsHexadecimal (const int c)
 
static bool CharIsNewLine (const int c)
 
static bool CharIsTab (const int c)
 
static bool CharIsWhitespace (const int c)
 
static bool CharIsDecimalPoint (const int c)
 
static bool CharIsSign (const int c)
 
static bool CharIsExponent (const int c)
 
static bool ToInt (const char *Str, int *Value)
 
static bool ToFloat (const char *Str, float *Value)
 
static bool ToIntArray (const char *Str, cList< int > *IntArray)
 
static bool ToFloatArray (const char *Str, cList< float > *FloatArray)
 
static int GetHashCode (const char *Str, const bool NoCase=false)
 
static const cStr EnsureTrailingPlatformSlash (const cStr &S)
 

Static Public Attributes

static const cStr Empty
 
static const cStr EndLn
 

Friends

class cXml
 
bool operator== (const char *, const cStr &)
 
bool operator== (const cStr &, const char *)
 
bool operator== (const cStr &, const cStr &)
 
bool operator!= (const char *, const cStr &)
 
bool operator!= (const cStr &, const char *)
 
bool operator!= (const cStr &, const cStr &)
 
bool operator> (const char *, const cStr &)
 
bool operator> (const cStr &, const char *)
 
bool operator> (const cStr &, const cStr &)
 
bool operator>= (const char *, const cStr &)
 
bool operator>= (const cStr &, const char *)
 
bool operator>= (const cStr &, const cStr &)
 
bool operator< (const char *, const cStr &)
 
bool operator< (const cStr &, const char *)
 
bool operator< (const cStr &, const cStr &)
 
bool operator<= (const char *, const cStr &)
 
bool operator<= (const cStr &, const char *)
 
bool operator<= (const cStr &, const cStr &)
 
const cStr operator+ (const cStr &, const cStr &)
 
const cStr operator+ (const cStr &, const char *)
 
const cStr operator+ (const char *, const cStr &)
 
const cStr operator+ (const cStr &, const char)
 
const cStr operator+ (const char, const cStr &)
 
const cStr operator+ (const cStr &, const bool)
 
const cStr operator+ (const bool, const cStr &)
 
const cStr operator+ (const cStr &, const int)
 
const cStr operator+ (const int, const cStr &)
 
const cStr operator+ (const cStr &, const float)
 
const cStr operator+ (const float, const cStr &)
 
const cStr operator+ (const cStr &, const double)
 
const cStr operator+ (const double, const cStr &)
 
const cStr operator+ (const cStr &, const wchar_t *)
 
const cStr operator+ (const wchar_t *, const cStr &)
 
const cStr operator+ (const cStr &, const std::wstring &)
 
const cStr operator+ (const std::wstring &, const cStr &)
 
const cStr operator+ (const cStr &, const std::string &)
 
const cStr operator+ (const std::string &, const cStr &)
 

Member Function Documentation

◆ ToSize()

static const cStr cStr::ToSize ( const qword  ,
const bool  Pow2 = false 
)
static

"cStr::ToSize" converts "qword" into short rounded size using Greek prefix

Pow10 Pow2 qword
713 713 713
1.7 K 1.7 Ki 1690
1.4 M 1.3 Mi 1378142
1.8 G 1.6 Gi 1765432891
1.4 T 1.3 Ti 1432432891654
1.6 P 1.4 Pi 1581432432891654
1.8 E 1.6 Ei 1791581432432891654
14.8 E 12.8 Ei 14791581432432891654

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