Represents a Unicode character string.
More...
#include <AUI/Common/AString.h>
AString stores a string of 16-bit chars, where each char corresponds to one UTF-16 code unit. Unicode characters with code values above 65535 are stored using two consecutive chars.
Unicode is an international standard that supports most of the writing systems in use today.
- Examples
- /home/runner/work/aui/aui/aui.json/src/AUI/Json/Conversion.h, examples/7guis/cells/src/AST.cpp, examples/7guis/cells/src/Cell.cpp, examples/7guis/cells/src/Formula.cpp, examples/7guis/cells/src/Tokens.h, examples/7guis/cells/src/main.cpp, examples/7guis/flight_booker/src/main.cpp, examples/app/minesweeper/src/NewGameWindow.cpp, examples/ui/contacts/src/main.cpp, examples/ui/contacts/src/view/ContactDetailsView.cpp, examples/ui/contacts/src/view/ContactDetailsView.h, examples/ui/views/src/DemoListModel.cpp, and examples/ui/views/src/DemoListModel.h.
◆ AString() [1/4]
AString::AString |
( |
const basic_string & | other | ) |
|
|
inlinenoexcept |
◆ AString() [2/4]
AString::AString |
( |
const std::string & | utf8 | ) |
|
|
noexcept |
◆ AString() [3/4]
AString::AString |
( |
const char * | utf8 | ) |
|
|
noexcept |
◆ AString() [4/4]
AString::AString |
( |
std::string_view | utf8 | ) |
|
|
noexcept |
> All members, including inherited
◆ insertAll()
template<typename OtherContainer>
void AString::insertAll |
( |
const OtherContainer & | c | ) |
|
|
inlinenoexcept |
- Template Parameters
-
OtherContainer | other container type. |
- Parameters
-
◆ toBool()
bool AString::toBool |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
- Returns
- If the string equals to "true", true returned, false otherwise.
◆ toDouble()
AOptional< double > AString::toDouble |
( |
| ) |
const |
|
nodiscardnoexcept |
◆ toDoubleOrException()
double AString::toDoubleOrException |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
- Returns
- The string converted to a double number.
If conversion to int is not possible, exception is thrown.
◆ toFloat()
AOptional< float > AString::toFloat |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- The string converted to a float number.
If conversion to int is not possible, nullopt is returned.
◆ toInt()
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, nullopt is returned.
◆ toIntOrException()
int AString::toIntOrException |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, exception is thrown.
◆ toLongInt()
AOptional< int64_t > AString::toLongInt |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, nullopt is returned.
◆ toLongIntOrException()
int64_t AString::toLongIntOrException |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, nullopt is returned.
◆ toNumber()
◆ toNumberOrException()
int AString::toNumberOrException |
( |
aui::ranged_number< int, 2, 36 > | base = TO_NUMBER_BASE_DEC | ) |
const |
|
inline |
◆ toStdString()
std::string AString::toStdString |
( |
| ) |
const |
|
noexcept |
- Returns
- utf8-encoded std::string.
◆ toUInt()
AOptional< unsigned > AString::toUInt |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, exception is thrown.
◆ toUIntOrException()
unsigned AString::toUIntOrException |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- The string converted to an integer value using base 10. If the string starts with 0x or 0X, the base 16 used.
If conversion to int is not possible, exception is thrown.