|
| string () noexcept |
| 创建空的字符串
|
|
| string (const value_t *c_str) |
| 从C字符串创建
|
|
| string (const std::string &str) |
| 从std::string创建
|
|
| string (const string &str) noexcept |
| 从self创建
|
|
| ~string () |
|
string & | operator= (const string &str) noexcept |
| copy
|
|
usize_t | length () const noexcept |
| 取得字符串长度
|
|
usize_t | byte_count () const noexcept |
| 取得字符串占用的字节数
|
|
bool | operator== (const string &str) const noexcept |
| 相等
|
|
template<std::size_t N> |
bool | operator== (const value_t(&str)[N]) const noexcept |
| 相等(cstr)
|
|
bool | operator!= (const string &str) const noexcept |
| 不等
|
|
template<std::size_t N> |
bool | operator!= (const value_t(&str)[N]) const noexcept |
| 不等(cstr)
|
|
result< unit_t, mstr_result_t > | reserve (usize_t new_size) noexcept |
| 保留足够的内存
|
|
template<std::size_t N> |
bool | start_with (const value_t(&prefix)[N]) const noexcept |
| 判断字符串是否以另一个字串开始(c_str buffer)
|
|
bool | start_with (const value_t *prefix) const noexcept |
| 判断字符串是否以另一个字串开始(c_str)
|
|
bool | start_with (const string *prefix) const noexcept |
| 判断字符串是否以另一个字串开始(MString)
|
|
template<std::size_t N> |
bool | end_with (const value_t(&suffix)[N]) const noexcept |
| 判断字符串是否以另一个字串结束(c_str buffer)
|
|
bool | end_with (const value_t *suffix) const noexcept |
| 判断字符串是否以另一个字串结束(c_str)
|
|
bool | end_with (const string *suffix) const noexcept |
| 判断字符串是否以另一个字串结束(MString)
|
|
result< unit_t, mstr_result_t > | push (unicode_t uni_char) noexcept |
| 放入一个字符
|
|
result< unit_t, mstr_result_t > | push (unicode_t ch, std::size_t repeat) noexcept |
| 重复放入一个字符
|
|
result< unit_t, mstr_result_t > | concat (const string &rhs) noexcept |
| 放入一个字符串
|
|
template<std::size_t N> |
result< unit_t, mstr_result_t > | concat (const value_t(&rhs)[N]) noexcept |
| 放入一个字符串 (c_str)
|
|
string & | operator+= (const string &rhs) |
| 字符串拼接 (self)
|
|
template<std::size_t N> |
string & | operator+= (const value_t(&rhs)[N]) |
| 字符串拼接 (self, c_str)
|
|
string & | operator+= (unicode_t rhs) |
| 字符串拼接 (字符)
|
|
string & | operator+= (const repeat_char_t &rhs) |
| 字符串拼接 (重复n个)
|
|
void | clear () noexcept |
| 取得C风格字符串
|
|
void | reverse () noexcept |
| 翻转字符串
|
|
result< unit_t, error_code_t > | insert (usize_t idx, unicode_t ch) noexcept |
| 在idx位置插入字符
|
|
result< unicode_t, error_code_t > | remove (usize_t idx) noexcept |
| 移除idx位置的字符, 并返回被移除的字符
|
|
bool | contains (const value_t *patt) const noexcept |
| 判断字符串是否包括字符串B
|
|
template<std::size_t N> |
bool | contains (const value_t(&patt)[N]) const noexcept |
| 判断字符串是否包括字符串B (cstr数组)
|
|
bool | contains (const string &patt) const noexcept |
| 判断字符串是否包括字符串B (string对象)
|
|
result< isize_t, error_code_t > | find (const value_t *patt, usize_t begin_pos=0, usize_t patt_len=0) const noexcept |
| 查找字符串 (c_str)
|
|
template<std::size_t N> |
result< isize_t, error_code_t > | find (const value_t(&patt)[N], usize_t begin_pos=0) const noexcept |
| 查找字符串 (c_str array)
|
|
result< isize_t, error_code_t > | find (const mtfmt::string &patt, usize_t begin_pos=0) const noexcept |
| 查找字符串 (mtfmt::string)
|
|
result< usize_t, error_code_t > | find_or_err (const value_t *patt, usize_t begin_pos=0, usize_t patt_cnt=0) const noexcept |
| 查找字符串 (c_str)
|
|
template<std::size_t N> |
result< usize_t, error_code_t > | find_or_err (const value_t(&patt)[N], usize_t begin_pos=0) const noexcept |
| 查找字符串 (c_str array)
|
|
result< usize_t, error_code_t > | find_or_err (const mtfmt::string &patt, usize_t begin_pos=0) const noexcept |
| 查找字符串 (mtfmt::string)
|
|
result< unit_t, error_code_t > | retain (const value_t *patt, MStringReplaceOption mode=MStringReplaceOption_All, usize_t patt_cnt=0) noexcept |
| 剔除掉patt字符
|
|
template<std::size_t N> |
result< unit_t, error_code_t > | retain (const value_t(&patt)[N], MStringReplaceOption mode=MStringReplaceOption_All) noexcept |
| 剔除掉patt字符(c str array)
|
|
result< unit_t, error_code_t > | retain (const mtfmt::string &patt, MStringReplaceOption mode=MStringReplaceOption_All) noexcept |
| 剔除掉patt字符(string object)
|
|
const value_t * | c_str () noexcept |
| 取得C风格字符串
|
|
std::string | as_std_string () |
| 取得std::string
|
|
const_iterator | begin () const noexcept |
| 取得迭代器起始 (const)
|
|
const_iterator | end () const noexcept |
| 取得迭代器结束 (const)
|
|
const_reverse_iterator | rbegin () const noexcept |
| 取得反向迭代器起始 (const)
|
|
const_reverse_iterator | rend () const noexcept |
| 取得反向迭代器结束 (const)
|
|
unicode_t | operator[] (std::size_t i) const |
| 取得第n个unicode字符
|
|
template<typename T > |
details::enable_if_t< std::is_signed< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(int32_t), result< unit_t, error_code_t > > append_from(const T &value, MStrFmtIntIndex index=MStrFmtIntIndex_Dec, MStrFmtSignDisplay sign=MStrFmtSignDisplay_NegOnly) noexcept { error_code_t res=mstr_fmt_itoa(&this_obj, static_cast< int32_t >(value), index, sign);if(MSTR_SUCC(res)) { return unit_t{};} else { return res;} } template< typename T > details::enable_if_t< std::is_unsigned< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(uint32_t), result< unit_t, error_code_t > > append_from(const T &value, MStrFmtIntIndex index=MStrFmtIntIndex_Dec) noexcept { error_code_t res=mstr_fmt_utoa(&this_obj, static_cast< uint32_t >(value), index);if(MSTR_SUCC(res)) { return unit_t{};} else { return res;} } template< typename T > details::enable_if_t< std::is_signed< details::wrapper_t< T > >::value &&details::is_instance_of< details::fixed_wrapper, T >::value, result< unit_t, error_code_t > > | append_from (const T &value, int32_t p, MStrFmtSignDisplay sign=MStrFmtSignDisplay_NegOnly) noexcept |
| 对有符号整数值进行格式化, 并填充到this中
|
|
template<typename T > |
details::enable_if_t< std::is_unsigned< details::wrapper_t< T > >::value &&details::is_instance_of< details::fixed_wrapper, T >::value, result< unit_t, error_code_t > > | append_from (const T &value, uint32_t p) noexcept |
| 对无符号量化值进行格式化, 并填充到this中
|
|
|
template<typename T > |
static static details::enable_if_t< std::is_signed< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(int32_t), result< string, error_code_t > > from(const T &value, MStrFmtIntIndex index=MStrFmtIntIndex_Dec, MStrFmtSignDisplay sign=MStrFmtSignDisplay_NegOnly) noexcept { string ret_str;error_code_t res=mstr_fmt_itoa(&ret_str.this_obj, static_cast< int32_t >(value), index, sign);if(MSTR_SUCC(res)) { return ret_str;} else { return res;} } template< typename T > static details::enable_if_t< std::is_unsigned< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(uint32_t), result< string, error_code_t > > from(const T &value, MStrFmtIntIndex index=MStrFmtIntIndex_Dec) noexcept { string ret_str;error_code_t res=mstr_fmt_utoa(&ret_str.this_obj, static_cast< uint32_t >(value), index);if(MSTR_SUCC(res)) { return ret_str;} else { return res;} } template< typename T > details::enable_if_t< std::is_signed< details::wrapper_t< T > >::value &&details::is_instance_of< details::fixed_wrapper, T >::value, result< string, error_code_t > > | from (const T &value, int32_t p, MStrFmtSignDisplay sign=MStrFmtSignDisplay_NegOnly) noexcept |
| 对有符号整数值进行格式化并返回
|
|
template<typename T > |
static details::enable_if_t< std::is_unsigned< details::wrapper_t< T > >::value &&details::is_instance_of< details::fixed_wrapper, T >::value, result< string, error_code_t > > | from (const T &value, uint32_t p) noexcept |
| 对无符号量化值进行格式化并返回
|
|
template<std::size_t N> |
static constexpr unicode_t | unicode_char (const value_t(&u8char)[N]) |
| 取得Unicode代码点的字符
|
|
template<std::size_t N, typename... Args> |
static result< string, error_code_t > | format (const value_t(&fmt_str)[N], Args &&... args) |
| 进行格式化(字符串数组)
|
|
template<typename... Args> |
static result< string, error_code_t > | format_variable (const string::value_t *fmt_str, Args &&... args) |
| 进行格式化(动态的格式化串)
|
|