|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
字符串相关函数,包含字符串比较、编码转换等函数。
类 | |
| class | ast::StringViewBasic< _Char > |
类型定义 | |
| using | ast::ByString = strings_internal::ByString |
| using | ast::ByChar = strings_internal::ByChar |
| using | ast::ByAnyChar = strings_internal::ByAnyChar |
| using | ast::ByLength = strings_internal::ByLength |
| using | ast::ByRepeatedWhitespace = strings_internal::ByRepeatedWhitespace |
| using | ast::ByRepeatedChar = strings_internal::ByRepeatedChar |
| using | ast::AllowEmpty = strings_internal::AllowEmpty |
| using | ast::SkipEmpty = strings_internal::SkipEmpty |
| using | ast::SkipWhitespace = strings_internal::SkipWhitespace |
| typedef StringViewBasic< char > | ast::StringView |
| typedef StringViewBasic< wchar_t > | ast::WStringView |
| typedef StringViewBasic< char16_t > | ast::U16StringView |
| typedef StringViewBasic< char32_t > | ast::U32StringView |
函数 | |
| AST_UTIL_CAPI errc_t | ast::aAnsiToWide (const char *ansi, std::wstring &wide) |
| AST_UTIL_CAPI errc_t | ast::aUtf8ToWide (const char *utf8, std::wstring &wide) |
| AST_UTIL_CAPI errc_t | ast::aWideToAnsi (const wchar_t *wide, std::string &ansi) |
| AST_UTIL_CAPI errc_t | ast::aWideToUtf8 (const wchar_t *wide, std::string &utf8) |
| template<typename Delimiter > | |
| strings_internal::Splitter< typename strings_internal::SelectDelimiter< Delimiter >::type, strings_internal::AllowEmpty, StringView > | ast::aStrSplit (StringView text, Delimiter delimiter) |
| template<typename Delimiter , typename Predicate > | |
| strings_internal::Splitter< typename strings_internal::SelectDelimiter< Delimiter >::type, Predicate, StringView > | ast::aStrSplit (StringView text, Delimiter delimiter, Predicate predicate) |
| template<typename Delimiter > | |
| strings_internal::MaxSplitsImpl< typename strings_internal::SelectDelimiter< Delimiter >::type > | ast::MaxSplits (Delimiter delimiter, int limit) |
| bool | ast::aEqualsIgnoreCase (StringView piece1, StringView piece2) noexcept |
| StringView | ast::aStripAsciiWhitespace (StringView str) noexcept |
| StringView | ast::aStripTrailingAsciiWhitespace (StringView str) noexcept |
| StringView | ast::aStripLeadingAsciiWhitespace (StringView str) noexcept |
| std::string | ast::aAsciiStrToLower (StringView str) |
| std::string | ast::aAsciiStrToUpper (StringView str) |
| template<typename _Char > | |
| std::basic_ostream< _Char > & | ast::operator<< (std::basic_ostream< _Char > &os, const StringViewBasic< _Char > &sv) |
| StringView | ast::operator""_sv (const char *str, size_t len) noexcept |
| WStringView | ast::operator""_sv (const wchar_t *str, size_t len) noexcept |
| AST_UTIL_CAPI errc_t ast::aAnsiToWide | ( | const char * | ansi, |
| std::wstring & | wide ) |
将ANSI编码的字符串转换为宽字符编码
| ansi | 输入ANSI编码的字符串 |
| wide | 输出宽字符编码的字符串 |
|
inline |
将字符串转换为小写
| str | 输入字符串 |
|
inline |
将字符串转换为大写
| str | 输入字符串 |
|
inlinenoexcept |
比较两个字符串是否相等(不区分大小写)
| str1 | 第一个字符串 |
| str2 | 第二个字符串 |
|
inlinenoexcept |
移除字符串首尾的ASCII空白字符
| str | 输入字符串 |
|
inlinenoexcept |
移除字符串首部的ASCII空白字符
| str | 输入字符串 |
|
inlinenoexcept |
移除字符串尾部的ASCII空白字符
| str | 输入字符串 |
|
inline |
字符串分割函数
该函数将字符串 text 按照分隔符 delimiter 进行分割。
| text | - 输入字符串 |
| delimiter | - 分隔符 |
| - | 分割后的字符串视图迭代器 |
|
inline |
字符串分割函数
该函数将字符串 text 按照分隔符 delimiter 进行分割, 并根据分割条件 predicate 进行筛选。
| text | - 输入字符串 |
| delimiter | - 分隔符 |
| predicate | - 分割条件 |
| - | 分割后的字符串视图迭代器 |
| AST_UTIL_CAPI errc_t ast::aUtf8ToWide | ( | const char * | utf8, |
| std::wstring & | wide ) |
将UTF-8编码的字符串转换为宽字符编码
| utf8 | 输入UTF-8编码的字符串 |
| wide | 输出宽字符编码的字符串 |
| AST_UTIL_CAPI errc_t ast::aWideToAnsi | ( | const wchar_t * | wide, |
| std::string & | ansi ) |
将宽字符编码的字符串转换为ANSI编码
| wide | 输入宽字符编码的字符串 |
| ansi | 输出ANSI编码的字符串 |
| AST_UTIL_CAPI errc_t ast::aWideToUtf8 | ( | const wchar_t * | wide, |
| std::string & | utf8 ) |
将宽字符编码的字符串转换为UTF-8编码
| wide | 输入宽字符编码的字符串 |
| utf8 | 输出UTF-8编码的字符串 |