NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
basic_string< CharT, Traits, Alloc > 模板类 参考

基础字符串模板 更多...

#include <basic_string.hpp>

类 basic_string< CharT, Traits, Alloc > 继承关系图:
[图例]

Public 类型

using value_type = CharT
 值类型
using pointer = CharT*
 指针类型
using reference = CharT&
 引用类型
using const_pointer = const CharT*
 常量指针类型
using const_reference = const CharT&
 常量引用类型
using size_type = size_t
 大小类型
using difference_type = ptrdiff_t
 差值类型
using iterator = basic_string_iterator<false, basic_string>
 迭代器类型
using const_iterator = basic_string_iterator<true, basic_string>
 常量迭代器类型
using reverse_iterator = _NEFORCE reverse_iterator<iterator>
 反向迭代器类型
using const_reverse_iterator = _NEFORCE reverse_iterator<const_iterator>
 常量反向迭代器类型
using traits_type = Traits
 字符特征类型
using view_type = basic_string_view<CharT, Traits>
 字符串视图类型
using allocator_type = Alloc
 分配器类型

Public 成员函数

NEFORCE_CONSTEXPR20 basic_string ()
 默认构造函数
NEFORCE_CONSTEXPR20 basic_string (size_type n)
 构造函数,指定大小
NEFORCE_CONSTEXPR20 basic_string (size_type n, int32_t value)
 构造函数,指定大小和32位整数值
NEFORCE_CONSTEXPR20 basic_string (size_type n, int64_t value)
 构造函数,指定大小和64位整数值
NEFORCE_CONSTEXPR20 basic_string (size_type n, value_type value)
 构造函数,指定大小和填充字符
NEFORCE_CONSTEXPR20 basic_string (const basic_string &other)
 拷贝构造函数
NEFORCE_CONSTEXPR20 basic_stringoperator= (const basic_string &other)
 拷贝赋值运算符
NEFORCE_CONSTEXPR20 basic_string (basic_string &&other) noexcept
 移动构造函数
NEFORCE_CONSTEXPR20 basic_stringoperator= (basic_string &&other) noexcept
 移动赋值运算符
NEFORCE_CONSTEXPR20 basic_string (view_type view)
 从字符串视图构造
NEFORCE_CONSTEXPR20 basic_string (view_type view, const size_type n)
 从字符串视图构造(指定长度)
NEFORCE_CONSTEXPR20 basic_stringoperator= (view_type view)
 字符串视图赋值运算符
NEFORCE_CONSTEXPR20 basic_string (const basic_string &other, size_type position)
 从子串构造
NEFORCE_CONSTEXPR20 basic_string (const basic_string &other, size_type position, size_type n)
 从子串构造(指定长度)
NEFORCE_CONSTEXPR20 basic_string (const_pointer str)
 从C风格字符串构造
NEFORCE_CONSTEXPR20 basic_string (const_pointer str, const size_type n)
 从字符数组构造(指定长度)
NEFORCE_CONSTEXPR20 basic_stringoperator= (const_pointer str)
 C风格字符串赋值运算符
template<typename Iterator, enable_if_t<!is_convertible_v< Iterator, value_type >, int > = 0>
NEFORCE_CONSTEXPR20 basic_string (Iterator first, Iterator last)
 从迭代器范围构造
NEFORCE_CONSTEXPR20 basic_string (std::initializer_list< value_type > ilist)
 从初始化列表构造
NEFORCE_CONSTEXPR20 basic_stringoperator= (std::initializer_list< value_type > ilist)
 初始化列表赋值运算符
NEFORCE_CONSTEXPR20 ~basic_string ()
 析构函数
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 iterator begin () noexcept
 获取起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 iterator end () noexcept
 获取结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator begin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator end () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator cbegin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator cend () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reverse_iterator rbegin () noexcept
 获取反向起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reverse_iterator rend () noexcept
 获取反向结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator rbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator rend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator crbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator crend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type size () const noexcept
 获取字符数
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type max_size () const noexcept
 获取最大可能大小
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type capacity () const noexcept
 获取容量
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type length () const noexcept
 获取字符串长度
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool empty () const noexcept
 检查是否为空
NEFORCE_CONSTEXPR20 void reserve (const size_type n)
 预留容量
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference operator[] (const size_type n) noexcept
 下标访问操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference operator[] (const size_type n) const noexcept
 常量下标访问操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference at (const size_type n) noexcept
 带边界检查的访问
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference at (const size_type n) const noexcept
 带边界检查的常量访问
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference front () noexcept
 访问第一个字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference front () const noexcept
 常量访问第一个字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference back () noexcept
 访问最后一个字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference back () const noexcept
 常量访问最后一个字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 pointer data () noexcept
 获取数据指针
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_pointer data () const noexcept
 获取常量数据指针
NEFORCE_CONSTEXPR20 iterator insert (iterator position, value_type value)
 插入单个字符
NEFORCE_CONSTEXPR20 basic_stringinsert (size_type position, size_type n, value_type value)
 在指定位置插入多个相同字符
template<typename Iterator>
NEFORCE_CONSTEXPR20 iterator insert (iterator position, Iterator first, Iterator last)
 插入迭代器范围
NEFORCE_CONSTEXPR20 void push_back (value_type value)
 在末尾插入字符
NEFORCE_CONSTEXPR20 void pop_back () noexcept
 删除末尾字符
NEFORCE_CONSTEXPR20 basic_stringappend (size_type n, value_type value)
 追加多个相同字符
NEFORCE_CONSTEXPR20 basic_stringappend (value_type value)
 追加单个字符
NEFORCE_CONSTEXPR20 basic_stringappend (const basic_string &other, size_type position, size_type n)
 追加另一个字符串的子串
NEFORCE_CONSTEXPR20 basic_stringappend (const basic_string &other)
 追加另一个字符串
NEFORCE_CONSTEXPR20 basic_stringappend (const basic_string &other, size_type position)
 追加另一个字符串的子串
NEFORCE_CONSTEXPR20 basic_stringappend (basic_string &&other, size_type position, size_type n)
 追加移动字符串的子串
NEFORCE_CONSTEXPR20 basic_stringappend (basic_string &&other)
 追加移动字符串
NEFORCE_CONSTEXPR20 basic_stringappend (basic_string &&other, size_type position)
 追加移动字符串的子串
NEFORCE_CONSTEXPR20 basic_stringappend (view_type view, size_type n)
 追加字符串视图的指定长度
NEFORCE_CONSTEXPR20 basic_stringappend (view_type view)
 追加字符串视图
NEFORCE_CONSTEXPR20 basic_stringappend (const_pointer str, size_type n)
 追加字符数组的指定长度
NEFORCE_CONSTEXPR20 basic_stringappend (const_pointer str)
 追加C风格字符串
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
NEFORCE_CONSTEXPR20 basic_stringappend (Iterator first, Iterator last)
 追加迭代器范围
NEFORCE_CONSTEXPR20 basic_stringappend (std::initializer_list< value_type > ilist)
 追加初始化列表
NEFORCE_CONSTEXPR20 basic_stringoperator+= (const basic_string &other)
 追加另一个字符串
NEFORCE_CONSTEXPR20 basic_stringoperator+= (basic_string &&other)
 追加移动字符串
NEFORCE_CONSTEXPR20 basic_stringoperator+= (const value_type value)
 追加单个字符
NEFORCE_CONSTEXPR20 basic_stringoperator+= (const_pointer str)
 追加C风格字符串
NEFORCE_CONSTEXPR20 basic_stringoperator+= (std::initializer_list< value_type > ilist)
 追加初始化列表
NEFORCE_CONSTEXPR20 basic_stringoperator+= (view_type view)
 追加字符串视图
NEFORCE_CONSTEXPR20 basic_stringassign (const basic_string &other)
 赋值另一个字符串
NEFORCE_CONSTEXPR20 basic_stringassign (basic_string &&other)
 赋值移动字符串
NEFORCE_CONSTEXPR20 basic_stringassign (const_pointer str)
 赋值C风格字符串
NEFORCE_CONSTEXPR20 basic_stringassign (const_pointer str, const size_type n)
 赋值字符数组的指定长度
NEFORCE_CONSTEXPR20 basic_stringassign (const size_type n, value_type value)
 赋值多个相同字符
template<typename Iterator>
NEFORCE_CONSTEXPR20 basic_stringassign (Iterator first, Iterator last)
 赋值迭代器范围
NEFORCE_CONSTEXPR20 basic_stringassign (std::initializer_list< value_type > ilist)
 赋值初始化列表
NEFORCE_CONSTEXPR20 basic_stringassign (const view_type &view)
 赋值字符串视图
NEFORCE_CONSTEXPR20 iterator erase (iterator position) noexcept
 删除指定位置的字符
NEFORCE_CONSTEXPR20 basic_stringerase (size_type position=0, size_type n=npos) noexcept
 删除指定范围内的字符
NEFORCE_CONSTEXPR20 iterator erase (iterator first, const size_type n) noexcept
 删除指定数量的字符
NEFORCE_CONSTEXPR20 iterator erase (iterator first, iterator last) noexcept
 删除迭代器范围
NEFORCE_CONSTEXPR20 void resize (size_type n, value_type value)
 调整大小
NEFORCE_CONSTEXPR20 void resize (const size_type n)
 调整大小(默认填充0)
NEFORCE_CONSTEXPR20 void clear () noexcept
 清空字符串
NEFORCE_CONSTEXPR20 void shrink_to_fit ()
 收缩容量以适应当前大小
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 basic_string repeat (size_type n) const noexcept
 重复当前字符串n次
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 basic_string substr (const size_type off=0, size_type count=npos) const
 获取子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 view_type view () const noexcept
 获取字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 view_type view (const size_type off, size_type count=npos) const noexcept
 获取子串视图
NEFORCE_CONSTEXPR20 size_type copy (pointer dest, const size_type count, size_type position=0) const
 复制字符到目标缓冲区
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const basic_string &other) const noexcept
 比较另一个字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const size_type off, const size_type n, const basic_string &other) const
 比较子串与另一个字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const size_type off, const size_type n, const basic_string &other, const size_type roff, const size_type count) const
 比较子串与另一个字符串的子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const CharT *str) const noexcept
 比较C风格字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const view_type &view) const noexcept
 比较字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const size_type off, const size_type n, const CharT *str) const
 比较子串与C风格字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int compare (const size_type off, const size_type n, const CharT *str, size_type count) const
 比较子串与指定长度的字符数组
NEFORCE_CONSTEXPR20 basic_stringreplace (const size_type position, const size_type n, const basic_string &other)
 替换子串为另一个字符串
NEFORCE_CONSTEXPR20 basic_stringreplace (iterator first, iterator last, const basic_string &other)
 替换迭代器范围为另一个字符串
NEFORCE_CONSTEXPR20 basic_stringreplace (const size_type position, const size_type n, const_pointer str)
 替换子串为C风格字符串
NEFORCE_CONSTEXPR20 basic_stringreplace (iterator first, iterator last, const_pointer str)
 替换迭代器范围为C风格字符串
NEFORCE_CONSTEXPR20 basic_stringreplace (const size_type position, const size_type n1, const_pointer str, const size_type n2)
 替换子串为指定长度的字符数组
NEFORCE_CONSTEXPR20 basic_stringreplace (iterator first, iterator last, const_pointer str, const size_type n)
 替换迭代器范围为指定长度的字符数组
NEFORCE_CONSTEXPR20 basic_stringreplace (const size_type position, const size_type n1, const size_type n2, const value_type value)
 替换子串为多个相同字符
NEFORCE_CONSTEXPR20 basic_stringreplace (iterator first, iterator last, const size_type n, const value_type value)
 替换迭代器范围为多个相同字符
NEFORCE_CONSTEXPR20 basic_stringreplace (const size_type position1, const size_type n1, const basic_string &str, const size_type position2, const size_type n2=npos)
 替换子串为另一个字符串的子串
template<typename Iterator>
NEFORCE_CONSTEXPR20 basic_stringreplace (iterator first, iterator last, Iterator first2, Iterator last2)
 替换迭代器范围为另一个迭代器范围
NEFORCE_CONSTEXPR20 void reverse () noexcept
 反转字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const basic_string &other, const size_type n=0) const noexcept
 查找子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const CharT value, const size_type n=0) const noexcept
 查找字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const CharT *str, const size_type off, const size_type count) const noexcept
 查找指定长度的子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const CharT *str, const size_type off=0) const noexcept
 查找C风格字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const view_type &view, const size_type off, const size_type count) const noexcept
 查找指定长度的字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find (const view_type &view, const size_type off=0) const noexcept
 查找字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const basic_string &other, const size_type off=npos) const noexcept
 从后向前查找子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const CharT value, const size_type n=npos) const noexcept
 从后向前查找字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const CharT *str, const size_type off, const size_type n) const noexcept
 从后向前查找指定长度的子串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const CharT *str, const size_type off=npos) const noexcept
 从后向前查找C风格字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const view_type &view, const size_type off, const size_type count) const noexcept
 从后向前查找指定长度的字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type rfind (const view_type &view, const size_type off=0) const noexcept
 从后向前查找字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const basic_string &other, const size_type off=0) const noexcept
 查找第一个出现在字符集合中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const CharT value, const size_type off=0) const noexcept
 查找第一个等于指定字符的位置
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const CharT *str, const size_type off, const size_type n) const noexcept
 查找第一个出现在指定字符数组中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const CharT *str, const size_type off=0) const noexcept
 查找第一个出现在C风格字符串中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const view_type &view, const size_type off, const size_type n) const noexcept
 查找第一个出现在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_of (const view_type &view, const size_type off=0) const noexcept
 查找第一个出现在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const basic_string &other, const size_type off=npos) const noexcept
 查找最后一个出现在字符集合中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const CharT value, const size_type off=npos) const noexcept
 查找最后一个等于指定字符的位置
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const CharT *str, const size_type off, const size_type n) const noexcept
 查找最后一个出现在指定字符数组中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const CharT *str, const size_type off=npos) const noexcept
 查找最后一个出现在C风格字符串中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const view_type &view, const size_type off, const size_type n) const noexcept
 查找最后一个出现在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_of (const view_type &view, const size_type off=npos) const noexcept
 查找最后一个出现在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const basic_string &other, const size_type off=0) const noexcept
 查找第一个不在字符集合中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const CharT value, const size_type off=0) const noexcept
 查找第一个不等于指定字符的位置
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const CharT *str, const size_type off, const size_type n) const noexcept
 查找第一个不在指定字符数组中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const CharT *str, const size_type off=0) const noexcept
 查找第一个不在C风格字符串中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const view_type &view, const size_type off, const size_type n) const noexcept
 查找第一个不在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_first_not_of (const view_type &view, const size_type off=0) const noexcept
 查找第一个不在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const basic_string &other, const size_type off=npos) const noexcept
 查找最后一个不在字符集合中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const CharT value, const size_type off=npos) const noexcept
 查找最后一个不等于指定字符的位置
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const CharT *str, const size_type off, const size_type n) const noexcept
 查找最后一个不在指定字符数组中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const CharT *str, const size_type off=npos) const noexcept
 查找最后一个不在C风格字符串中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const view_type &view, const size_type off, const size_type n) const noexcept
 查找最后一个不在字符串视图中的字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type find_last_not_of (const view_type &view, const size_type off=npos) const noexcept
 查找最后一个不在字符串视图中的字符
NEFORCE_CONSTEXPR20 size_type count (value_type value, const size_type position=0) const noexcept
 统计指定字符出现的次数
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool starts_with (const basic_string &other) const noexcept
 检查是否以另一个字符串开头
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool starts_with (view_type view) const noexcept
 检查是否以字符串视图开头
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool starts_with (const value_type value) const noexcept
 检查是否以指定字符开头
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool starts_with (const_pointer str) const noexcept
 检查是否以C风格字符串开头
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool ends_with (const basic_string &other) const noexcept
 检查是否以另一个字符串结尾
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool ends_with (view_type view) const noexcept
 检查是否以字符串视图结尾
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool ends_with (value_type value) const noexcept
 检查是否以指定字符结尾
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool ends_with (const_pointer str) const noexcept
 检查是否以C风格字符串结尾
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool contains (const basic_string &other) const noexcept
 检查是否包含另一个字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool contains (view_type view) const noexcept
 检查是否包含字符串视图
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool contains (value_type value) const noexcept
 检查是否包含指定字符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool contains (const_pointer str) const noexcept
 检查是否包含C风格字符串
NEFORCE_CONSTEXPR20 basic_stringtrim_left () noexcept
 去除左侧空白字符
NEFORCE_CONSTEXPR20 basic_stringtrim_right () noexcept
 去除右侧空白字符
NEFORCE_CONSTEXPR20 basic_stringtrim () noexcept
 去除两侧空白字符
template<typename Pred>
NEFORCE_CONSTEXPR20 basic_stringtrim_left_if (Pred pred)
 根据谓词去除左侧字符
template<typename Pred>
NEFORCE_CONSTEXPR20 basic_stringtrim_right_if (Pred pred)
 根据谓词去除右侧字符
template<typename Predicate>
NEFORCE_CONSTEXPR20 basic_stringtrim_if (Predicate pred)
 根据谓词去除两侧字符
NEFORCE_CONSTEXPR20 bool equal_to (const basic_string &other) const noexcept
 相等比较
NEFORCE_CONSTEXPR20 bool equal_to (const view_type view) const noexcept
 与字符串视图相等比较
NEFORCE_CONSTEXPR20 bool equal_to (const CharT *str) const noexcept
 与C风格字符串相等比较
NEFORCE_CONSTEXPR20 basic_stringlowercase () noexcept(noexcept(_NEFORCE transform(begin(), end(), begin(), _NEFORCE to_lowercase< CharT >)))
 转换为小写
NEFORCE_CONSTEXPR20 basic_stringuppercase () noexcept(noexcept(_NEFORCE transform(begin(), end(), begin(), _NEFORCE to_uppercase< CharT >)))
 转换为大写
NEFORCE_CONSTEXPR20 void swap (basic_string &other) noexcept
 交换两个字符串
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool operator== (const basic_string &rhs) const noexcept
 相等比较操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool operator< (const basic_string &rhs) const noexcept
 小于比较操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_t to_hash () const noexcept
 计算哈希值
Public 成员函数 继承自 icomparable< T >
NEFORCE_NODISCARD constexpr bool operator== (const T &rhs) const noexcept(noexcept(derived()==rhs))
 相等比较运算符
NEFORCE_NODISCARD constexpr bool operator!= (const T &rhs) const noexcept(noexcept(!(*this==rhs)))
 不等比较运算符
NEFORCE_NODISCARD constexpr bool operator< (const T &rhs) const noexcept(noexcept(derived()< rhs))
 小于比较运算符
NEFORCE_NODISCARD constexpr bool operator> (const T &rhs) const noexcept(noexcept(rhs< derived()))
 大于比较运算符
NEFORCE_NODISCARD constexpr bool operator<= (const T &rhs) const noexcept(noexcept(!(derived() > rhs)))
 小于等于比较运算符
NEFORCE_NODISCARD constexpr bool operator>= (const T &rhs) const noexcept(noexcept(!(derived()< rhs)))
 大于等于比较运算符
Public 成员函数 继承自 ihashable< T >
NEFORCE_NODISCARD constexpr size_t to_hash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值

静态 Public 属性

static constexpr size_type npos = string_view::npos
 特殊值,表示未找到或"直到末尾"

详细描述

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
class basic_string< CharT, Traits, Alloc >

基础字符串模板

模板参数
CharT字符类型
Traits字符特征类型,默认为char_traits<CharT>
Alloc分配器类型,默认为allocator<CharT>

basic_string是一个动态字符序列容器,针对字符串操作进行了优化。 支持小字符串优化(SSO)减少动态分配。

在文件 basic_string.hpp172 行定义.

构造及析构函数说明

◆ basic_string() [1/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( )
inline

默认构造函数

构造一个空字符串。

在文件 basic_string.hpp741 行定义.

被这些函数引用 basic_string< char >::substr().

◆ basic_string() [2/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( size_type n)
inlineexplicit

构造函数,指定大小

参数
n字符数

在文件 basic_string.hpp754 行定义.

◆ basic_string() [3/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( size_type n,
int32_t value )
inlineexplicit

构造函数,指定大小和32位整数值

参数
n字符数
value整数值

在文件 basic_string.hpp762 行定义.

◆ basic_string() [4/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( size_type n,
int64_t value )
inlineexplicit

构造函数,指定大小和64位整数值

参数
n字符数
value整数值

在文件 basic_string.hpp770 行定义.

◆ basic_string() [5/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( size_type n,
value_type value )
inlineexplicit

构造函数,指定大小和填充字符

参数
n字符数
value填充字符

在文件 basic_string.hpp778 行定义.

◆ basic_string() [6/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( const basic_string< CharT, Traits, Alloc > & other)
inline

拷贝构造函数

参数
other源字符串

在文件 basic_string.hpp808 行定义.

◆ basic_string() [7/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( basic_string< CharT, Traits, Alloc > && other)
inlinenoexcept

移动构造函数

参数
other源字符串

在文件 basic_string.hpp881 行定义.

◆ basic_string() [8/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( view_type view)
inline

从字符串视图构造

参数
view字符串视图

在文件 basic_string.hpp961 行定义.

◆ basic_string() [9/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( view_type view,
const size_type n )
inline

从字符串视图构造(指定长度)

参数
view字符串视图
n字符数

在文件 basic_string.hpp968 行定义.

◆ basic_string() [10/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( const basic_string< CharT, Traits, Alloc > & other,
size_type position )
inline

从子串构造

参数
other源字符串
position起始位置

在文件 basic_string.hpp1026 行定义.

◆ basic_string() [11/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( const basic_string< CharT, Traits, Alloc > & other,
size_type position,
size_type n )
inline

从子串构造(指定长度)

参数
other源字符串
position起始位置
n字符数

在文件 basic_string.hpp1037 行定义.

◆ basic_string() [12/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( const_pointer str)
inline

从C风格字符串构造

参数
strC风格字符串

在文件 basic_string.hpp1047 行定义.

◆ basic_string() [13/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( const_pointer str,
const size_type n )
inline

从字符数组构造(指定长度)

参数
str字符指针
n字符数

在文件 basic_string.hpp1054 行定义.

◆ basic_string() [14/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Iterator, enable_if_t<!is_convertible_v< Iterator, value_type >, int > = 0>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( Iterator first,
Iterator last )
inline

从迭代器范围构造

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器

在文件 basic_string.hpp1112 行定义.

◆ basic_string() [15/15]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string< CharT, Traits, Alloc >::basic_string ( std::initializer_list< value_type > ilist)
inline

从初始化列表构造

参数
ilist初始化列表

在文件 basic_string.hpp1120 行定义.

成员函数说明

◆ append() [1/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( basic_string< CharT, Traits, Alloc > && other)
inline

追加移动字符串

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp1662 行定义.

◆ append() [2/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( basic_string< CharT, Traits, Alloc > && other,
size_type position )
inline

追加移动字符串的子串

参数
other源字符串
position起始位置
返回
自身引用

在文件 basic_string.hpp1673 行定义.

◆ append() [3/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( basic_string< CharT, Traits, Alloc > && other,
size_type position,
size_type n )
inline

追加移动字符串的子串

参数
other源字符串
position起始位置
n字符数
返回
自身引用

在文件 basic_string.hpp1646 行定义.

◆ append() [4/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( const basic_string< CharT, Traits, Alloc > & other)
inline

追加另一个字符串

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp1627 行定义.

被这些函数引用 basic_string< char >::append().

◆ append() [5/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( const basic_string< CharT, Traits, Alloc > & other,
size_type position )
inline

追加另一个字符串的子串

参数
other源字符串
position起始位置
返回
自身引用

在文件 basic_string.hpp1635 行定义.

◆ append() [6/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( const basic_string< CharT, Traits, Alloc > & other,
size_type position,
size_type n )
inline

追加另一个字符串的子串

参数
other源字符串
position起始位置
n字符数
返回
自身引用

在文件 basic_string.hpp1613 行定义.

◆ append() [7/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( const_pointer str)
inline

追加C风格字符串

参数
strC风格字符串
返回
自身引用

在文件 basic_string.hpp1741 行定义.

被这些函数引用 basic_string< char >::append().

◆ append() [8/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( const_pointer str,
size_type n )
inline

追加字符数组的指定长度

参数
str字符指针
n字符数
返回
自身引用

在文件 basic_string.hpp1699 行定义.

◆ append() [9/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( Iterator first,
Iterator last )
inline

追加迭代器范围

模板参数
Iterator迭代器类型
参数
first源起始
last源结束
返回
自身引用

在文件 basic_string.hpp1751 行定义.

◆ append() [10/14]

◆ append() [11/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( std::initializer_list< value_type > ilist)
inline

追加初始化列表

参数
ilist初始化列表
返回
自身引用

在文件 basic_string.hpp1803 行定义.

◆ append() [12/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( value_type value)
inline

追加单个字符

参数
value要追加的字符
返回
自身引用

在文件 basic_string.hpp1604 行定义.

被这些函数引用 basic_string< char >::append().

◆ append() [13/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( view_type view)
inline

追加字符串视图

参数
view字符串视图
返回
自身引用

在文件 basic_string.hpp1691 行定义.

被这些函数引用 basic_string< char >::append().

◆ append() [14/14]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::append ( view_type view,
size_type n )
inline

追加字符串视图的指定长度

参数
view字符串视图
n字符数
返回
自身引用

在文件 basic_string.hpp1684 行定义.

被这些函数引用 basic_string< char >::append().

◆ assign() [1/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( basic_string< CharT, Traits, Alloc > && other)
inline

赋值移动字符串

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp1841 行定义.

◆ assign() [2/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( const basic_string< CharT, Traits, Alloc > & other)
inline

赋值另一个字符串

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp1834 行定义.

◆ assign() [3/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( const size_type n,
value_type value )
inline

赋值多个相同字符

参数
n字符数
value填充字符
返回
自身引用

在文件 basic_string.hpp1867 行定义.

◆ assign() [4/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( const view_type & view)
inline

赋值字符串视图

参数
view字符串视图
返回
自身引用

在文件 basic_string.hpp1897 行定义.

◆ assign() [5/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( const_pointer str)
inline

赋值C风格字符串

参数
strC风格字符串
返回
自身引用

在文件 basic_string.hpp1848 行定义.

◆ assign() [6/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( const_pointer str,
const size_type n )
inline

赋值字符数组的指定长度

参数
str字符指针
n字符数
返回
自身引用

在文件 basic_string.hpp1856 行定义.

◆ assign() [7/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Iterator>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( Iterator first,
Iterator last )
inline

赋值迭代器范围

模板参数
Iterator迭代器类型
参数
first源起始
last源结束
返回
自身引用

在文件 basic_string.hpp1880 行定义.

◆ assign() [8/8]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::assign ( std::initializer_list< value_type > ilist)
inline

赋值初始化列表

参数
ilist初始化列表
返回
自身引用

在文件 basic_string.hpp1890 行定义.

◆ at() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference basic_string< CharT, Traits, Alloc >::at ( const size_type n) const
inlinenoexcept

带边界检查的常量访问

参数
n索引
返回
指定位置的字符常量引用

在文件 basic_string.hpp1322 行定义.

◆ at() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference basic_string< CharT, Traits, Alloc >::at ( const size_type n)
inlinenoexcept

带边界检查的访问

参数
n索引
返回
指定位置的字符引用

在文件 basic_string.hpp1315 行定义.

◆ back() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference basic_string< CharT, Traits, Alloc >::back ( ) const
inlinenoexcept

常量访问最后一个字符

返回
最后一个字符的常量引用

在文件 basic_string.hpp1355 行定义.

◆ back() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference basic_string< CharT, Traits, Alloc >::back ( )
inlinenoexcept

访问最后一个字符

返回
最后一个字符的引用

在文件 basic_string.hpp1346 行定义.

被这些函数引用 basic_string< char >::ends_with().

◆ begin() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator basic_string< CharT, Traits, Alloc >::begin ( ) const
inlinenoexcept

获取常量起始迭代器

返回
指向第一个字符的常量迭代器

在文件 basic_string.hpp1155 行定义.

◆ begin() [2/2]

◆ capacity()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::capacity ( ) const
inlinenoexcept

获取容量

返回
当前分配的存储可容纳的字符数

在文件 basic_string.hpp1237 行定义.

被这些函数引用 basic_string< char >::reserve().

◆ cbegin()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator basic_string< CharT, Traits, Alloc >::cbegin ( ) const
inlinenoexcept

获取常量起始迭代器

返回
指向第一个字符的常量迭代器

在文件 basic_string.hpp1167 行定义.

被这些函数引用 basic_string< char >::begin() , 以及 basic_string< char >::crend().

◆ cend()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator basic_string< CharT, Traits, Alloc >::cend ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个字符之后位置的常量迭代器

在文件 basic_string.hpp1173 行定义.

被这些函数引用 basic_string< char >::crbegin() , 以及 basic_string< char >::end().

◆ compare() [1/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const basic_string< CharT, Traits, Alloc > & other) const
inlinenoexcept

比较另一个字符串

参数
other另一个字符串
返回
比较结果

在文件 basic_string.hpp2147 行定义.

被这些函数引用 basic_string< char >::compare(), basic_string< char >::compare() , 以及 basic_string< char >::operator<().

◆ compare() [2/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const CharT * str) const
inlinenoexcept

比较C风格字符串

参数
strC风格字符串
返回
比较结果

在文件 basic_string.hpp2182 行定义.

◆ compare() [3/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const size_type off,
const size_type n,
const basic_string< CharT, Traits, Alloc > & other ) const
inline

比较子串与另一个字符串

参数
off起始偏移
n长度
other另一个字符串
返回
比较结果

在文件 basic_string.hpp2158 行定义.

◆ compare() [4/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const size_type off,
const size_type n,
const basic_string< CharT, Traits, Alloc > & other,
const size_type roff,
const size_type count ) const
inline

比较子串与另一个字符串的子串

参数
off起始偏移
n长度
other另一个字符串
roff目标起始偏移
count目标长度
返回
比较结果

在文件 basic_string.hpp2172 行定义.

◆ compare() [5/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const size_type off,
const size_type n,
const CharT * str ) const
inline

比较子串与C风格字符串

参数
off起始偏移
n长度
strC风格字符串
返回
比较结果

在文件 basic_string.hpp2202 行定义.

◆ compare() [6/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const size_type off,
const size_type n,
const CharT * str,
size_type count ) const
inline

比较子串与指定长度的字符数组

参数
off起始偏移
n长度
str字符指针
count字符数组长度
返回
比较结果

在文件 basic_string.hpp2214 行定义.

◆ compare() [7/7]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 int basic_string< CharT, Traits, Alloc >::compare ( const view_type & view) const
inlinenoexcept

比较字符串视图

参数
view字符串视图
返回
比较结果

在文件 basic_string.hpp2191 行定义.

◆ copy()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::copy ( pointer dest,
const size_type count,
size_type position = 0 ) const
inline

复制字符到目标缓冲区

参数
dest目标缓冲区
count要复制的字符数
position起始位置
返回
实际复制的字符数

在文件 basic_string.hpp2135 行定义.

◆ count()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::count ( value_type value,
const size_type position = 0 ) const
inlinenoexcept

统计指定字符出现的次数

参数
value要统计的字符
position起始位置
返回
字符出现的次数

在文件 basic_string.hpp2521 行定义.

◆ crbegin()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator basic_string< CharT, Traits, Alloc >::crbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最后一个字符的常量反向迭代器

在文件 basic_string.hpp1203 行定义.

被这些函数引用 basic_string< char >::rbegin().

◆ crend()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator basic_string< CharT, Traits, Alloc >::crend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向第一个字符之前位置的常量反向迭代器

在文件 basic_string.hpp1211 行定义.

被这些函数引用 basic_string< char >::rend().

◆ data() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_pointer basic_string< CharT, Traits, Alloc >::data ( ) const
inlinenoexcept

获取常量数据指针

返回
指向底层字符数组的常量指针

在文件 basic_string.hpp1379 行定义.

◆ data() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 pointer basic_string< CharT, Traits, Alloc >::data ( )
inlinenoexcept

获取数据指针

返回
指向底层字符数组的指针

在文件 basic_string.hpp1364 行定义.

被这些函数引用 basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::back(), basic_string< char >::back(), basic_string< char >::basic_string(), basic_string< char >::basic_string(), basic_string< char >::basic_string(), basic_string< char >::begin(), basic_string< char >::cbegin(), basic_string< char >::cend(), basic_string< char >::compare(), basic_string< char >::copy(), basic_string< char >::count(), basic_string< char >::end(), basic_string< char >::ends_with(), basic_string< char >::ends_with(), basic_string< char >::equal_to(), basic_string< char >::erase(), basic_string< char >::erase(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::front(), basic_string< char >::front(), basic_string< char >::operator=(), basic_string< char >::operator[](), basic_string< char >::operator[](), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::starts_with(), basic_string< char >::starts_with(), basic_string< char >::substr(), basic_string< char >::to_hash(), basic_string< char >::view(), basic_string< char >::view(), XOR_decrypt() , 以及 XOR_encrypt().

◆ empty()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool basic_string< CharT, Traits, Alloc >::empty ( ) const
inlinenoexcept

◆ end() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_iterator basic_string< CharT, Traits, Alloc >::end ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个字符之后位置的常量迭代器

在文件 basic_string.hpp1161 行定义.

◆ end() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::end ( )
inlinenoexcept

◆ equal_to() [1/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 bool basic_string< CharT, Traits, Alloc >::equal_to ( const basic_string< CharT, Traits, Alloc > & other) const
inlinenoexcept

相等比较

参数
other另一个字符串
返回
是否相等

在文件 basic_string.hpp2672 行定义.

被这些函数引用 basic_string< char >::equal_to() , 以及 basic_string< char >::operator==().

◆ equal_to() [2/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 bool basic_string< CharT, Traits, Alloc >::equal_to ( const CharT * str) const
inlinenoexcept

与C风格字符串相等比较

参数
strC风格字符串
返回
是否相等

在文件 basic_string.hpp2688 行定义.

被这些函数引用 basic_string< char >::equal_to().

◆ equal_to() [3/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 bool basic_string< CharT, Traits, Alloc >::equal_to ( const view_type view) const
inlinenoexcept

与字符串视图相等比较

参数
view字符串视图
返回
是否相等

在文件 basic_string.hpp2679 行定义.

◆ erase() [1/4]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::erase ( iterator first,
const size_type n )
inlinenoexcept

删除指定数量的字符

参数
first起始位置
n字符数
返回
指向被删除区域之后位置的迭代器

在文件 basic_string.hpp1955 行定义.

◆ erase() [2/4]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::erase ( iterator first,
iterator last )
inlinenoexcept

删除迭代器范围

参数
first起始位置
last结束位置
返回
指向被删除区域之后位置的迭代器

在文件 basic_string.hpp1969 行定义.

◆ erase() [3/4]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::erase ( iterator position)
inlinenoexcept

删除指定位置的字符

参数
position要删除的位置
返回
指向被删除字符之后位置的迭代器

在文件 basic_string.hpp1904 行定义.

被这些函数引用 basic_string< char >::erase(), basic_string< char >::erase(), basic_string< char >::resize(), basic_string< char >::trim_left_if() , 以及 basic_string< char >::trim_right_if().

◆ erase() [4/4]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::erase ( size_type position = 0,
size_type n = npos )
inlinenoexcept

删除指定范围内的字符

参数
position起始位置
n字符数
返回
自身引用

在文件 basic_string.hpp1940 行定义.

◆ front() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference basic_string< CharT, Traits, Alloc >::front ( ) const
inlinenoexcept

常量访问第一个字符

返回
第一个字符的常量引用

在文件 basic_string.hpp1337 行定义.

◆ front() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference basic_string< CharT, Traits, Alloc >::front ( )
inlinenoexcept

访问第一个字符

返回
第一个字符的引用

在文件 basic_string.hpp1328 行定义.

被这些函数引用 basic_string< char >::starts_with().

◆ insert() [1/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Iterator>
NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::insert ( iterator position,
Iterator first,
Iterator last )
inline

插入迭代器范围

模板参数
Iterator迭代器类型
参数
position插入位置
first源起始
last源结束
返回
指向插入起始的迭代器

在文件 basic_string.hpp1485 行定义.

◆ insert() [2/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 iterator basic_string< CharT, Traits, Alloc >::insert ( iterator position,
value_type value )
inline

插入单个字符

参数
position插入位置
value要插入的字符
返回
指向插入字符的迭代器

在文件 basic_string.hpp1396 行定义.

被这些函数引用 basic_string< char >::insert() , 以及 basic_string< char >::operator=().

◆ insert() [3/3]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::insert ( size_type position,
size_type n,
value_type value )
inline

在指定位置插入多个相同字符

参数
position插入位置
n插入数量
value插入字符
返回
自身引用

在文件 basic_string.hpp1434 行定义.

◆ length()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::length ( ) const
inlinenoexcept

获取字符串长度

返回
字符串长度

在文件 basic_string.hpp1249 行定义.

◆ max_size()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::max_size ( ) const
inlinenoexcept

◆ operator=() [1/5]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::operator= ( basic_string< CharT, Traits, Alloc > && other)
inlinenoexcept

移动赋值运算符

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp915 行定义.

◆ operator=() [2/5]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::operator= ( const basic_string< CharT, Traits, Alloc > & other)
inline

拷贝赋值运算符

参数
other源字符串
返回
自身引用

在文件 basic_string.hpp835 行定义.

◆ operator=() [3/5]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::operator= ( const_pointer str)
inline

C风格字符串赋值运算符

参数
strC风格字符串
返回
自身引用

在文件 basic_string.hpp1061 行定义.

◆ operator=() [4/5]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::operator= ( std::initializer_list< value_type > ilist)
inline

初始化列表赋值运算符

参数
ilist初始化列表
返回
自身引用

在文件 basic_string.hpp1128 行定义.

◆ operator=() [5/5]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::operator= ( view_type view)
inline

字符串视图赋值运算符

参数
view字符串视图
返回
自身引用

在文件 basic_string.hpp975 行定义.

◆ operator[]() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reference basic_string< CharT, Traits, Alloc >::operator[] ( const size_type n) const
inlinenoexcept

常量下标访问操作符

参数
n索引
返回
指定位置的字符常量引用

在文件 basic_string.hpp1305 行定义.

◆ operator[]() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reference basic_string< CharT, Traits, Alloc >::operator[] ( const size_type n)
inlinenoexcept

下标访问操作符

参数
n索引
返回
指定位置的字符引用

在文件 basic_string.hpp1295 行定义.

◆ push_back()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 void basic_string< CharT, Traits, Alloc >::push_back ( value_type value)
inline

在末尾插入字符

参数
value要插入的字符

在文件 basic_string.hpp1531 行定义.

被这些函数引用 codepoint::append_to(), getline(), getline(), bitset< N >::to_string() , 以及 wcharacter::to_u16string().

◆ rbegin() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator basic_string< CharT, Traits, Alloc >::rbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最后一个字符的常量反向迭代器

在文件 basic_string.hpp1191 行定义.

◆ rbegin() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reverse_iterator basic_string< CharT, Traits, Alloc >::rbegin ( )
inlinenoexcept

获取反向起始迭代器

返回
指向最后一个字符的反向迭代器

在文件 basic_string.hpp1179 行定义.

被这些函数引用 basic_string< char >::trim_right_if().

◆ rend() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 const_reverse_iterator basic_string< CharT, Traits, Alloc >::rend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向第一个字符之前位置的常量反向迭代器

在文件 basic_string.hpp1197 行定义.

◆ rend() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 reverse_iterator basic_string< CharT, Traits, Alloc >::rend ( )
inlinenoexcept

获取反向结束迭代器

返回
指向第一个字符之前位置的反向迭代器

在文件 basic_string.hpp1185 行定义.

被这些函数引用 basic_string< char >::trim_right_if().

◆ repeat()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 basic_string basic_string< CharT, Traits, Alloc >::repeat ( size_type n) const
inlinenoexcept

重复当前字符串n次

参数
n重复次数
返回
新字符串

在文件 basic_string.hpp2089 行定义.

◆ reserve()

◆ resize() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 void basic_string< CharT, Traits, Alloc >::resize ( const size_type n)
inline

调整大小(默认填充0)

参数
n新大小

在文件 basic_string.hpp2023 行定义.

◆ resize() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 void basic_string< CharT, Traits, Alloc >::resize ( size_type n,
value_type value )
inline

调整大小

参数
n新大小
value填充值

在文件 basic_string.hpp2011 行定义.

被这些函数引用 basic_string< char >::resize().

◆ size()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_type basic_string< CharT, Traits, Alloc >::size ( ) const
inlinenoexcept

获取字符数

返回
字符串长度

在文件 basic_string.hpp1219 行定义.

被这些函数引用 basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::append(), basic_string< char >::back(), basic_string< char >::back(), basic_string< char >::basic_string(), basic_string< char >::basic_string(), basic_string< char >::basic_string(), basic_string< char >::cend(), basic_string< char >::compare(), basic_string< char >::copy(), basic_string< char >::count(), basic_string< char >::empty(), basic_string< char >::end(), basic_string< char >::ends_with(), basic_string< char >::ends_with(), basic_string< char >::equal_to(), basic_string< char >::erase(), basic_string< char >::erase(), basic_string< char >::erase(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_not_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_first_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_not_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::find_last_of(), basic_string< char >::insert(), basic_string< char >::insert(), basic_string< char >::length(), basic_string< char >::operator=(), basic_string< char >::operator[](), basic_string< char >::operator[](), basic_string< char >::pop_back(), basic_string< char >::repeat(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::replace(), basic_string< char >::reserve(), basic_string< char >::resize(), basic_string< char >::reverse(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::rfind(), basic_string< char >::shrink_to_fit(), basic_string< char >::starts_with(), basic_string< char >::starts_with(), basic_string< char >::substr(), basic_string< char >::to_hash(), basic_string< char >::view(), basic_string< char >::view(), XOR_decrypt() , 以及 XOR_encrypt().

◆ substr()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 basic_string basic_string< CharT, Traits, Alloc >::substr ( const size_type off = 0,
size_type count = npos ) const
inline

获取子串

参数
off起始偏移
count长度
返回
子串

在文件 basic_string.hpp2104 行定义.

◆ swap()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 void basic_string< CharT, Traits, Alloc >::swap ( basic_string< CharT, Traits, Alloc > & other)
inlinenoexcept

交换两个字符串

参数
other另一个字符串

在文件 basic_string.hpp2712 行定义.

被这些函数引用 basic_string< char >::shrink_to_fit().

◆ trim()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim ( )
inlinenoexcept

去除两侧空白字符

返回
自身引用

在文件 basic_string.hpp2608 行定义.

◆ trim_if()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Predicate>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim_if ( Predicate pred)
inline

根据谓词去除两侧字符

模板参数
Predicate谓词类型
参数
pred谓词函数
返回
自身引用

在文件 basic_string.hpp2663 行定义.

◆ trim_left()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim_left ( )
inlinenoexcept

去除左侧空白字符

返回
自身引用

在文件 basic_string.hpp2592 行定义.

被这些函数引用 basic_string< char >::trim().

◆ trim_left_if()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Pred>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim_left_if ( Pred pred)
inline

根据谓词去除左侧字符

模板参数
Pred谓词类型
参数
pred谓词函数
返回
自身引用

在文件 basic_string.hpp2617 行定义.

被这些函数引用 basic_string< char >::trim_if() , 以及 basic_string< char >::trim_left().

◆ trim_right()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim_right ( )
inlinenoexcept

去除右侧空白字符

返回
自身引用

在文件 basic_string.hpp2600 行定义.

被这些函数引用 basic_string< char >::trim().

◆ trim_right_if()

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
template<typename Pred>
NEFORCE_CONSTEXPR20 basic_string & basic_string< CharT, Traits, Alloc >::trim_right_if ( Pred pred)
inline

根据谓词去除右侧字符

模板参数
Pred谓词类型
参数
pred谓词函数
返回
自身引用

在文件 basic_string.hpp2640 行定义.

被这些函数引用 basic_string< char >::trim_if() , 以及 basic_string< char >::trim_right().

◆ view() [1/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 view_type basic_string< CharT, Traits, Alloc >::view ( ) const
inlinenoexcept

◆ view() [2/2]

template<typename CharT, typename Traits = char_traits<CharT>, typename Alloc = allocator<CharT>>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 view_type basic_string< CharT, Traits, Alloc >::view ( const size_type off,
size_type count = npos ) const
inlinenoexcept

获取子串视图

参数
off起始偏移
count长度
返回
字符串视图

在文件 basic_string.hpp2122 行定义.


该类的文档由以下文件生成: