|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <StringView.hpp>
Public 成员函数 | |
| constexpr | StringViewBasic (const _Char *str) noexcept |
| constexpr | StringViewBasic (const _Char *str, size_type len) noexcept |
| template<typename _Allocator > | |
| StringViewBasic (const std::basic_string< _Char, std::char_traits< _Char >, _Allocator > &str) noexcept | |
| constexpr | StringViewBasic (const StringViewBasic &other) noexcept=default |
| StringViewBasic & | operator= (const StringViewBasic &other) noexcept=default |
| constexpr size_type | size () const noexcept |
| constexpr size_type | length () const noexcept |
| constexpr bool | empty () const noexcept |
| constexpr const _Char & | operator[] (size_type pos) const noexcept |
| constexpr const _Char & | front () const noexcept |
| constexpr const _Char & | back () const noexcept |
| constexpr const _Char * | data () const noexcept |
| constexpr const_iterator | begin () const noexcept |
| constexpr const_iterator | end () const noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| constexpr const_iterator | cend () const noexcept |
| const_reverse_iterator | rbegin () const noexcept |
| const_reverse_iterator | rend () const noexcept |
| const_reverse_iterator | crbegin () const noexcept |
| const_reverse_iterator | crend () const noexcept |
| void | remove_prefix (size_type n) noexcept |
| void | remove_suffix (size_type n) noexcept |
| void | swap (StringViewBasic &other) noexcept |
| StringViewBasic | substr (size_type pos=0, size_type count=npos) const |
| int | compare (StringViewBasic other) const noexcept |
| bool | operator== (StringViewBasic other) const noexcept |
| bool | operator!= (StringViewBasic other) const noexcept |
| bool | operator< (StringViewBasic other) const noexcept |
| bool | operator<= (StringViewBasic other) const noexcept |
| bool | operator> (StringViewBasic other) const noexcept |
| bool | operator>= (StringViewBasic other) const noexcept |
| size_type | find (_Char ch, size_type pos=0) const noexcept |
| size_type | find (StringViewBasic str, size_type pos=0) const noexcept |
| size_type | rfind (_Char ch, size_type pos=npos) const noexcept |
| size_type | find_first_of (_Char ch, size_type pos=0) const noexcept |
| size_type | find_first_of (StringViewBasic str, size_type pos=0) const noexcept |
| size_type | find_last_of (_Char ch, size_type pos=npos) const noexcept |
| size_type | find_last_of (StringViewBasic str, size_type pos=npos) const noexcept |
| bool | starts_with (StringViewBasic str) const noexcept |
| bool | starts_with (_Char ch) const noexcept |
| bool | ends_with (StringViewBasic str) const noexcept |
| bool | ends_with (_Char ch) const noexcept |
| operator std::basic_string< _Char > () const noexcept | |
静态 Public 属性 | |
| static const size_type | npos = static_cast<size_type>(-1) |
轻量级的string_view实现
| _Char | 字符类型,默认使用char |
该类提供了对字符串的只读访问,不分配内存。