Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

Namespace: CppUtils::String

using CppUtils::String::TextCharT = typename decltype(std::basic_string_view{std::declval<T>()})::value_type;
using CppUtils::String::CharacterType = CppUtils::Type::UnderlyingElementType<T>;

Resolves the decayed character element type of a pointer, array, or character type.

using CppUtils::String::HashTable = std::unordered_map<Type::Token, std::basic_string<CharT>>;
using CppUtils::String::StringFrom = std::basic_string<typename T::value_type>;
using CppUtils::String::StringViewFrom = std::basic_string_view<typename T::value_type>;
template <class T>
bool isExtensivelyPrintable();
bool isHighSurrogate(char16_t codeUnit) noexcept;
bool isLowSurrogate(char16_t codeUnit) noexcept;
char32_t utf16SurrogatesToCodePoint(char16_t highSurrogate, char16_t lowSurrogate) noexcept;
std::string toUtf8(char32_t codePoint, std::string&& string={});
std::string toUtf8(std::u32string_view unicodeString, std::string&& string={});
std::pair<char32_t, std::size_t> toUtf32(std::string_view text);
std::string_view utf32Substr(std::string_view text, std::size_t position, std::size_t count=std::string_view::npos);
std::size_t getDisplayWidth(char32_t character) noexcept;
std::size_t getDisplayWidth(std::u32string_view unicodeString);
std::size_t getDisplayWidth(std::string_view text);
std::size_t getCharCount(std::string_view text);
template <Type::Character CharT>
decltype(auto) makeHashTable(Text<CharT> auto&&... texts);
template <Type::Character CharT>
auto getNameOrValue(Type::Token token, const HashTable<CharT>& tokenNames);
template <StringView Source>
bool isEndOfString(const Cursor<Source>& cursor) noexcept;
template <StringView Source>
char getChar(const Cursor<Source>& cursor);
template <StringView Source>
char getCharAndSkip(Cursor<Source>& cursor);
template <StringView Source, std::predicate< char > Validator>
std::string_view getStringIf(const Cursor<Source>& cursor, Validator&& validator);
template <StringView Source, std::predicate< char > Validator>
std::string_view getStringAndSkipIf(Cursor<Source>& cursor, Validator&& validator);
template <StringView Source, std::predicate< char > Validator>
void skipWhile(Cursor<Source>& cursor, Validator&& validator);
template <StringView Source>
void skipSpaces(Cursor<Source>& cursor);
template <StringView Source>
bool isEqual(const Cursor<Source>& cursor, std::string_view expected) noexcept;
template <StringView Source>
bool isEqualAndSkip(Cursor<Source>& cursor, std::string_view expected) noexcept;
template <StringView Source>
std::string_view getKeyword(const Cursor<Source>& cursor);
template <StringView Source>
std::string_view getKeywordAndSkip(Cursor<Source>& cursor);
template <StringView Source>
std::size_t getLineNumber(const Cursor<Source>& cursor) noexcept;
template <StringView Source>
std::size_t getPositionInLine(const Cursor<Source>& cursor) noexcept;
bool isEscapable(char c) noexcept;
char escape(char c) noexcept;
char unescape(char c) noexcept;
std::string_view leftTrimString(std::string_view stringView);
std::string_view rightTrimString(std::string_view stringView);
std::string_view trimString(std::string_view stringView);
std::string getPrintableChar(Type::Character auto c);
bool isUppercase(Type::Character auto c) noexcept;
bool isLowercase(Type::Character auto c) noexcept;
decltype(c) toLowercase(Type::Character auto c) noexcept;
decltype(c) toUppercase(Type::Character auto c) noexcept;
std::basic_string<TextCharT<decltype(originalString)>> toLowercase(GenericText auto&& originalString);
std::basic_string<TextCharT<decltype(originalString)>> toUppercase(GenericText auto&& originalString);
std::string formatValue(const auto& value);
std::string toAscii(const GenericText auto& string);
std::size_t getNumberLength(std::integral auto number, std::size_t base=10);
template <std::size_t base = 10, class CharT = char>
std::basic_string<CharT> toString(std::integral auto number);
decltype(auto) split(std::string_view string, std::string_view separator);
template <std::size_t Size>
FixedString(const char(&)[Size]) -> FixedString<Size>;
std::size_t excelColumnToPosition(std::string_view excelColumn) noexcept;
std::string toHexString(std::span<const std::byte> data);
std::string toHexString(std::string_view string);
std::vector<std::byte> fromHexString(std::string_view string);