Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

Namespace: CppUtils::String

using CppUtils::String::TextCharT = typedef typename decltype(std::basic_string_view{std::declval<T>()})::value_type;
using CppUtils::String::HashTable = typedef std::unordered_map<Type::Token, std::basic_string<CharT> >;
using CppUtils::String::StringFrom = typedef std::basic_string<typename T::value_type>;
using CppUtils::String::StringViewFrom = typedef std::basic_string_view<typename T::value_type>;
constexpr auto isHighSurrogate(char16_t codeUnit) noexcept -> bool;

constexpr auto isLowSurrogate(char16_t codeUnit) noexcept -> bool;

constexpr auto utf16SurrogatesToCodePoint(char16_t highSurrogate, char16_t lowSurrogate) noexcept -> char32_t;

constexpr auto toUtf8(char32_t codePoint, std::string&& string={}) -> std::string;

constexpr auto toUtf8(std::u32string_view unicodeString, std::string&& string={}) -> std::string;

constexpr auto toUtf32(std::string_view text) -> std::pair<char32_t, std::size_t>;

constexpr auto utf32Substr(std::string_view text, std::size_t position, std::size_t count=std::string_view::npos) -> std::string_view;

constexpr auto getDisplayWidth(char32_t character) noexcept -> std::size_t;

constexpr auto getDisplayWidth(std::u32string_view unicodeString) -> std::size_t;

constexpr auto getDisplayWidth(std::string_view text) -> std::size_t;

constexpr auto getCharCount(std::string_view text) -> std::size_t;

template <Char CharT>
auto makeHashTable(Text<CharT> auto&&... texts) -> decltype(auto);

template <Char CharT>
auto getNameOrValue(Type::Token token, const HashTable<CharT> &tokenNames) -> auto;

template <StringView Source>
constexpr auto isEndOfString(const Cursor<Source> &cursor) noexcept -> bool;

template <StringView Source>
constexpr auto getChar(const Cursor<Source> &cursor) -> char;

template <StringView Source>
constexpr auto getCharAndSkip(Cursor<Source> &cursor) -> char;

template <StringView Source, std::predicate< char > Validator>
auto getStringIf(const Cursor<Source> &cursor, Validator&& validator) -> std::string_view;

template <StringView Source, std::predicate< char > Validator>
auto getStringAndSkipIf(Cursor<Source> &cursor, Validator&& validator) -> std::string_view;

template <StringView Source, std::predicate< char > Validator>
auto skipWhile(Cursor<Source> &cursor, Validator&& validator) -> void;

template <StringView Source>
auto skipSpaces(Cursor<Source> &cursor) -> void;

template <StringView Source>
auto isEqual(const Cursor<Source> &cursor, std::string_view expected) noexcept -> bool;

template <StringView Source>
auto isEqualAndSkip(Cursor<Source> &cursor, std::string_view expected) noexcept -> bool;

template <StringView Source>
auto getKeyword(const Cursor<Source> &cursor) -> std::string_view;

template <StringView Source>
auto getKeywordAndSkip(Cursor<Source> &cursor) -> std::string_view;

template <StringView Source>
auto getLineNumber(const Cursor<Source> &cursor) noexcept -> std::size_t;

template <StringView Source>
auto getPositionInLine(const Cursor<Source> &cursor) noexcept -> std::size_t;

constexpr auto isEscapable(char c) noexcept -> bool;

constexpr auto escape(char c) noexcept -> char;

constexpr auto unescape(char c) noexcept -> char;

auto leftTrimString(std::string_view stringView) -> std::string_view;

auto rightTrimString(std::string_view stringView) -> std::string_view;

auto trimString(std::string_view stringView) -> std::string_view;

auto getPrintableChar(Char auto c) -> std::string;

constexpr auto isUppercase(Char auto c) noexcept -> bool;

constexpr auto isLowercase(Char auto c) noexcept -> bool;

constexpr auto toLowercase(Char auto c) noexcept -> decltype(c);

constexpr auto toUppercase(Char auto c) noexcept -> decltype(c);

constexpr auto toLowercase(GenericText auto&& originalString) -> std::basic_string<TextCharT<decltype(originalString)>>;

constexpr auto toUppercase(GenericText auto&& originalString) -> std::basic_string<TextCharT<decltype(originalString)>>;

auto formatValue(const auto& value) -> std::string;

constexpr auto toAscii(const GenericText auto& string) -> std::string;

constexpr auto getNumberLength(std::integral auto number, std::size_t base=10) -> std::size_t;

template <std::size_t base = 10, class CharT = char>
constexpr auto toString(std::integral auto number) -> std::basic_string<CharT>;

auto split(std::string_view string, std::string_view separator) -> decltype(auto);

template <std::size_t Size>
FixedString(const char(&)[Size]) -> FixedString<Size>;

constexpr auto excelColumnToPosition(std::string_view excelColumn) noexcept -> std::size_t;

auto toHexString(std::span<const std::byte> data) -> std::string;

auto toHexString(std::string_view string) -> std::string;

auto fromHexString(std::string_view string) -> std::vector<std::byte>;