15 #include "CeeCore/Base.h"
28 class CEE_CORE_EXPORT
Str
33 Str(
const char* theString);
34 explicit Str(
const wchar_t* theString);
35 explicit Str(
const std::string& theString);
36 explicit Str(
const std::wstring& theString);
40 Str& operator=(
const Str& other);
44 bool operator<(
const Str& rhs)
const;
46 Str& operator+=(
const Str& rhs);
50 Str trimmedRight()
const;
51 Str trimmedLeft()
const;
53 Str simplified()
const;
55 std::vector<Str> split(
const Str& delimiters =
" ")
const;
56 size_t find(
const Str& str,
size_t start = 0)
const;
57 bool startsWith(
const Str& str)
const;
58 Str subStr(
size_t start,
size_t length = npos)
const;
59 void replace(
const Str& before,
const Str& after);
61 const wchar_t* c_str()
const;
62 std::string toStdString()
const;
63 std::wstring toStdWString()
const;
64 std::string toUtf8()
const;
69 static Str number(
int n);
70 static Str number(
unsigned int n);
71 static Str number(
float n,
char format =
'g',
int precision = -1);
72 static Str number(
double n,
char format =
'g',
int precision = -1);
73 static Str numberFromAddress(
const void* ptr);
75 double toDouble(
bool* ok = NULL)
const;
76 double toDouble(
double defaultValue)
const;
77 float toFloat(
bool* ok = NULL)
const;
78 float toFloat(
float defaultValue)
const;
79 int toInt(
bool* ok = NULL)
const;
80 int toInt(
int defaultValue)
const;
81 unsigned int toUInt(
bool* ok = NULL)
const;
82 unsigned int toUInt(
unsigned int defaultValue)
const;
84 Str arg(
const Str& a,
int fieldWidth = 0,
char fillChar =
' ')
const;
85 Str arg(
char a,
int fieldWidth = 0,
char fillChar =
' ')
const;
86 Str arg(
int a,
int fieldWidth = 0,
char fillChar =
' ')
const;
87 Str arg(int64_t a,
int fieldWidth = 0,
char fillChar =
' ')
const;
88 Str arg(
unsigned int a,
int fieldWidth = 0,
char fillChar =
' ')
const;
89 Str arg(uint64_t a,
int fieldWidth = 0,
char fillChar =
' ')
const;
90 Str arg(
float a,
int fieldWidth = 0,
char format =
'g',
int precision = -1,
char fillChar =
' ')
const;
91 Str arg(
double a,
int fieldWidth = 0,
char format =
'g',
int precision = -1,
char fillChar =
' ')
const;
93 Str arg(
size_t a,
int fieldWidth = 0,
char fillChar =
' ')
const;
98 bool matches(
const Str& wildcard)
const;
100 const void* unspecifiedWCharPointer()
const;
101 static Str fromUnspecifiedWCharPointer(
const void* voidPtr);
106 CEE_PRIVATE_IMPL(
Str);
cee::Str operator+(const char *str1, const cee::Str &str2)
Global operator to allow a const char + a cee::Str.
Definition: Str.cpp:817
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppAssert.cpp:18
static const size_t npos
Same as std::string::npos. This value, when used as the value for a count parameter n in string's mem...
Definition: Str.h:103
A general unicode based string class.
Definition: Str.h:28
bool operator!=(const PtrRef< T1 > &a, const PtrRef< T2 > &b)
Returns true if the internal pointers of refs a and b are different.
Definition: PtrRef.h:58
bool operator==(const PtrRef< T1 > &a, const PtrRef< T2 > &b)
Returns true if the internal pointers of refs a and b are equal.
Definition: PtrRef.h:57
void swap(PtrRef< T > &a, PtrRef< T > &b)
Swap contents of a and b. Matches signature of std::swap().
Definition: PtrRef.h:66