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);
569 void SetFileExtension(
const char* Extension);
570 void SetFileDefaultExtension(
const char* DefaultExtension);
571 void SetFilePath(
const char* Path);
572 void SetFileDefaultPath(
const char* DefaultPath);
574 void EnsureTrailingBackslash();
575 void EnsureTrailingSlash();
576 void EnsureTrailingPlatformSlash() {
577#if defined COMMS_WINDOWS
578 EnsureTrailingBackslash();
580#if defined COMMS_MACOS || defined COMMS_LINUX
581 EnsureTrailingSlash();
584 static const cStr EnsureTrailingPlatformSlash(
const cStr &S) {
586 T.EnsureTrailingPlatformSlash();
590 void SlashesToBackSlashes();
591 void BackSlashesToSlashes();
592 void MakePlatformSlashes() {
593#if defined COMMS_WINDOWS
594 SlashesToBackSlashes();
596#if defined COMMS_MACOS || defined COMMS_LINUX
597 BackSlashesToSlashes();
610 void Decode(
const CodePage::Enum _CodePage,
cList<word>* UniChars)
const;
612 int CalcUTF8Length(
const int StartIndex)
const;
617 cStr(const ::std::wstring& Src);
618 cStr(
const std::string& Src);
619 void Copy(const ::std::wstring&);
620 void Copy(const ::std::string&);
621 void operator = (const ::std::wstring&);
622 void operator = (const ::std::string&);
623 void toWstring(::std::wstring& ws);
624 std::wstring toWstring();
625 void Append(
const std::string&);
626 void Append(
const std::wstring&);
627 void operator += (
const std::string&);
628 void operator += (
const std::wstring&);
629 cStr& operator << (
const std::string&);
630 cStr& operator << (
const std::wstring&);
631 friend const cStr operator + (
const cStr&,
const std::wstring&);
632 friend const cStr operator + (
const std::wstring&,
const cStr&);
633 friend const cStr operator + (
const cStr&,
const std::string&);
634 friend const cStr operator + (
const std::string&,
const cStr&);
638 int m_Length, m_Capacity;
643 BaseBufferLength = 32,
649 bool IsValid()
const;
651 void EnsureCapacity(
const int MinCapacity,
const bool KeepOld =
true);
652 void Resize(
const int MinCapacity,
const bool KeepOld);
653 static char* getstr();
654 static void freestr(
char* s);
658inline bool cStr::IsValid()
const {
667inline void cStr::Init() {
676inline void cStr::Free() {
680 if (m_Capacity > Param::BaseBufferLength) {
681 cPool::Free((
byte*)m_Str, m_Capacity);
683 else if (m_Str)freestr(m_Str);
688inline void cStr::EnsureCapacity(
const int MinCapacity,
const bool KeepOld) {
689 if (MinCapacity > m_Capacity) {
690 Resize(MinCapacity, KeepOld);
704inline cStr::cStr(
const cStr& Src) {
710inline cStr::cStr(
const cStr& Src,
const int StartIndex,
const int Count) {
712 Copy(Src, StartIndex, Count);
716inline cStr::cStr(
const char* Src) {
721inline cStr::cStr(
const wchar_t* Src) {
727inline cStr::cStr(
const char* Src,
const int StartIndex,
const int Count) {
729 Copy(Src, StartIndex, Count);
733inline cStr::cStr(
const int Length,
const char Fill) {
735 SetLength(Length, Fill);
743inline cStr::~cStr() {
752inline void cStr::Copy(
const cStr& Src) {
753 cAssert(Src.IsValid());
754 Copy(Src.m_Str, 0, Src.m_Length);
758inline void cStr::Copy(
const cStr& Src,
const int StartIndex,
const int Count) {
759 cAssert(Src.IsValid());
760 Copy(Src.m_Str, StartIndex, Count);
764inline void cStr::Copy(
const char* Src) {
765 Copy(Src, 0, Length(Src));
769inline void cStr::operator = (
const cStr& Src) {
774inline void cStr::operator = (
const char* Src) {
778inline void cStr::operator=(
int x) {
790inline const char* cStr::ToCharPtr()
const {
792 return m_Str ? m_Str : &def_str;
796inline char* cStr::ToNonConstCharPtr() {
797 return (
this && m_Str) ? m_Str : &def_str;
801inline cStr::operator
const char* ()
const {
802 return (
this && m_Str) ? m_Str : &def_str;
815inline char cStr::operator [] (
const int CharIndex)
const {
817 cAssert(CharIndex >= 0);
818 cAssert(CharIndex <= m_Length);
819 return m_Str ? m_Str[CharIndex] : 0;
823inline char& cStr::operator [] (
const int CharIndex) {
825 cAssert(CharIndex >= 0);
826 cAssert(CharIndex <= m_Length);
827 return m_Str ? m_Str[CharIndex] : def_str;
835inline int cStr::Length()
const {
841inline int cStr::Length(
const char* Str) {
842 if (Str ==
nullptr) {
848 for (l = 0; Str[l] !=
'\0'; l++) {
858inline void cStr::SetLength(
const int Length,
const char Fill) {
860 cAssert(Length >= 0);
868 EnsureCapacity(Length + 1);
869 for (i = 0; i < Length; i++) {
873 m_Str[Length] =
'\0';
879inline void cStr::CalcLength() {
880 m_Length = Length(m_Str);
885inline void cStr::Fill(
const char c) {
890 for (i = 0; i < m_Length; i++) {
900inline bool cStr::IsEmpty()
const {
901 return Equals(m_Str,
"");
904inline bool cStr::empty()
const {
905 return Length() == 0;
909inline void cStr::Clear() {
911 EnsureCapacity(1,
false);
923inline bool cStr::Equals(
const char* l,
const char* r) {
924 return Compare(l, r) == 0;
928inline bool cStr::Equals(
const char* l,
const cStr& r) {
929 cAssert(r.IsValid());
930 return Compare(l, r.ToCharPtr()) == 0;
934inline bool cStr::Equals(
const cStr& l,
const char* r) {
935 cAssert(l.IsValid());
936 return Compare(l.ToCharPtr(), r) == 0;
940inline bool cStr::Equals(
const cStr& l,
const cStr& r) {
941 cAssert(l.IsValid());
942 cAssert(r.IsValid());
943 return Compare(l.ToCharPtr(), r.ToCharPtr()) == 0;
947inline bool cStr::Equals(
const cStr* l,
const cStr* r) {
948 cAssert(l !=
nullptr);
949 cAssert(r !=
nullptr);
950 cAssert(l->IsValid());
951 cAssert(r->IsValid());
952 return Compare(l->ToCharPtr(), r->ToCharPtr()) == 0;
955inline bool cStr::Equals(
const char* r)
const {
956 return cStr::Compare(ToCharPtr(), r) == 0;
960inline bool operator == (
const char* l,
const cStr& r) {
961 cAssert(r.IsValid());
962 return cStr::Compare(l, r.ToCharPtr()) == 0;
966inline bool operator == (
const cStr& l,
const char* r) {
967 cAssert(l.IsValid());
968 return cStr::Compare(l.ToCharPtr(), r) == 0;
972inline bool operator == (
const cStr& l,
const cStr& r) {
973 cAssert(l.IsValid());
974 cAssert(r.IsValid());
975 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) == 0;
979inline bool operator != (
const char* l,
const cStr& r) {
980 cAssert(r.IsValid());
981 return cStr::Compare(l, r.ToCharPtr()) != 0;
985inline bool operator != (
const cStr& l,
const char* r) {
986 cAssert(l.IsValid());
987 return cStr::Compare(l.ToCharPtr(), r) != 0;
991inline bool operator != (
const cStr& l,
const cStr& r) {
992 cAssert(l.IsValid());
993 cAssert(r.IsValid());
994 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) != 0;
998inline bool cStr::Equals(
const char* l,
const char* r,
const int MaxLength) {
999 return Compare(l, r, MaxLength) == 0;
1003inline bool cStr::Equals(
const char* l,
const cStr& r,
const int MaxLength) {
1004 cAssert(r.IsValid());
1005 return Compare(l, r.ToCharPtr(), MaxLength) == 0;
1009inline bool cStr::Equals(
const cStr& l,
const char* r,
const int MaxLength) {
1010 cAssert(l.IsValid());
1011 return Compare(l.ToCharPtr(), r, MaxLength) == 0;
1015inline bool cStr::Equals(
const cStr& l,
const cStr& r,
const int MaxLength) {
1016 cAssert(l.IsValid());
1017 cAssert(r.IsValid());
1018 return Compare(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1022inline bool cStr::EqualsNoCase(
const char* l,
const char* r) {
1023 return CompareNoCase(l, r) == 0;
1027inline bool cStr::EqualsNoCase(
const char* l,
const cStr& r) {
1028 cAssert(r.IsValid());
1029 return CompareNoCase(l, r.ToCharPtr()) == 0;
1033inline bool cStr::EqualsNoCase(
const cStr& l,
const char* r) {
1034 cAssert(l.IsValid());
1035 return CompareNoCase(l.ToCharPtr(), r) == 0;
1039inline bool cStr::EqualsNoCase(
const cStr& l,
const cStr& r) {
1040 cAssert(l.IsValid());
1041 cAssert(r.IsValid());
1042 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr()) == 0;
1046inline bool cStr::EqualsNoCase(
const cStr* l,
const cStr* r) {
1047 cAssert(l !=
nullptr);
1048 cAssert(r !=
nullptr);
1049 cAssert(l->IsValid());
1050 cAssert(r->IsValid());
1051 return CompareNoCase(l->ToCharPtr(), r->ToCharPtr()) == 0;
1055inline bool cStr::EqualsNoCase(
const char* l,
const char* r,
const int MaxLength) {
1056 return CompareNoCase(l, r, MaxLength) == 0;
1060inline bool cStr::EqualsNoCase(
const char* l,
const cStr& r,
const int MaxLength) {
1061 cAssert(r.IsValid());
1062 return CompareNoCase(l, r.ToCharPtr(), MaxLength) == 0;
1066inline bool cStr::EqualsNoCase(
const cStr& l,
const char* r,
const int MaxLength) {
1067 cAssert(l.IsValid());
1068 return CompareNoCase(l.ToCharPtr(), r, MaxLength) == 0;
1072inline bool cStr::EqualsNoCase(
const cStr& l,
const cStr& r,
const int MaxLength) {
1073 cAssert(l.IsValid());
1074 cAssert(r.IsValid());
1075 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1083inline int cStr::Compare(
const char* l,
const char* r) {
1084 return Compare(l, r, -1);
1088inline int cStr::Compare(
const char* l,
const cStr& r) {
1089 cAssert(r.IsValid());
1090 return Compare(l, r.ToCharPtr());
1094inline int cStr::Compare(
const cStr& l,
const char* r) {
1095 cAssert(l.IsValid());
1096 return Compare(l.ToCharPtr(), r);
1100inline int cStr::Compare(
const cStr& l,
const cStr& r) {
1101 cAssert(l.IsValid());
1102 cAssert(r.IsValid());
1103 return Compare(l.ToCharPtr(), r.ToCharPtr());
1107inline int cStr::Compare(
const cStr* l,
const cStr* r) {
1108 cAssert(l !=
nullptr);
1109 cAssert(r !=
nullptr);
1110 cAssert(l->IsValid());
1111 cAssert(r->IsValid());
1112 return Compare(l->ToCharPtr(), r->ToCharPtr());
1116inline bool operator > (
const char* l,
const cStr& r) {
1117 cAssert(r.IsValid());
1118 return cStr::Compare(l, r.ToCharPtr()) > 0;
1122inline bool operator > (
const cStr& l,
const char* r) {
1123 cAssert(l.IsValid());
1124 return cStr::Compare(l.ToCharPtr(), r) > 0;
1128inline bool operator > (
const cStr& l,
const cStr& r) {
1129 cAssert(l.IsValid());
1130 cAssert(r.IsValid());
1131 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) > 0;
1135inline bool operator >= (
const char* l,
const cStr& r) {
1136 cAssert(r.IsValid());
1137 return cStr::Compare(l, r.ToCharPtr()) >= 0;
1141inline bool operator >= (
const cStr& l,
const char* r) {
1142 cAssert(l.IsValid());
1143 return cStr::Compare(l.ToCharPtr(), r) >= 0;
1147inline bool operator >= (
const cStr& l,
const cStr& r) {
1148 cAssert(l.IsValid());
1149 cAssert(r.IsValid());
1150 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) >= 0;
1154inline bool operator < (
const char* l,
const cStr& r) {
1155 cAssert(r.IsValid());
1156 return cStr::Compare(l, r.ToCharPtr()) < 0;
1160inline bool operator < (
const cStr& l,
const char* r) {
1161 cAssert(l.IsValid());
1162 return cStr::Compare(l.ToCharPtr(), r) < 0;
1166inline bool operator < (
const cStr& l,
const cStr& r) {
1167 cAssert(l.IsValid());
1168 cAssert(r.IsValid());
1169 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) < 0;
1173inline bool operator <= (
const char* l,
const cStr& r) {
1174 cAssert(r.IsValid());
1175 return cStr::Compare(l, r.ToCharPtr()) <= 0;
1179inline bool operator <= (
const cStr& l,
const char* r) {
1180 cAssert(l.IsValid());
1181 return cStr::Compare(l.ToCharPtr(), r) <= 0;
1185inline bool operator <= (
const cStr& l,
const cStr& r) {
1186 cAssert(l.IsValid());
1187 cAssert(r.IsValid());
1188 return cStr::Compare(l.ToCharPtr(), r.ToCharPtr()) <= 0;
1192inline int cStr::Compare(
const char* l,
const cStr& r,
const int MaxLength) {
1193 cAssert(r.IsValid());
1194 return Compare(l, r.ToCharPtr(), MaxLength);
1198inline int cStr::Compare(
const cStr& l,
const char* r,
const int MaxLength) {
1199 cAssert(l.IsValid());
1200 return Compare(l.ToCharPtr(), r, MaxLength);
1204inline int cStr::Compare(
const cStr& l,
const cStr& r,
const int MaxLength) {
1205 cAssert(l.IsValid());
1206 cAssert(r.IsValid());
1207 return Compare(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1211inline int cStr::CompareNoCase(
const char* l,
const char* r) {
1212 return CompareNoCase(l, r, -1);
1216inline int cStr::CompareNoCase(
const char* l,
const cStr& r) {
1217 cAssert(r.IsValid());
1218 return CompareNoCase(l, r.ToCharPtr());
1222inline int cStr::CompareNoCase(
const cStr& l,
const char* r) {
1223 cAssert(l.IsValid());
1224 return CompareNoCase(l.ToCharPtr(), r);
1228inline int cStr::CompareNoCase(
const cStr& l,
const cStr& r) {
1229 cAssert(l.IsValid());
1230 cAssert(r.IsValid());
1231 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr());
1235inline int cStr::CompareNoCase(
const cStr* l,
const cStr* r) {
1236 cAssert(l !=
nullptr);
1237 cAssert(r !=
nullptr);
1238 cAssert(l->IsValid());
1239 cAssert(r->IsValid());
1240 return CompareNoCase(l->ToCharPtr(), r->ToCharPtr());
1244inline int cStr::CompareNoCase(
const char* l,
const cStr& r,
const int MaxLength) {
1245 cAssert(r.IsValid());
1246 return CompareNoCase(l, r.ToCharPtr(), MaxLength);
1250inline int cStr::CompareNoCase(
const cStr& l,
const char* r,
const int MaxLength) {
1251 cAssert(l.IsValid());
1252 return CompareNoCase(l.ToCharPtr(), r, MaxLength);
1256inline int cStr::CompareNoCase(
const cStr& l,
const cStr& r,
const int MaxLength) {
1257 cAssert(l.IsValid());
1258 cAssert(r.IsValid());
1259 return CompareNoCase(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1267inline bool cStr::EqualsPath(
const char* l,
const char* r) {
1268 return ComparePath(l, r) == 0;
1272inline bool cStr::EqualsPath(
const char* l,
const cStr& r) {
1273 cAssert(r.IsValid());
1274 return ComparePath(l, r.ToCharPtr()) == 0;
1278inline bool cStr::EqualsPath(
const cStr& l,
const char* r) {
1279 cAssert(l.IsValid());
1280 return ComparePath(l.ToCharPtr(), r) == 0;
1284inline bool cStr::EqualsPath(
const cStr& l,
const cStr& r) {
1285 cAssert(l.IsValid());
1286 cAssert(r.IsValid());
1287 return ComparePath(l.ToCharPtr(), r.ToCharPtr()) == 0;
1291inline bool cStr::EqualsPath(
const cStr* l,
const cStr* r) {
1292 cAssert(l !=
nullptr);
1293 cAssert(r !=
nullptr);
1294 cAssert(l->IsValid());
1295 cAssert(r->IsValid());
1296 return ComparePath(l->ToCharPtr(), r->ToCharPtr()) == 0;
1300inline bool cStr::EqualsPath(
const char* l,
const char* r,
const int MaxLength) {
1301 return ComparePath(l, r, MaxLength) == 0;
1305inline bool cStr::EqualsPath(
const char* l,
const cStr& r,
const int MaxLength) {
1306 cAssert(r.IsValid());
1307 return ComparePath(l, r.ToCharPtr(), MaxLength) == 0;
1311inline bool cStr::EqualsPath(
const cStr& l,
const char* r,
const int MaxLength) {
1312 cAssert(l.IsValid());
1313 return ComparePath(l.ToCharPtr(), r, MaxLength) == 0;
1317inline bool cStr::EqualsPath(
const cStr& l,
const cStr& r,
const int MaxLength) {
1318 cAssert(l.IsValid());
1319 cAssert(r.IsValid());
1320 return ComparePath(l.ToCharPtr(), r.ToCharPtr(), MaxLength) == 0;
1328inline int cStr::ComparePath(
const char* l,
const char* r) {
1329 return ComparePath(l, r, -1);
1333inline int cStr::ComparePath(
const char* l,
const cStr& r) {
1334 cAssert(r.IsValid());
1335 return ComparePath(l, r.ToCharPtr());
1339inline int cStr::ComparePath(
const cStr& l,
const char* r) {
1340 cAssert(l.IsValid());
1341 return ComparePath(l.ToCharPtr(), r);
1345inline int cStr::ComparePath(
const cStr& l,
const cStr& r) {
1346 cAssert(l.IsValid());
1347 cAssert(r.IsValid());
1348 return ComparePath(l.ToCharPtr(), r.ToCharPtr());
1352inline int cStr::ComparePath(
const cStr* l,
const cStr* r) {
1353 cAssert(l !=
nullptr);
1354 cAssert(r !=
nullptr);
1355 cAssert(l->IsValid());
1356 cAssert(r->IsValid());
1357 return ComparePath(l->ToCharPtr(), r->ToCharPtr());
1361inline int cStr::ComparePath(
const char* l,
const cStr& r,
const int MaxLength) {
1362 cAssert(r.IsValid());
1363 return ComparePath(l, r.ToCharPtr(), MaxLength);
1367inline int cStr::ComparePath(
const cStr& l,
const char* r,
const int MaxLength) {
1368 cAssert(l.IsValid());
1369 return ComparePath(l.ToCharPtr(), r, MaxLength);
1373inline int cStr::ComparePath(
const cStr& l,
const cStr& r,
const int MaxLength) {
1374 cAssert(l.IsValid());
1375 cAssert(r.IsValid());
1376 return ComparePath(l.ToCharPtr(), r.ToCharPtr(), MaxLength);
1384inline bool cStr::StartsWith(
const char* Str,
const bool NoCase)
const {
1386 cAssert(Str !=
nullptr);
1391 return NoCase ? EqualsNoCase(m_Str, Str, L) : Equals(m_Str, Str, L);
1395inline bool cStr::EndsWith(
const char* Str,
const bool NoCase)
const {
1397 cAssert(Str !=
nullptr);
1406 return NoCase ? EqualsNoCase(&m_Str[m_Length - L], Str) : Equals(&m_Str[m_Length - L], Str);
1414inline const cStr cStr::ToString(
const bool b) {
1415 return b ?
"True" :
"False";
1419inline const cStr cStr::ToString(
const int i) {
1420 return Format(
"%d", i);
1424inline const cStr cStr::ToString(
const int i,
const int Prec) {
1425 return Format(Format(
"%%0%dd", Prec), i);
1429inline const cStr cStr::ToString(
const float f,
const int Prec) {
1430 cStr S = Format(Format(
"%%.%df", Prec), f);
1431 S.Replace(
',',
'.');
1436inline const cStr cStr::ToString(
const double d,
const int Prec) {
1437 cStr S = Format(Format(
"%%.%df", Prec), d);
1438 S.Replace(
',',
'.');
1443inline const cStr cStr::ToHex(
const dword dw) {
1444 return cStr::Format(
"0x%08x", dw);
1448inline const cStr cStr::ToHex(
const qword qw) {
1449 return cStr::Format(
"0x%016llx", qw);
1453inline const cStr cStr::ToHex(
const void* Ptr) {
1454 return cStr::Format(
"%p", Ptr);
1462inline void cStr::Append(
const cStr& Src) {
1463 Append(Src, 0, Src.m_Length);
1467inline void cStr::Append(
const char* Src) {
1468 Append(Src, 0, Length(Src));
1471inline void cStr::Append(
const wchar_t* Src) {
1477inline void cStr::Append(
const char c) {
1482inline void cStr::Append(
const bool b) {
1483 Append(ToString(b));
1487inline void cStr::Append(
const int i) {
1488 Append(ToString(i));
1492inline void cStr::Append(
const float f,
const int Prec) {
1493 Append(ToString(f, Prec));
1497inline void cStr::Append(
const double d,
const int Prec) {
1498 Append(ToString(d, Prec));
1506inline void cStr::operator += (
const cStr& Src) {
1511inline void cStr::operator += (
const char* Src) {
1515inline void cStr::operator += (
const wchar_t* Src) {
1520inline void cStr::operator += (
const char c) {
1525inline void cStr::operator += (
const bool b) {
1530inline void cStr::operator += (
const int i) {
1535inline void cStr::operator += (
const float f) {
1540inline void cStr::operator += (
const double d) {
1549inline cStr& cStr::operator << (
const cStr& Src) {
1555inline cStr& cStr::operator << (
const char* Src) {
1560inline cStr& cStr::operator << (
const wchar_t* Src) {
1566inline cStr& cStr::operator << (
const char c) {
1572inline cStr& cStr::operator << (
const bool b) {
1578inline cStr& cStr::operator << (
const int i) {
1584inline cStr& cStr::operator << (
const float f) {
1590inline cStr& cStr::operator << (
const double d) {
1600inline const cStr operator + (
const cStr& l,
const cStr& r) {
1607inline const cStr operator + (
const cStr& l,
const char* r) {
1614inline const cStr operator + (
const char* l,
const cStr& r) {
1621inline const cStr operator + (
const cStr& l,
const char c) {
1628inline const cStr operator + (
const char c,
const cStr& r) {
1636inline const cStr operator + (
const cStr& l,
const bool b) {
1643inline const cStr operator + (
const bool b,
const cStr& r) {
1651inline const cStr operator + (
const cStr& l,
const int i) {
1658inline const cStr operator + (
const int i,
const cStr& r) {
1666inline const cStr operator + (
const cStr& l,
const float f) {
1673inline const cStr operator + (
const float f,
const cStr& r) {
1681inline const cStr operator + (
const cStr& l,
const double d) {
1688inline const cStr operator + (
const double d,
const cStr& r) {
1695inline const cStr operator + (
const cStr& l,
const wchar_t* r) {
1700inline const cStr operator + (
const wchar_t* l,
const cStr& r) {
1711inline void cStr::Insert(
const int Index,
const cStr& Src) {
1712 Insert(Index, Src, 0, Src.m_Length);
1716inline void cStr::Insert(
const int Index,
const char* Src) {
1717 Insert(Index, Src, 0, Length(Src));
1721inline void cStr::Insert(
const int Index,
const char c) {
1722 Insert(Index, c, 1);
1726inline void cStr::Insert(
const int Index,
const bool b) {
1727 Insert(Index, ToString(b));
1731inline void cStr::Insert(
const int Index,
const int i) {
1732 Insert(Index, ToString(i));
1736inline void cStr::Insert(
const int Index,
const float f,
const int Prec) {
1737 Insert(Index, ToString(f, Prec));
1741inline void cStr::Insert(
const int Index,
const double d,
const int Prec) {
1742 Insert(Index, ToString(d, Prec));
1750inline void cStr::Remove(
const int StartIndex) {
1751 Remove(StartIndex, m_Length - StartIndex);
1755inline void cStr::Remove(
const int StartIndex,
const int Count) {
1757 cAssert(StartIndex >= 0);
1758 cAssert(Count >= 0);
1759 cAssert(StartIndex + Count <= m_Length);
1762 memmove(&m_Str[StartIndex], &m_Str[StartIndex + Count], m_Length - (StartIndex + Count) + 1);
1772inline void cStr::Replace(
const char Char,
const char WithChar) {
1773 Replace(Char, WithChar, 0, m_Length);
1781inline int cStr::Replace(
const char* String,
const char* WithString,
const bool NoCase) {
1782 return Replace(String, WithString, 0, m_Length, NoCase);
1786inline int cStr::Replace(
const char* String,
const char* WithString,
const int StartIndex,
const bool NoCase) {
1787 return Replace(String, WithString, StartIndex, m_Length - StartIndex, NoCase);
1795inline int cStr::ReplaceFirst(
const char* String,
const char* WithString,
const bool NoCase) {
1796 return ReplaceFirst(String, WithString, 0, m_Length, NoCase);
1804inline void cStr::ReplaceAny(
const char* Chars,
const char WithChar) {
1805 ReplaceAny(Chars, WithChar, 0, m_Length);
1813inline const cStr cStr::Substring(
const int StartIndex)
const {
1815 cAssert(StartIndex >= 0);
1816 cAssert(StartIndex <= m_Length);
1817 return cStr(m_Str, StartIndex, m_Length - StartIndex);
1821inline const cStr cStr::Substring(
const int StartIndex,
const int Count)
const {
1823 cAssert(StartIndex >= 0);
1824 cAssert(Count >= 0);
1825 cAssert(StartIndex + Count <= m_Length);
1826 return cStr(m_Str, StartIndex, Count);
1834inline void cStr::TrimStart(
const char* TrimChars) {
1838 while (t.Contains(m_Str[0])) {
1839 memmove(&m_Str[0], &m_Str[1], m_Length);
1846inline void cStr::TrimEnd(
const char* TrimChars) {
1851 for (i = m_Length; i > 0 && t.Contains(m_Str[i - 1]); i--) {
1852 m_Str[i - 1] =
'\0';
1859inline void cStr::Trim(
const char* TrimChars) {
1860 TrimStart(TrimChars);
1869inline void cStr::PadLeft(
const int TotalWidth,
const char PaddingChar) {
1871 cAssert(TotalWidth >= 0);
1873 const char TrimChars[2] = {
1877 TrimStart(TrimChars);
1878 if (TotalWidth > m_Length) {
1879 Insert(0, PaddingChar, TotalWidth - m_Length);
1884inline void cStr::PadRight(
const int TotalWidth,
const char PaddingChar) {
1886 cAssert(TotalWidth >= 0);
1888 const char TrimChars[2] = {
1893 if (TotalWidth > m_Length) {
1894 Append(PaddingChar, TotalWidth - m_Length);
1903inline bool cStr::Contains(
const char c)
const {
1904 return IndexOf(c, 0, m_Length) != -1;
1908inline bool cStr::Contains(
const char* Str,
const bool NoCase)
const {
1909 return IndexOf(Str, 0, m_Length, NoCase) != -1;
1917inline int cStr::IndexOf(
const char c)
const {
1918 return IndexOf(c, 0, m_Length);
1922inline int cStr::IndexOf(
const char* Src,
const char c) {
1923 cAssert(Src !=
nullptr);
1925 if (Src !=
nullptr) {
1927 while (*Src !=
'\0') {
1940inline int cStr::IndexOf(
const char c,
const int StartIndex)
const {
1941 return IndexOf(c, StartIndex, m_Length - StartIndex);
1945inline int cStr::IndexOf(
const char c,
const int StartIndex,
const int Count)
const {
1947 cAssert(StartIndex >= 0);
1948 cAssert(Count >= 0);
1949 cAssert(StartIndex + Count <= m_Length);
1953 i1 = StartIndex + Count - 1;
1954 for (i = StartIndex; i <= i1; i++) {
1955 if (m_Str[i] == c) {
1969inline int cStr::IndexOf(
const char* Str,
const bool NoCase)
const {
1970 return IndexOf(Str, 0, m_Length, NoCase);
1974inline int cStr::IndexOf(
const char* Str,
const int StartIndex,
const bool NoCase)
const {
1975 return IndexOf(Str, StartIndex, m_Length - StartIndex, NoCase);
1979inline int cStr::IndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase)
const {
1981 cAssert(StartIndex >= 0);
1982 cAssert(Count >= 0);
1983 cAssert(StartIndex + Count <= m_Length);
1988 i1 = StartIndex + Count - 1;
1990 for (i = StartIndex; i <= i1; i++) {
1991 if (NoCase ? EqualsNoCase(&m_Str[i], Str, L) : Equals(&m_Str[i], Str, L)) {
2005inline int cStr::IndexOfAny(
const char* Chars)
const {
2006 return IndexOfAny(Chars, 0, m_Length);
2010inline int cStr::IndexOfAny(
const char* Chars,
const int StartIndex)
const {
2011 return IndexOfAny(Chars, StartIndex, m_Length - StartIndex);
2015inline int cStr::IndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const {
2017 cAssert(StartIndex >= 0);
2018 cAssert(Count >= 0);
2019 cAssert(StartIndex + Count <= m_Length);
2025 i1 = StartIndex + Count - 1;
2026 for (i = StartIndex; i <= i1; i++) {
2028 if (t.Contains(c)) {
2042inline int cStr::LastIndexOf(
const char c)
const {
2043 return LastIndexOf(c, m_Length - 1, m_Length);
2047inline int cStr::LastIndexOf(
const char c,
const int StartIndex)
const {
2048 return LastIndexOf(c, StartIndex, StartIndex + 1);
2052inline int cStr::LastIndexOf(
const char c,
const int StartIndex,
const int Count)
const {
2054 cAssert(Count >= 0);
2056 if (m_Length == 0 || m_Str ==
nullptr) {
2057 cAssert(StartIndex >= -1);
2058 cAssert(StartIndex <= 0);
2063 cAssert(StartIndex >= 0);
2064 cAssert(StartIndex < m_Length);
2065 cAssert(Count <= StartIndex + 1);
2069 i0 = StartIndex - Count + 1;
2070 for (i = StartIndex; i >= i0; i--) {
2071 if (c == m_Str[i]) {
2084inline int cStr::LastIndexOf(
const char* Str,
const bool NoCase)
const {
2085 return LastIndexOf(Str, m_Length - 1, m_Length, NoCase);
2089inline int cStr::LastIndexOf(
const char* Str,
const int StartIndex,
const bool NoCase)
const {
2090 return LastIndexOf(Str, StartIndex, StartIndex + 1, NoCase);
2094inline int cStr::LastIndexOf(
const char* Str,
const int StartIndex,
const int Count,
const bool NoCase)
const {
2096 cAssert(Count >= 0);
2097 if (m_Str ==
nullptr)
return -1;
2103 if (m_Length == 0) {
2104 cAssert(StartIndex >= -1);
2105 cAssert(StartIndex <= 0);
2113 cAssert(StartIndex >= 0);
2114 cAssert(StartIndex < m_Length);
2115 cAssert(Count <= StartIndex + 1);
2117 i0 = StartIndex - Count + 1;
2118 for (i = StartIndex; i >= i0; i--) {
2119 if (NoCase ? EqualsNoCase(&m_Str[i], Str, L) : Equals(&m_Str[i], Str, L)) {
2132inline int cStr::LastIndexOfAny(
const char* Chars)
const {
2133 return LastIndexOfAny(Chars, m_Length - 1, m_Length);
2137inline int cStr::LastIndexOfAny(
const char* Chars,
const int StartIndex)
const {
2138 return LastIndexOfAny(Chars, StartIndex, StartIndex + 1);
2142inline int cStr::LastIndexOfAny(
const char* Chars,
const int StartIndex,
const int Count)
const {
2144 cAssert(Count >= 0);
2145 if (m_Str ==
nullptr)
return -1;
2146 if (m_Length == 0) {
2147 cAssert(StartIndex >= -1);
2148 cAssert(StartIndex <= 0);
2153 cAssert(StartIndex >= 0);
2154 cAssert(StartIndex < m_Length);
2155 cAssert(Count <= StartIndex + 1);
2161 i0 = StartIndex - Count + 1;
2162 for (i = StartIndex; i >= i0; i--) {
2164 if (t.Contains(c)) {
2178inline char cStr::ToLower(
const char c) {
2179 if (c >=
'A' && c <=
'Z') {
2180 return c + (
'a' -
'A');
2186inline char cStr::ToUpper(
const char c) {
2187 if (c >=
'a' && c <=
'z') {
2188 return c - (
'a' -
'A');
2194inline void cStr::MakeLower(
int start) {
2196 if (m_Str ==
nullptr)
return;
2198 for (i = start; i < m_Length; i++) {
2199 m_Str[i] = ToLower(m_Str[i]);
2204inline void cStr::MakeUpper(
int start) {
2206 if (m_Str ==
nullptr)
return;
2208 for (i = start; i < m_Length; i++) {
2209 m_Str[i] = ToUpper(m_Str[i]);
2214inline const cStr cStr::ToLower()
const {
2221inline const cStr cStr::ToUpper()
const {
2232inline const cStr cStr::Join(
const char* Separator,
const cList<cStr>& Strings) {
2233 return Join(Separator, Strings, 0, Strings.Count());
2241inline void cStr::Split(
cList<cStr>* List,
const char* Delimiters)
const {
2243 cStr::Split(m_Str, List, Delimiters);
2251inline bool cStr::CharIsLower(
const int c) {
2252 return c >=
'a' && c <=
'z';
2256inline bool cStr::CharIsUpper(
const int c) {
2257 return c >=
'A' && c <=
'Z';
2261inline bool cStr::CharIsAlpha(
const int c) {
2262 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z');
2266inline bool cStr::CharIsNumeric(
const int c) {
2267 return c >=
'0' && c <=
'9';
2271inline bool cStr::CharIsHexadecimal(
const int c) {
2272 return (c >=
'0' && c <=
'9') || (c >=
'a' && c <=
'f') || (c >=
'A' && c <=
'F');
2276inline bool cStr::CharIsNewLine(
const int c) {
2277 return c ==
'\n' || c ==
'\r' || c ==
'\v';
2281inline bool cStr::CharIsTab(
const int c) {
2286inline bool cStr::CharIsWhitespace(
const int c) {
2287 return ' ' == c ||
'\t' == c;
2291inline bool cStr::CharIsDecimalPoint(
const int c) {
2292 return '.' == c ||
',' == c;
2296inline bool cStr::CharIsSign(
const int c) {
2297 return '+' == c ||
'-' == c;
2301inline bool cStr::CharIsExponent(
const int c) {
2302 return 'd' == c ||
'D' == c ||
'e' == c ||
'E' == c;
2308inline int cStr::GetHashCode(
const char* Str,
const bool NoCase) {
2309 cAssert(Str !=
nullptr);
2313 for (i = 0; *Str !=
'\0'; i++) {
2314 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