37 #define UNIDOUBLER_HEADER "CStr.h"
45#if defined(IN_UNIDOUBLER) && ( (defined(_UNICODE) && !defined(CSTR_H_U)) || (!defined(_UNICODE) && !defined(CSTR_H_A)) )
64 using Char =
typename std::tstring::value_type;
66 CStr(
const StrBase& str) : StrBase(str) {}
68 using StrBase::StrBase;
77 static CStr Repeat(
const CStr& str,
size_t reps);
84 explicit CStr(
const std::u16string& str) : StrBase(str.begin(), str.end()) {}
92 CStrW FromUTF8()
const;
97 static CStr FromInt(
int n);
98 static CStr FromUInt(
unsigned int n);
99 static CStr FromInt64(
i64 n);
100 static CStr FromDouble(
double n);
115 unsigned int ToUInt()
const;
129 unsigned long ToULong()
const;
136 float ToFloat()
const;
143 double ToDouble()
const;
153 long Find(
const CStr& str)
const;
162 long Find(
const Char chr)
const;
172 long Find(
const int start,
const Char chr)
const;
182 long FindInsensitive(
const CStr& str)
const;
191 long FindInsensitive(
const Char chr)
const;
201 long FindInsensitive(
const int start,
const Char chr)
const;
211 long ReverseFind(
const CStr& str)
const;
218 CStr LowerCase()
const;
224 CStr UpperCase()
const;
232 CStr Left(
size_t len)
const;
240 CStr Right(
size_t len)
const;
251 CStr AfterLast(
const CStr& str,
size_t startPos = npos)
const;
262 CStr BeforeLast(
const CStr& str,
size_t startPos = npos)
const;
273 CStr AfterFirst(
const CStr& str,
size_t startPos = 0)
const;
284 CStr BeforeFirst(
const CStr& str,
size_t startPos = 0)
const;
291 void Remove(
const CStr& str);
299 void Replace(
const CStr& toReplace,
const CStr& replaceWith);
304 std::string EscapeToPrintableASCII()
const;
324 std::u16string utf16()
const {
return std::u16string(begin(), end()); }
327 size_t GetHashCode()
const;
332 size_t GetSerializedLength()
const;
334 const u8* Deserialize(
const u8* buffer,
const u8* bufferend);
342 std::size_t operator()(
const CStr& str)
const
344 return str.GetHashCode();
PS_TRIM_MODE
Description : Contains CStr class which is a versatile class for making string use easy.
Definition: CStr.h:30
@ PS_TRIM_LEFT
Definition: CStr.h:31
@ PS_TRIM_RIGHT
Trim all white space from the beginning of the string.
Definition: CStr.h:32
@ PS_TRIM_BOTH
Trim all white space from the end of the string.
Definition: CStr.h:33
Definition: SerializeTemplates.h:64
Definition: ShaderDefines.cpp:31
#define tstring
Definition: secure_crt.cpp:76
int64_t i64
Definition: types.h:35
uint8_t u8
Definition: types.h:37