13 cStr(
const cStr& Src,
const int StartIndex,
const int Count);
14 cStr(
const char* Src);
15 cStr(
const char* Src,
const int StartIndex,
const int Count);
16 cStr(
const wchar_t* Src);
17 cStr(
const int Length,
const char Fill =
' ');
25 void Copy(
const cStr&);
26 void Copy(
const cStr&,
const int StartIndex,
const int Count);
27 void Copy(
const char*);
28 void Copy(
const char*,
const int StartIndex,
const int Count);
29 void Copy(
const wchar_t*);
30 void operator = (
const cStr&);
31 void operator = (
const char*);
32 void operator = (
int);
38 const char* ToCharPtr()
const;
39 char* ToNonConstCharPtr();
40 operator const char* ()
const;
46 char operator [] (
const int CharIndex)
const;
47 char& operator [] (
const int CharIndex);
53 static int Length(
const char* Str);
59 void SetLength(
const int Length,
const char Fill =
' ');
68 void Fill(
const char c);
76 static const cStr Empty;
81 static bool Equals(
const char*,
const char*);
82 static bool Equals(
const char*,
const cStr&);
83 static bool Equals(
const cStr&,
const char*);
84 static bool Equals(
const cStr&,
const cStr&);
85 static bool Equals(
const cStr*,
const cStr*);
86 bool Equals(
const char*)
const;
88 friend bool operator == (
const char*,
const cStr&);
89 friend bool operator == (
const cStr&,
const char*);
90 friend bool operator == (
const cStr&,
const cStr&);
92 friend bool operator != (
const char*,
const cStr&);
93 friend bool operator != (
const cStr&,
const char*);
94 friend bool operator != (
const cStr&,
const cStr&);
96 static bool Equals(
const char*,
const char*,
const int MaxLength);
97 static bool Equals(
const char*,
const cStr&,
const int MaxLength);
98 static bool Equals(
const cStr&,
const char*,
const int MaxLength);
99 static bool Equals(
const cStr&,
const cStr&,
const int MaxLength);
101 static bool EqualsNoCase(
const char*,
const char*);
102 static bool EqualsNoCase(
const char*,
const cStr&);
103 static bool EqualsNoCase(
const cStr&,
const char*);
104 static bool EqualsNoCase(
const cStr&,
const cStr&);
105 static bool EqualsNoCase(
const cStr*,
const cStr*);
107 static bool EqualsNoCase(
const char*,
const char*,
const int MaxLength);
108 static bool EqualsNoCase(
const char*,
const cStr&,
const int MaxLength);
109 static bool EqualsNoCase(
const cStr&,
const char*,
const int MaxLength);
110 static bool EqualsNoCase(
const cStr&,
const cStr&,
const int MaxLength);
115 static int Compare(
const char*,
const char*);
116 static int Compare(
const char*,
const cStr&);
117 static int Compare(
const cStr&,
const char*);
118 static int Compare(
const cStr&,
const cStr&);
119 static int Compare(
const cStr*,
const cStr*);
121 friend bool operator > (
const char*,
const cStr&);
122 friend bool operator > (
const cStr&,
const char*);
123 friend bool operator > (
const cStr&,
const cStr&);
125 friend bool operator >= (
const char*,
const cStr&);
126 friend bool operator >= (
const cStr&,
const char*);
127 friend bool operator >= (
const cStr&,
const cStr&);
129 friend bool operator < (
const char*,
const cStr&);
130 friend bool operator < (
const cStr&,
const char*);
131 friend bool operator < (
const cStr&,
const cStr&);
133 friend bool operator <= (
const char*,
const cStr&);
134 friend bool operator <= (
const cStr&,
const char*);
135 friend bool operator <= (
const cStr&,
const cStr&);
137 static int Compare(
const char*,
const char*,
const int MaxLength);
138 static int Compare(
const char*,
const cStr&,
const int MaxLength);
139 static int Compare(
const cStr&,
const char*,
const int MaxLength);
140 static int Compare(
const cStr&,
const cStr&,
const int MaxLength);
142 static int CompareNoCase(
const char*,
const char*);
143 static int CompareNoCase(
const char*,
const cStr&);
144 static int CompareNoCase(
const cStr&,
const char*);
145 static int CompareNoCase(
const cStr&,
const cStr&);
146 static int CompareNoCase(
const cStr*,
const cStr*);
148 static int CompareNoCase(
const char*,
const char*,
const int MaxLength);
149 static int CompareNoCase(
const char*,
const cStr&,
const int MaxLength);
150 static int CompareNoCase(
const cStr&,
const char*,
const int MaxLength);
151 static int CompareNoCase(
const cStr&,
const cStr&,
const int MaxLength);
156 static bool EqualsPath(
const char*,
const char*);
157 static bool EqualsPath(
const char*,
const cStr&);
158 static bool EqualsPath(
const cStr&,
const char*);
159 static bool EqualsPath(
const cStr&,
const cStr&);
160 static bool EqualsPath(
const cStr*,
const cStr*);
162 static bool EqualsPath(
const char*,
const char*,
const int MaxLength);
163 static bool EqualsPath(
const char*,
const cStr&,
const int MaxLength);
164 static bool EqualsPath(
const cStr&,
const char*,
const int MaxLength);
165 static bool EqualsPath(
const cStr&,
const cStr&,
const int MaxLength);
170 static int ComparePath(
const char*,
const char*);
171 static int ComparePath(
const char*,
const cStr&);
172 static int ComparePath(
const cStr&,
const char*);
173 static int ComparePath(
const cStr&,
const cStr&);
174 static int ComparePath(
const cStr*,
const cStr*);
176 static int ComparePath(
const char*,
const char*,
const int MaxLength);
177 static int ComparePath(
const char*,
const cStr&,
const int MaxLength);
178 static int ComparePath(
const cStr&,
const char*,
const int MaxLength);
179 static int ComparePath(
const cStr&,
const cStr&,
const int MaxLength);
190 bool StartsWith(
const char* Str,
const bool NoCase =
false)
const;
194 bool EndsWith(
const char* Str,
const bool NoCase =
false)
const;
202 static const cStr ToString(
const bool);
203 static const cStr ToString(
const int);
204 static const cStr ToString(
const int,
const int Prec);
205 static const cStr ToString(
const int* IntArray,
const int Count,
const char* Separator =
" ");
206 static const cStr ToString(
const float,
const int Prec = 2);
207 static const cStr ToString(
const float* FloatArray,
const int Count,
const int Prec = 2,
const char* Separator =
" ");
208 static const cStr ToString(
const double,
const int Prec = 6);
209 static const cStr ToString(
const double* DoubleArray,
const int Count,
const int Prec = 6,
const char* Separator =
" ");
210 static const cStr ToHex(
const dword dw);
211 static const cStr ToHex(
const qword qw);
212 static const cStr ToHex(
const void* Ptr);
228 static const cStr ToSize(
const qword,
const bool Pow2 =
false);
233 void Append(
const cStr&);
234 void Append(
const cStr&,
const int StartIndex,
const int Count);
235 void Append(
const char*);
236 void Append(
const wchar_t*);
237 void Append(
const char*,
const int StartIndex,
const int Count);
238 void Append(
const char);
239 void Append(
const char,
const int Count);
240 void Append(
const bool);
241 void Append(
const int);
242 void Append(
const float,
const int Prec = 2);
243 void Append(
const double,
const int Prec = 6);
245 void AppendWithEndLn(
const cStr&);
246 static const cStr EndLn;
248 void operator += (
const cStr&);
249 void operator += (
const char*);
250 void operator += (
const wchar_t*);
251 void operator += (
const char);
252 void operator += (
const bool);
253 void operator += (
const int);
254 void operator += (
const float);
255 void operator += (
const double);
258 cStr& operator << (
const char*);
259 cStr& operator << (
const wchar_t*);
260 cStr& operator << (
const char);
261 cStr& operator << (
const bool);
262 cStr& operator << (
const int);
263 cStr& operator << (
const float);
264 cStr& operator << (
const double);
266 friend const cStr operator + (
const cStr&,
const cStr&);
267 friend const cStr operator + (
const cStr&,
const char*);
268 friend const cStr operator + (
const char*,
const cStr&);
269 friend const cStr operator + (
const cStr&,
const char);
270 friend const cStr operator + (
const char,
const cStr&);
271 friend const cStr operator + (
const cStr&,
const bool);
272 friend const cStr operator + (
const bool,
const cStr&);
273 friend const cStr operator + (
const cStr&,
const int);
274 friend const cStr operator + (
const int,
const cStr&);
275 friend const cStr operator + (
const cStr&,
const float);
276 friend const cStr operator + (
const float,
const cStr&);
277 friend const cStr operator + (
const cStr&,
const double);
278 friend const cStr operator + (
const double,
const cStr&);
280 friend const cStr operator + (
const cStr&,
const wchar_t*);
281 friend const cStr operator + (
const wchar_t*,
const cStr&);
286 void AppendPath(
const char* Path);
287 void AppendFormat(
const char* Format, ...);
292 void Insert(
const int Index,
const cStr&);
293 void Insert(
const int Index,
const cStr&,
const int StartIndex,
const int Count);
294 void Insert(
const int Index,
const char*);
295 void Insert(
const int Index,
const char*,
const int StartIndex,
const int Count);
296 void Insert(
const int Index,
const char);
297 void Insert(
const int Index,
const char,
const int Count);
298 void Insert(
const int Index,
const bool);
299 void Insert(
const int Index,
const int);
300 void Insert(
const int Index,
const float,
const int Prec = 2);
301 void Insert(
const int Index,
const double,
const int Prec = 6);
308 void Remove(
const int StartIndex);
311 void Remove(
const int StartIndex,
const int Count);
317 void Replace(
const char Char,
const char WithChar);
318 void ReplaceCommaWithDot() {
322 void Replace(
const char Char,
const char WithChar,
const int StartIndex,
const int Count);
331 int Replace(
const char* String,
const char* WithString,
const bool NoCase =
false);
333 int Replace(
const char* String,
const char* WithString,
const int StartIndex,
const bool NoCase =
false);
335 int Replace(
const char* String,
const char* WithString,
const int StartIndex,
const int Count,
const bool NoCase =
false);
337 int ReplaceFirst(
const char* String,
const char* WithString,
const bool NoCase =
false);
339 int ReplaceFirst(
const char* String,
const char* WithString,
const int StartIndex,
const int Count,
const bool NoCase =
false);
346 void ReplaceAny(
const char* Chars,
const char WithChar);
348 void ReplaceAny(
const char* Chars,
const char WithChar,
const int StartIndex,
const int Count);
355 const cStr Substring(
const int StartIndex)
const;
357 const cStr Substring(
const int StartIndex,
const int Count)
const;
364 void TrimStart(
const char* TrimChars);
367 void TrimEnd(
const char* TrimChars);
370 void Trim(
const char* TrimChars);
377 void PadLeft(
const int TotalWidth,
const char PaddingChar =
' ');
380 void PadRight(
const int TotalWidth,
const char PaddingChar =
' ');
386 bool Contains(
const char c)
const;
390 bool Contains(
const char* Str,
const bool NoCase =
false)
const;
397 int IndexOf(
const char c)
const;
398 static int IndexOf(
const char* Src,
const char c);
400 int IndexOf(
const char c,
const int StartIndex)
const;
402 int IndexOf(
const char c,
const int StartIndex,
const int Count)
const;
411 int IndexOf(
const char* Str,
const bool NoCase =
false)
const;
413 int IndexOf(
const char* Str,
const int StartIndex,
const bool NoCase =
false)
const;
415 int IndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase =
false)
const;
422 int IndexOfAny(
const char* Chars)
const;
424 int IndexOfAny(
const char* Chars,
const int StartIndex)
const;
426 int IndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const;
433 int LastIndexOf(
const char c)
const;
436 int LastIndexOf(
const char c,
const int StartIndex)
const;
440 int LastIndexOf(
const char c,
const int StartIndex,
const int Count)
const;
449 int LastIndexOf(
const char* Str,
const bool NoCase =
false)
const;
451 int LastIndexOf(
const char* Str,
const int StartIndex,
const bool NoCase =
false)
const;
454 int LastIndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase =
false)
const;
461 int LastIndexOfAny(
const char* Chars)
const;
464 int LastIndexOfAny(
const char* Chars,
const int StartIndex)
const;
468 int LastIndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const;
473 static char ToLower(
const char c);
474 static char ToUpper(
const char c);
475 void MakeLower(
int start = 0);
476 void MakeUpper(
int start = 0);
477 const cStr ToLower()
const;
478 const cStr ToUpper()
const;
485 static const cStr Join(
const char* Separator,
const cList<cStr>& Strings);
487 static const cStr Join(
const char* Separator,
const cList<cStr>& Strings,
const int StartIndex,
const int Count);
494 static void Split(
const char* Src,
cList<cStr>* List,
const char* Delimiters =
" ,;\t");
495 void Split(
cList<cStr>* List,
const char* Delimiters =
" ,;\t")
const;
502 static const cStr Format(
const char* Format, ...);
503 static const cStr Formatv(
const char* Format, va_list Args);
508 static bool CharIsLower(
const int c);
509 static bool CharIsUpper(
const int c);
510 static bool CharIsAlpha(
const int c);
511 static bool CharIsNumeric(
const int c);
512 static bool CharIsHexadecimal(
const int c);
513 static bool CharIsNewLine(
const int c);
514 static bool CharIsTab(
const int c);
515 static bool CharIsWhitespace(
const int c);
516 static bool CharIsDecimalPoint(
const int c);
517 static bool CharIsSign(
const int c);
518 static bool CharIsExponent(
const int c);
523 static bool ToInt(
const char* Str,
int* Value);
528 static bool ToFloat(
const char* Str,
float* Value);
538 static bool ToIntArray(
const char* Str,
cList<int>* IntArray);
539 static bool ToFloatArray(
const char* Str,
cList<float>* FloatArray);
544 int GetHashCode(
const bool NoCase =
false)
const {
545 return GetHashCode(m_Str, NoCase);
547 static int GetHashCode(
const char* Str,
const bool NoCase =
false);
552 const cStr GetFileExtension()
const;
553 const cStr GetFileName()
const;
554 const cStr GetFileBase()
const;
555 const cStr GetFilePath()
const;
560 void RemoveFileExtension();
561 void RemoveFileName();
562 void RemoveFilePath();
564 void RemoveFileAbsPath(
const char* AbsPath);
565 void AppendFileRelPath(
const char* RelPath);
570 void SetFileExtension(
const char* Extension);
571 void SetFileDefaultExtension(
const char* DefaultExtension);
572 void SetFilePath(
const char* Path);
573 void SetFileDefaultPath(
const char* DefaultPath);
575 void EnsureTrailingBackslash();
576 void EnsureTrailingSlash();
577 void EnsureTrailingPlatformSlash() {
578#if defined COMMS_WINDOWS
579 EnsureTrailingBackslash();
581#if defined COMMS_MACOS || defined COMMS_LINUX
582 EnsureTrailingSlash();
585 static const cStr EnsureTrailingPlatformSlash(
const cStr &S) {
587 T.EnsureTrailingPlatformSlash();
591 void SlashesToBackSlashes();
592 void BackSlashesToSlashes();
593 void MakePlatformSlashes() {
594#if defined COMMS_WINDOWS
595 SlashesToBackSlashes();
597#if defined COMMS_MACOS || defined COMMS_LINUX
598 BackSlashesToSlashes();
611 void Decode(
const CodePage::Enum _CodePage,
cList<word>* UniChars)
const;
613 int CalcUTF8Length(
const int StartIndex)
const;
618 cStr(const ::std::wstring& Src);
619 cStr(
const std::string& Src);
620 void Copy(const ::std::wstring&);
621 void Copy(const ::std::string&);
622 void operator = (const ::std::wstring&);
623 void operator = (const ::std::string&);
624 void toWstring(::std::wstring& ws);
625 std::wstring toWstring();
626 void Append(
const std::string&);
627 void Append(
const std::wstring&);
628 void operator += (
const std::string&);
629 void operator += (
const std::wstring&);
630 cStr& operator << (
const std::string&);
631 cStr& operator << (
const std::wstring&);
632 friend const cStr operator + (
const cStr&,
const std::wstring&);
633 friend const cStr operator + (
const std::wstring&,
const cStr&);
634 friend const cStr operator + (
const cStr&,
const std::string&);
635 friend const cStr operator + (
const std::string&,
const cStr&);
639 int m_Length, m_Capacity;
644 BaseBufferLength = 32,
650 bool IsValid()
const;
652 void EnsureCapacity(
const int MinCapacity,
const bool KeepOld =
true);
653 void Resize(
const int MinCapacity,
const bool KeepOld);
654 static char* getstr();
655 static void freestr(
char* s);
659inline bool cStr::IsValid()
const {
668inline void cStr::Init() {
677inline void cStr::Free() {
681 if (m_Capacity > Param::BaseBufferLength) {
682 cPool::Free((
byte*)m_Str, m_Capacity);
684 else if (m_Str)freestr(m_Str);
689inline void cStr::EnsureCapacity(
const int MinCapacity,
const bool KeepOld) {
690 if (MinCapacity > m_Capacity) {
691 Resize(MinCapacity, KeepOld);
705inline cStr::cStr(
const cStr& Src) {
711inline cStr::cStr(
const cStr& Src,
const int StartIndex,
const int Count) {
713 Copy(Src, StartIndex, Count);
717inline cStr::cStr(
const char* Src) {
722inline cStr::cStr(
const wchar_t* Src) {
728inline cStr::cStr(
const char* Src,
const int StartIndex,
const int Count) {
730 Copy(Src, StartIndex, Count);
734inline cStr::cStr(
const int Length,
const char Fill) {
736 SetLength(Length, Fill);
744inline cStr::~cStr() {
753inline void cStr::Copy(
const cStr& Src) {
754 cAssert(Src.IsValid());
755 Copy(Src.m_Str, 0, Src.m_Length);
759inline void cStr::Copy(
const cStr& Src,
const int StartIndex,
const int Count) {
760 cAssert(Src.IsValid());
761 Copy(Src.m_Str, StartIndex, Count);
765inline void cStr::Copy(
const char* Src) {
766 Copy(Src, 0, Length(Src));
770inline void cStr::operator = (
const cStr& Src) {
775inline void cStr::operator = (
const char* Src) {
779inline void cStr::operator=(
int x) {
791inline const char* cStr::ToCharPtr()
const {
793 return m_Str ? m_Str : &def_str;
797inline char* cStr::ToNonConstCharPtr() {
798 return (
this && m_Str) ? m_Str : &def_str;
802inline cStr::operator
const char* ()
const {
803 return (
this && m_Str) ? m_Str : &def_str;
816inline char cStr::operator [] (
const int CharIndex)
const {
818 cAssert(CharIndex >= 0);
819 cAssert(CharIndex <= m_Length);
820 return m_Str ? m_Str[CharIndex] : 0;
824inline char& cStr::operator [] (
const int CharIndex) {
826 cAssert(CharIndex >= 0);
827 cAssert(CharIndex <= m_Length);
828 return m_Str ? m_Str[CharIndex] : def_str;
836inline int cStr::Length()
const {
842inline int cStr::Length(
const char* Str) {
843 if (Str ==
nullptr) {
849 for (l = 0; Str[l] !=
'\0'; l++) {
859inline void cStr::SetLength(
const int Length,
const char Fill) {
861 cAssert(Length >= 0);
869 EnsureCapacity(Length + 1);
870 for (i = 0; i < Length; i++) {
874 m_Str[Length] =
'\0';
880inline void cStr::CalcLength() {
881 m_Length = Length(m_Str);
886inline void cStr::Fill(
const char c) {
891 for (i = 0; i < m_Length; i++) {
901inline bool cStr::IsEmpty()
const {
902 return Equals(m_Str,
"");
905inline bool cStr::empty()
const {
906 return Length() == 0;
910inline void cStr::Clear() {
912 EnsureCapacity(1,
false);
924inline bool cStr::Equals(
const char* l,
const char* r) {
925 return Compare(l, r) == 0;
929inline bool cStr::Equals(
const char* l,
const cStr& r) {
930 cAssert(r.IsValid());
931 return Compare(l, r.ToCharPtr()) == 0;
935inline bool cStr::Equals(
const cStr& l,
const char* r) {
936 cAssert(l.IsValid());
937 return Compare(l.ToCharPtr(), r) == 0;
941inline bool cStr::Equals(
const cStr& l,
const cStr& r) {
942 cAssert(l.IsValid());
943 cAssert(r.IsValid());
944 return Compare(l.ToCharPtr(), r.ToCharPtr()) == 0;
948inline bool cStr::Equals(
const cStr* l,
const cStr* r) {
949 cAssert(l !=
nullptr);
950 cAssert(r !=
nullptr);
951 cAssert(l->IsValid());
952 cAssert(r->IsValid());
953 return Compare(l->ToCharPtr(), r->ToCharPtr()) == 0;
956inline bool cStr::Equals(
const char* r)
const {
957 return cStr::Compare(ToCharPtr(), r) == 0;
961inline bool operator == (
const char* l,
const cStr& r) {
962 cAssert(r.IsValid());
963 return cStr::Compare(l, r.ToCharPtr()) == 0;
967inline bool operator == (
const cStr& l,
const char* r) {
968 cAssert(l.IsValid());
969 return cStr::Compare(l.ToCharPtr(), r) == 0;
973inline bool operator == (
const cStr& l,
const cStr& r) {
974 cAssert(l.IsValid());
975 cAssert(r.IsValid());
976 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) == 0;
980inline bool operator != (
const char* l,
const cStr& r) {
981 cAssert(r.IsValid());
982 return cStr::Compare(l, r.ToCharPtr()) != 0;
986inline bool operator != (
const cStr& l,
const char* r) {
987 cAssert(l.IsValid());
988 return cStr::Compare(l.ToCharPtr(), r) != 0;
992inline bool operator != (
const cStr& l,
const cStr& r) {
993 cAssert(l.IsValid());
994 cAssert(r.IsValid());
995 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) != 0;
999inline bool cStr::Equals(
const char* l,
const char* r,
const int MaxLength) {
1000 return Compare(l, r, MaxLength) == 0;
1004inline bool cStr::Equals(
const char* l,
const cStr& r,
const int MaxLength) {
1005 cAssert(r.IsValid());
1006 return Compare(l, r.ToCharPtr(), MaxLength) == 0;
1010inline bool cStr::Equals(
const cStr& l,
const char* r,
const int MaxLength) {
1011 cAssert(l.IsValid());
1012 return Compare(l.ToCharPtr(), r, MaxLength) == 0;
1016inline bool cStr::Equals(
const cStr& l,
const cStr& r,
const int MaxLength) {
1017 cAssert(l.IsValid());
1018 cAssert(r.IsValid());
1019 return Compare(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1023inline bool cStr::EqualsNoCase(
const char* l,
const char* r) {
1024 return CompareNoCase(l, r) == 0;
1028inline bool cStr::EqualsNoCase(
const char* l,
const cStr& r) {
1029 cAssert(r.IsValid());
1030 return CompareNoCase(l, r.ToCharPtr()) == 0;
1034inline bool cStr::EqualsNoCase(
const cStr& l,
const char* r) {
1035 cAssert(l.IsValid());
1036 return CompareNoCase(l.ToCharPtr(), r) == 0;
1040inline bool cStr::EqualsNoCase(
const cStr& l,
const cStr& r) {
1041 cAssert(l.IsValid());
1042 cAssert(r.IsValid());
1043 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr()) == 0;
1047inline bool cStr::EqualsNoCase(
const cStr* l,
const cStr* r) {
1048 cAssert(l !=
nullptr);
1049 cAssert(r !=
nullptr);
1050 cAssert(l->IsValid());
1051 cAssert(r->IsValid());
1052 return CompareNoCase(l->ToCharPtr(), r->ToCharPtr()) == 0;
1056inline bool cStr::EqualsNoCase(
const char* l,
const char* r,
const int MaxLength) {
1057 return CompareNoCase(l, r, MaxLength) == 0;
1061inline bool cStr::EqualsNoCase(
const char* l,
const cStr& r,
const int MaxLength) {
1062 cAssert(r.IsValid());
1063 return CompareNoCase(l, r.ToCharPtr(), MaxLength) == 0;
1067inline bool cStr::EqualsNoCase(
const cStr& l,
const char* r,
const int MaxLength) {
1068 cAssert(l.IsValid());
1069 return CompareNoCase(l.ToCharPtr(), r, MaxLength) == 0;
1073inline bool cStr::EqualsNoCase(
const cStr& l,
const cStr& r,
const int MaxLength) {
1074 cAssert(l.IsValid());
1075 cAssert(r.IsValid());
1076 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1084inline int cStr::Compare(
const char* l,
const char* r) {
1085 return Compare(l, r, -1);
1089inline int cStr::Compare(
const char* l,
const cStr& r) {
1090 cAssert(r.IsValid());
1091 return Compare(l, r.ToCharPtr());
1095inline int cStr::Compare(
const cStr& l,
const char* r) {
1096 cAssert(l.IsValid());
1097 return Compare(l.ToCharPtr(), r);
1101inline int cStr::Compare(
const cStr& l,
const cStr& r) {
1102 cAssert(l.IsValid());
1103 cAssert(r.IsValid());
1104 return Compare(l.ToCharPtr(), r.ToCharPtr());
1108inline int cStr::Compare(
const cStr* l,
const cStr* r) {
1109 cAssert(l !=
nullptr);
1110 cAssert(r !=
nullptr);
1111 cAssert(l->IsValid());
1112 cAssert(r->IsValid());
1113 return Compare(l->ToCharPtr(), r->ToCharPtr());
1117inline bool operator > (
const char* l,
const cStr& r) {
1118 cAssert(r.IsValid());
1119 return cStr::Compare(l, r.ToCharPtr()) > 0;
1123inline bool operator > (
const cStr& l,
const char* r) {
1124 cAssert(l.IsValid());
1125 return cStr::Compare(l.ToCharPtr(), r) > 0;
1129inline bool operator > (
const cStr& l,
const cStr& r) {
1130 cAssert(l.IsValid());
1131 cAssert(r.IsValid());
1132 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) > 0;
1136inline bool operator >= (
const char* l,
const cStr& r) {
1137 cAssert(r.IsValid());
1138 return cStr::Compare(l, r.ToCharPtr()) >= 0;
1142inline bool operator >= (
const cStr& l,
const char* r) {
1143 cAssert(l.IsValid());
1144 return cStr::Compare(l.ToCharPtr(), r) >= 0;
1148inline bool operator >= (
const cStr& l,
const cStr& r) {
1149 cAssert(l.IsValid());
1150 cAssert(r.IsValid());
1151 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) >= 0;
1155inline bool operator < (
const char* l,
const cStr& r) {
1156 cAssert(r.IsValid());
1157 return cStr::Compare(l, r.ToCharPtr()) < 0;
1161inline bool operator < (
const cStr& l,
const char* r) {
1162 cAssert(l.IsValid());
1163 return cStr::Compare(l.ToCharPtr(), r) < 0;
1167inline bool operator < (
const cStr& l,
const cStr& r) {
1168 cAssert(l.IsValid());
1169 cAssert(r.IsValid());
1170 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) < 0;
1174inline bool operator <= (
const char* l,
const cStr& r) {
1175 cAssert(r.IsValid());
1176 return cStr::Compare(l, r.ToCharPtr()) <= 0;
1180inline bool operator <= (
const cStr& l,
const char* r) {
1181 cAssert(l.IsValid());
1182 return cStr::Compare(l.ToCharPtr(), r) <= 0;
1186inline bool operator <= (
const cStr& l,
const cStr& r) {
1187 cAssert(l.IsValid());
1188 cAssert(r.IsValid());
1189 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) <= 0;
1193inline int cStr::Compare(
const char* l,
const cStr& r,
const int MaxLength) {
1194 cAssert(r.IsValid());
1195 return Compare(l, r.ToCharPtr(), MaxLength);
1199inline int cStr::Compare(
const cStr& l,
const char* r,
const int MaxLength) {
1200 cAssert(l.IsValid());
1201 return Compare(l.ToCharPtr(), r, MaxLength);
1205inline int cStr::Compare(
const cStr& l,
const cStr& r,
const int MaxLength) {
1206 cAssert(l.IsValid());
1207 cAssert(r.IsValid());
1208 return Compare(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1212inline int cStr::CompareNoCase(
const char* l,
const char* r) {
1213 return CompareNoCase(l, r, -1);
1217inline int cStr::CompareNoCase(
const char* l,
const cStr& r) {
1218 cAssert(r.IsValid());
1219 return CompareNoCase(l, r.ToCharPtr());
1223inline int cStr::CompareNoCase(
const cStr& l,
const char* r) {
1224 cAssert(l.IsValid());
1225 return CompareNoCase(l.ToCharPtr(), r);
1229inline int cStr::CompareNoCase(
const cStr& l,
const cStr& r) {
1230 cAssert(l.IsValid());
1231 cAssert(r.IsValid());
1232 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr());
1236inline int cStr::CompareNoCase(
const cStr* l,
const cStr* r) {
1237 cAssert(l !=
nullptr);
1238 cAssert(r !=
nullptr);
1239 cAssert(l->IsValid());
1240 cAssert(r->IsValid());
1241 return CompareNoCase(l->ToCharPtr(), r->ToCharPtr());
1245inline int cStr::CompareNoCase(
const char* l,
const cStr& r,
const int MaxLength) {
1246 cAssert(r.IsValid());
1247 return CompareNoCase(l, r.ToCharPtr(), MaxLength);
1251inline int cStr::CompareNoCase(
const cStr& l,
const char* r,
const int MaxLength) {
1252 cAssert(l.IsValid());
1253 return CompareNoCase(l.ToCharPtr(), r, MaxLength);
1257inline int cStr::CompareNoCase(
const cStr& l,
const cStr& r,
const int MaxLength) {
1258 cAssert(l.IsValid());
1259 cAssert(r.IsValid());
1260 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1268inline bool cStr::EqualsPath(
const char* l,
const char* r) {
1269 return ComparePath(l, r) == 0;
1273inline bool cStr::EqualsPath(
const char* l,
const cStr& r) {
1274 cAssert(r.IsValid());
1275 return ComparePath(l, r.ToCharPtr()) == 0;
1279inline bool cStr::EqualsPath(
const cStr& l,
const char* r) {
1280 cAssert(l.IsValid());
1281 return ComparePath(l.ToCharPtr(), r) == 0;
1285inline bool cStr::EqualsPath(
const cStr& l,
const cStr& r) {
1286 cAssert(l.IsValid());
1287 cAssert(r.IsValid());
1288 return ComparePath(l.ToCharPtr(), r.ToCharPtr()) == 0;
1292inline bool cStr::EqualsPath(
const cStr* l,
const cStr* r) {
1293 cAssert(l !=
nullptr);
1294 cAssert(r !=
nullptr);
1295 cAssert(l->IsValid());
1296 cAssert(r->IsValid());
1297 return ComparePath(l->ToCharPtr(), r->ToCharPtr()) == 0;
1301inline bool cStr::EqualsPath(
const char* l,
const char* r,
const int MaxLength) {
1302 return ComparePath(l, r, MaxLength) == 0;
1306inline bool cStr::EqualsPath(
const char* l,
const cStr& r,
const int MaxLength) {
1307 cAssert(r.IsValid());
1308 return ComparePath(l, r.ToCharPtr(), MaxLength) == 0;
1312inline bool cStr::EqualsPath(
const cStr& l,
const char* r,
const int MaxLength) {
1313 cAssert(l.IsValid());
1314 return ComparePath(l.ToCharPtr(), r, MaxLength) == 0;
1318inline bool cStr::EqualsPath(
const cStr& l,
const cStr& r,
const int MaxLength) {
1319 cAssert(l.IsValid());
1320 cAssert(r.IsValid());
1321 return ComparePath(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1329inline int cStr::ComparePath(
const char* l,
const char* r) {
1330 return ComparePath(l, r, -1);
1334inline int cStr::ComparePath(
const char* l,
const cStr& r) {
1335 cAssert(r.IsValid());
1336 return ComparePath(l, r.ToCharPtr());
1340inline int cStr::ComparePath(
const cStr& l,
const char* r) {
1341 cAssert(l.IsValid());
1342 return ComparePath(l.ToCharPtr(), r);
1346inline int cStr::ComparePath(
const cStr& l,
const cStr& r) {
1347 cAssert(l.IsValid());
1348 cAssert(r.IsValid());
1349 return ComparePath(l.ToCharPtr(), r.ToCharPtr());
1353inline int cStr::ComparePath(
const cStr* l,
const cStr* r) {
1354 cAssert(l !=
nullptr);
1355 cAssert(r !=
nullptr);
1356 cAssert(l->IsValid());
1357 cAssert(r->IsValid());
1358 return ComparePath(l->ToCharPtr(), r->ToCharPtr());
1362inline int cStr::ComparePath(
const char* l,
const cStr& r,
const int MaxLength) {
1363 cAssert(r.IsValid());
1364 return ComparePath(l, r.ToCharPtr(), MaxLength);
1368inline int cStr::ComparePath(
const cStr& l,
const char* r,
const int MaxLength) {
1369 cAssert(l.IsValid());
1370 return ComparePath(l.ToCharPtr(), r, MaxLength);
1374inline int cStr::ComparePath(
const cStr& l,
const cStr& r,
const int MaxLength) {
1375 cAssert(l.IsValid());
1376 cAssert(r.IsValid());
1377 return ComparePath(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1385inline bool cStr::StartsWith(
const char* Str,
const bool NoCase)
const {
1387 cAssert(Str !=
nullptr);
1392 return NoCase ? EqualsNoCase(m_Str, Str, L) : Equals(m_Str, Str, L);
1396inline bool cStr::EndsWith(
const char* Str,
const bool NoCase)
const {
1398 cAssert(Str !=
nullptr);
1407 return NoCase ? EqualsNoCase(&m_Str[m_Length - L], Str) : Equals(&m_Str[m_Length - L], Str);
1415inline const cStr cStr::ToString(
const bool b) {
1416 return b ?
"True" :
"False";
1420inline const cStr cStr::ToString(
const int i) {
1421 return Format(
"%d", i);
1425inline const cStr cStr::ToString(
const int i,
const int Prec) {
1426 return Format(Format(
"%%0%dd", Prec), i);
1430inline const cStr cStr::ToString(
const float f,
const int Prec) {
1431 cStr S = Format(Format(
"%%.%df", Prec), f);
1432 S.Replace(
',',
'.');
1437inline const cStr cStr::ToString(
const double d,
const int Prec) {
1438 cStr S = Format(Format(
"%%.%df", Prec), d);
1439 S.Replace(
',',
'.');
1444inline const cStr cStr::ToHex(
const dword dw) {
1445 return cStr::Format(
"0x%08x", dw);
1449inline const cStr cStr::ToHex(
const qword qw) {
1450 return cStr::Format(
"0x%016llx", qw);
1454inline const cStr cStr::ToHex(
const void* Ptr) {
1455 return cStr::Format(
"%p", Ptr);
1463inline void cStr::Append(
const cStr& Src) {
1464 Append(Src, 0, Src.m_Length);
1468inline void cStr::Append(
const char* Src) {
1469 Append(Src, 0, Length(Src));
1472inline void cStr::Append(
const wchar_t* Src) {
1478inline void cStr::Append(
const char c) {
1483inline void cStr::Append(
const bool b) {
1484 Append(ToString(b));
1488inline void cStr::Append(
const int i) {
1489 Append(ToString(i));
1493inline void cStr::Append(
const float f,
const int Prec) {
1494 Append(ToString(f, Prec));
1498inline void cStr::Append(
const double d,
const int Prec) {
1499 Append(ToString(d, Prec));
1507inline void cStr::operator += (
const cStr& Src) {
1512inline void cStr::operator += (
const char* Src) {
1516inline void cStr::operator += (
const wchar_t* Src) {
1521inline void cStr::operator += (
const char c) {
1526inline void cStr::operator += (
const bool b) {
1531inline void cStr::operator += (
const int i) {
1536inline void cStr::operator += (
const float f) {
1541inline void cStr::operator += (
const double d) {
1550inline cStr& cStr::operator << (
const cStr& Src) {
1556inline cStr& cStr::operator << (
const char* Src) {
1561inline cStr& cStr::operator << (
const wchar_t* Src) {
1567inline cStr& cStr::operator << (
const char c) {
1573inline cStr& cStr::operator << (
const bool b) {
1579inline cStr& cStr::operator << (
const int i) {
1585inline cStr& cStr::operator << (
const float f) {
1591inline cStr& cStr::operator << (
const double d) {
1601inline const cStr operator + (
const cStr& l,
const cStr& r) {
1608inline const cStr operator + (
const cStr& l,
const char* r) {
1615inline const cStr operator + (
const char* l,
const cStr& r) {
1622inline const cStr operator + (
const cStr& l,
const char c) {
1629inline const cStr operator + (
const char c,
const cStr& r) {
1637inline const cStr operator + (
const cStr& l,
const bool b) {
1644inline const cStr operator + (
const bool b,
const cStr& r) {
1652inline const cStr operator + (
const cStr& l,
const int i) {
1659inline const cStr operator + (
const int i,
const cStr& r) {
1667inline const cStr operator + (
const cStr& l,
const float f) {
1674inline const cStr operator + (
const float f,
const cStr& r) {
1682inline const cStr operator + (
const cStr& l,
const double d) {
1689inline const cStr operator + (
const double d,
const cStr& r) {
1696inline const cStr operator + (
const cStr& l,
const wchar_t* r) {
1701inline const cStr operator + (
const wchar_t* l,
const cStr& r) {
1712inline void cStr::Insert(
const int Index,
const cStr& Src) {
1713 Insert(Index, Src, 0, Src.m_Length);
1717inline void cStr::Insert(
const int Index,
const char* Src) {
1718 Insert(Index, Src, 0, Length(Src));
1722inline void cStr::Insert(
const int Index,
const char c) {
1723 Insert(Index, c, 1);
1727inline void cStr::Insert(
const int Index,
const bool b) {
1728 Insert(Index, ToString(b));
1732inline void cStr::Insert(
const int Index,
const int i) {
1733 Insert(Index, ToString(i));
1737inline void cStr::Insert(
const int Index,
const float f,
const int Prec) {
1738 Insert(Index, ToString(f, Prec));
1742inline void cStr::Insert(
const int Index,
const double d,
const int Prec) {
1743 Insert(Index, ToString(d, Prec));
1751inline void cStr::Remove(
const int StartIndex) {
1752 Remove(StartIndex, m_Length - StartIndex);
1756inline void cStr::Remove(
const int StartIndex,
const int Count) {
1758 cAssert(StartIndex >= 0);
1759 cAssert(Count >= 0);
1760 cAssert(StartIndex + Count <= m_Length);
1763 memmove(&m_Str[StartIndex], &m_Str[StartIndex + Count], m_Length - (StartIndex + Count) + 1);
1773inline void cStr::Replace(
const char Char,
const char WithChar) {
1774 Replace(Char, WithChar, 0, m_Length);
1782inline int cStr::Replace(
const char* String,
const char* WithString,
const bool NoCase) {
1783 return Replace(String, WithString, 0, m_Length, NoCase);
1787inline int cStr::Replace(
const char* String,
const char* WithString,
const int StartIndex,
const bool NoCase) {
1788 return Replace(String, WithString, StartIndex, m_Length - StartIndex, NoCase);
1796inline int cStr::ReplaceFirst(
const char* String,
const char* WithString,
const bool NoCase) {
1797 return ReplaceFirst(String, WithString, 0, m_Length, NoCase);
1805inline void cStr::ReplaceAny(
const char* Chars,
const char WithChar) {
1806 ReplaceAny(Chars, WithChar, 0, m_Length);
1814inline const cStr cStr::Substring(
const int StartIndex)
const {
1816 cAssert(StartIndex >= 0);
1817 cAssert(StartIndex <= m_Length);
1818 return cStr(m_Str, StartIndex, m_Length - StartIndex);
1822inline const cStr cStr::Substring(
const int StartIndex,
const int Count)
const {
1824 cAssert(StartIndex >= 0);
1825 cAssert(Count >= 0);
1826 cAssert(StartIndex + Count <= m_Length);
1827 return cStr(m_Str, StartIndex, Count);
1835inline void cStr::TrimStart(
const char* TrimChars) {
1839 while (t.Contains(m_Str[0])) {
1840 memmove(&m_Str[0], &m_Str[1], m_Length);
1847inline void cStr::TrimEnd(
const char* TrimChars) {
1852 for (i = m_Length; i > 0 && t.Contains(m_Str[i - 1]); i--) {
1853 m_Str[i - 1] =
'\0';
1860inline void cStr::Trim(
const char* TrimChars) {
1861 TrimStart(TrimChars);
1870inline void cStr::PadLeft(
const int TotalWidth,
const char PaddingChar) {
1872 cAssert(TotalWidth >= 0);
1874 const char TrimChars[2] = {
1878 TrimStart(TrimChars);
1879 if (TotalWidth > m_Length) {
1880 Insert(0, PaddingChar, TotalWidth - m_Length);
1885inline void cStr::PadRight(
const int TotalWidth,
const char PaddingChar) {
1887 cAssert(TotalWidth >= 0);
1889 const char TrimChars[2] = {
1894 if (TotalWidth > m_Length) {
1895 Append(PaddingChar, TotalWidth - m_Length);
1904inline bool cStr::Contains(
const char c)
const {
1905 return IndexOf(c, 0, m_Length) != -1;
1909inline bool cStr::Contains(
const char* Str,
const bool NoCase)
const {
1910 return IndexOf(Str, 0, m_Length, NoCase) != -1;
1918inline int cStr::IndexOf(
const char c)
const {
1919 return IndexOf(c, 0, m_Length);
1923inline int cStr::IndexOf(
const char* Src,
const char c) {
1924 cAssert(Src !=
nullptr);
1926 if (Src !=
nullptr) {
1928 while (*Src !=
'\0') {
1941inline int cStr::IndexOf(
const char c,
const int StartIndex)
const {
1942 return IndexOf(c, StartIndex, m_Length - StartIndex);
1946inline int cStr::IndexOf(
const char c,
const int StartIndex,
const int Count)
const {
1948 cAssert(StartIndex >= 0);
1949 cAssert(Count >= 0);
1950 cAssert(StartIndex + Count <= m_Length);
1954 i1 = StartIndex + Count - 1;
1955 for (i = StartIndex; i <= i1; i++) {
1956 if (m_Str[i] == c) {
1970inline int cStr::IndexOf(
const char* Str,
const bool NoCase)
const {
1971 return IndexOf(Str, 0, m_Length, NoCase);
1975inline int cStr::IndexOf(
const char* Str,
const int StartIndex,
const bool NoCase)
const {
1976 return IndexOf(Str, StartIndex, m_Length - StartIndex, NoCase);
1980inline int cStr::IndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase)
const {
1982 cAssert(StartIndex >= 0);
1983 cAssert(Count >= 0);
1984 cAssert(StartIndex + Count <= m_Length);
1989 i1 = StartIndex + Count - 1;
1991 for (i = StartIndex; i <= i1; i++) {
1992 if (NoCase ? EqualsNoCase(&m_Str[i], Str, L) : Equals(&m_Str[i], Str, L)) {
2006inline int cStr::IndexOfAny(
const char* Chars)
const {
2007 return IndexOfAny(Chars, 0, m_Length);
2011inline int cStr::IndexOfAny(
const char* Chars,
const int StartIndex)
const {
2012 return IndexOfAny(Chars, StartIndex, m_Length - StartIndex);
2016inline int cStr::IndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const {
2018 cAssert(StartIndex >= 0);
2019 cAssert(Count >= 0);
2020 cAssert(StartIndex + Count <= m_Length);
2026 i1 = StartIndex + Count - 1;
2027 for (i = StartIndex; i <= i1; i++) {
2029 if (t.Contains(c)) {
2043inline int cStr::LastIndexOf(
const char c)
const {
2044 return LastIndexOf(c, m_Length - 1, m_Length);
2048inline int cStr::LastIndexOf(
const char c,
const int StartIndex)
const {
2049 return LastIndexOf(c, StartIndex, StartIndex + 1);
2053inline int cStr::LastIndexOf(
const char c,
const int StartIndex,
const int Count)
const {
2055 cAssert(Count >= 0);
2057 if (m_Length == 0 || m_Str ==
nullptr) {
2058 cAssert(StartIndex >= -1);
2059 cAssert(StartIndex <= 0);
2064 cAssert(StartIndex >= 0);
2065 cAssert(StartIndex < m_Length);
2066 cAssert(Count <= StartIndex + 1);
2070 i0 = StartIndex - Count + 1;
2071 for (i = StartIndex; i >= i0; i--) {
2072 if (c == m_Str[i]) {
2085inline int cStr::LastIndexOf(
const char* Str,
const bool NoCase)
const {
2086 return LastIndexOf(Str, m_Length - 1, m_Length, NoCase);
2090inline int cStr::LastIndexOf(
const char* Str,
const int StartIndex,
const bool NoCase)
const {
2091 return LastIndexOf(Str, StartIndex, StartIndex + 1, NoCase);
2095inline int cStr::LastIndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase)
const {
2097 cAssert(Count >= 0);
2098 if (m_Str ==
nullptr)
return -1;
2104 if (m_Length == 0) {
2105 cAssert(StartIndex >= -1);
2106 cAssert(StartIndex <= 0);
2114 cAssert(StartIndex >= 0);
2115 cAssert(StartIndex < m_Length);
2116 cAssert(Count <= StartIndex + 1);
2118 i0 = StartIndex - Count + 1;
2119 for (i = StartIndex; i >= i0; i--) {
2120 if (NoCase ? EqualsNoCase(&m_Str[i], Str, L) : Equals(&m_Str[i], Str, L)) {
2133inline int cStr::LastIndexOfAny(
const char* Chars)
const {
2134 return LastIndexOfAny(Chars, m_Length - 1, m_Length);
2138inline int cStr::LastIndexOfAny(
const char* Chars,
const int StartIndex)
const {
2139 return LastIndexOfAny(Chars, StartIndex, StartIndex + 1);
2143inline int cStr::LastIndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const {
2145 cAssert(Count >= 0);
2146 if (m_Str ==
nullptr)
return -1;
2147 if (m_Length == 0) {
2148 cAssert(StartIndex >= -1);
2149 cAssert(StartIndex <= 0);
2154 cAssert(StartIndex >= 0);
2155 cAssert(StartIndex < m_Length);
2156 cAssert(Count <= StartIndex + 1);
2162 i0 = StartIndex - Count + 1;
2163 for (i = StartIndex; i >= i0; i--) {
2165 if (t.Contains(c)) {
2179inline char cStr::ToLower(
const char c) {
2180 if (c >=
'A' && c <=
'Z') {
2181 return c + (
'a' -
'A');
2187inline char cStr::ToUpper(
const char c) {
2188 if (c >=
'a' && c <=
'z') {
2189 return c - (
'a' -
'A');
2195inline void cStr::MakeLower(
int start) {
2197 if (m_Str ==
nullptr)
return;
2199 for (i = start; i < m_Length; i++) {
2200 m_Str[i] = ToLower(m_Str[i]);
2205inline void cStr::MakeUpper(
int start) {
2207 if (m_Str ==
nullptr)
return;
2209 for (i = start; i < m_Length; i++) {
2210 m_Str[i] = ToUpper(m_Str[i]);
2215inline const cStr cStr::ToLower()
const {
2222inline const cStr cStr::ToUpper()
const {
2233inline const cStr cStr::Join(
const char* Separator,
const cList<cStr>& Strings) {
2234 return Join(Separator, Strings, 0, Strings.Count());
2242inline void cStr::Split(
cList<cStr>* List,
const char* Delimiters)
const {
2244 cStr::Split(m_Str, List, Delimiters);
2252inline bool cStr::CharIsLower(
const int c) {
2253 return c >=
'a' && c <=
'z';
2257inline bool cStr::CharIsUpper(
const int c) {
2258 return c >=
'A' && c <=
'Z';
2262inline bool cStr::CharIsAlpha(
const int c) {
2263 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z');
2267inline bool cStr::CharIsNumeric(
const int c) {
2268 return c >=
'0' && c <=
'9';
2272inline bool cStr::CharIsHexadecimal(
const int c) {
2273 return (c >=
'0' && c <=
'9') || (c >=
'a' && c <=
'f') || (c >=
'A' && c <=
'F');
2277inline bool cStr::CharIsNewLine(
const int c) {
2278 return c ==
'\n' || c ==
'\r' || c ==
'\v';
2282inline bool cStr::CharIsTab(
const int c) {
2287inline bool cStr::CharIsWhitespace(
const int c) {
2288 return ' ' == c ||
'\t' == c;
2292inline bool cStr::CharIsDecimalPoint(
const int c) {
2293 return '.' == c ||
',' == c;
2297inline bool cStr::CharIsSign(
const int c) {
2298 return '+' == c ||
'-' == c;
2302inline bool cStr::CharIsExponent(
const int c) {
2303 return 'd' == c ||
'D' == c ||
'e' == c ||
'E' == c;
2309inline int cStr::GetHashCode(
const char* Str,
const bool NoCase) {
2310 cAssert(Str !=
nullptr);
2314 for (i = 0; *Str !=
'\0'; i++) {
2315 H += (NoCase ? ToLower(*Str++) : (*Str++)) * (i + 119);
The array template, refer it as coat::list <...> if you are using the Core API.
Definition cList.h:133
static const cStr ToSize(const qword, const bool Pow2=false)
"cStr::ToSize" converts "qword" into short rounded size using Greek prefix