|
rapidyaml
0.8.0
parse and emit YAML, and do it fast
|
a non-owning string-view, consisting of a character pointer and a length. More...
#include <substr.hpp>
Classes | |
| struct | first_of_any_result |
Public Member Functions | |
Default construction and assignment | |
| constexpr | basic_substring () noexcept |
| basic_substring (basic_substring const &) noexcept=default | |
| basic_substring (basic_substring &&) noexcept=default | |
| basic_substring (std::nullptr_t) noexcept | |
| basic_substring & | operator= (basic_substring const &) noexcept=default |
| basic_substring & | operator= (basic_substring &&) noexcept=default |
| basic_substring & | operator= (std::nullptr_t) noexcept |
| void | clear () noexcept |
Construction and assignment from characters with the same type | |
| template<size_t N> | |
| constexpr | basic_substring (C(&s_)[N]) noexcept |
| Construct from an array. More... | |
| basic_substring (C *s_, size_t len_) noexcept | |
| Construct from a pointer and length. More... | |
| basic_substring (C *beg_, C *end_) noexcept | |
| Construct from two pointers. More... | |
| template<class U , typename std::enable_if< std::is_same< U, C * >::value||std::is_same< U, NCC_ * >::value, int >::type = 0> | |
| basic_substring (U s_) noexcept | |
| Construct from a C-string (zero-terminated string) More... | |
| template<size_t N> | |
| void | assign (C(&s_)[N]) noexcept |
| Assign from an array. More... | |
| void | assign (C *s_, size_t len_) noexcept |
| Assign from a pointer and length. More... | |
| void | assign (C *beg_, C *end_) noexcept |
| Assign from two pointers. More... | |
| template<class U , typename std::enable_if< std::is_same< U, C * >::value||std::is_same< U, NCC_ * >::value, int >::type = 0> | |
| void | assign (U s_) noexcept |
| Assign from a C-string (zero-terminated string) More... | |
| template<size_t N> | |
| basic_substring & | operator= (C(&s_)[N]) noexcept |
| Assign from an array. More... | |
| template<class U , typename std::enable_if< std::is_same< U, C * >::value||std::is_same< U, NCC_ * >::value, int >::type = 0> | |
| basic_substring & | operator= (U s_) noexcept |
| Assign from a C-string (zero-terminated string) More... | |
Standard accessor methods | |
| bool | has_str () const noexcept |
| bool | empty () const noexcept |
| bool | not_empty () const noexcept |
| size_t | size () const noexcept |
| iterator | begin () noexcept |
| iterator | end () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| C * | data () noexcept |
| C const * | data () const noexcept |
| C & | operator[] (size_t i) noexcept |
| C const & | operator[] (size_t i) const noexcept |
| C & | front () noexcept |
| C const & | front () const noexcept |
| C & | back () noexcept |
| C const & | back () const noexcept |
Comparison methods | |
| int | compare (C const c) const noexcept |
| int | compare (const char *that, size_t sz) const noexcept |
| int | compare (ro_substr const that) const noexcept |
| bool | operator== (std::nullptr_t) const noexcept |
| bool | operator!= (std::nullptr_t) const noexcept |
| bool | operator== (C const c) const noexcept |
| bool | operator!= (C const c) const noexcept |
| bool | operator< (C const c) const noexcept |
| bool | operator> (C const c) const noexcept |
| bool | operator<= (C const c) const noexcept |
| bool | operator>= (C const c) const noexcept |
| template<class U > | |
| bool | operator== (basic_substring< U > const that) const noexcept |
| template<class U > | |
| bool | operator!= (basic_substring< U > const that) const noexcept |
| template<class U > | |
| bool | operator< (basic_substring< U > const that) const noexcept |
| template<class U > | |
| bool | operator> (basic_substring< U > const that) const noexcept |
| template<class U > | |
| bool | operator<= (basic_substring< U > const that) const noexcept |
| template<class U > | |
| bool | operator>= (basic_substring< U > const that) const noexcept |
| template<size_t N> | |
| bool | operator== (const char(&that)[N]) const noexcept |
| template<size_t N> | |
| bool | operator!= (const char(&that)[N]) const noexcept |
| template<size_t N> | |
| bool | operator< (const char(&that)[N]) const noexcept |
| template<size_t N> | |
| bool | operator> (const char(&that)[N]) const noexcept |
| template<size_t N> | |
| bool | operator<= (const char(&that)[N]) const noexcept |
| template<size_t N> | |
| bool | operator>= (const char(&that)[N]) const noexcept |
Sub-selection methods | |
| bool | is_sub (ro_substr const that) const noexcept |
| true if *this is a substring of that (ie, from the same buffer) More... | |
| bool | is_super (ro_substr const that) const noexcept |
| true if that is a substring of *this (ie, from the same buffer) More... | |
| bool | overlaps (ro_substr const that) const noexcept |
| true if there is overlap of at least one element between that and *this More... | |
| basic_substring | sub (size_t first) const noexcept |
| return [first,len[ More... | |
| basic_substring | sub (size_t first, size_t num) const noexcept |
| return [first,first+num[. More... | |
| basic_substring | range (size_t first, size_t last=npos) const noexcept |
| return [first,last[. More... | |
| basic_substring | first (size_t num) const noexcept |
return the first num elements: [0,num[ More... | |
| basic_substring | last (size_t num) const noexcept |
return the last num elements: [len-num,len[ More... | |
| basic_substring | offs (size_t left, size_t right) const noexcept |
| offset from the ends: return [left,len-right[ ; ie, trim a number of characters from the left and right. More... | |
| basic_substring | left_of (size_t pos) const noexcept |
| return [0, pos[ . More... | |
| basic_substring | left_of (size_t pos, bool include_pos) const noexcept |
| return [0, pos+include_pos[ . More... | |
| basic_substring | right_of (size_t pos) const noexcept |
| return [pos+1, len[ More... | |
| basic_substring | right_of (size_t pos, bool include_pos) const noexcept |
| return [pos+!include_pos, len[ More... | |
| basic_substring | left_of (ro_substr const subs) const noexcept |
given subs a substring of the current string, get the portion of the current string to the left of it More... | |
| basic_substring | right_of (ro_substr const subs) const noexcept |
given subs a substring of the current string, get the portion of the current string to the right of it More... | |
Removing characters (trim()) / patterns (strip()) from the tips of the string | |
| basic_substring | triml (const C c) const |
| trim left More... | |
| basic_substring | triml (ro_substr chars) const |
| trim left ANY of the characters. More... | |
| basic_substring | trimr (const C c) const |
| trim the character c from the right More... | |
| basic_substring | trimr (ro_substr chars) const |
| trim right ANY of the characters More... | |
| basic_substring | trim (const C c) const |
| trim the character c left and right More... | |
| basic_substring | trim (ro_substr const chars) const |
| trim left and right ANY of the characters More... | |
| basic_substring | stripl (ro_substr pattern) const |
| remove a pattern from the left More... | |
| basic_substring | stripr (ro_substr pattern) const |
| remove a pattern from the right More... | |
Lookup methods | |
| size_t | find (const C c, size_t start_pos=0) const |
| size_t | find (ro_substr pattern, size_t start_pos=0) const |
| size_t | count (const C c, size_t pos=0) const |
| count the number of occurrences of c More... | |
| size_t | count (ro_substr c, size_t pos=0) const |
| count the number of occurrences of s More... | |
| basic_substring | select (const C c, size_t pos=0) const |
get the substr consisting of the first occurrence of c after pos, or an empty substr if none occurs More... | |
| basic_substring | select (ro_substr pattern, size_t pos=0) const |
get the substr consisting of the first occurrence of pattern after pos, or an empty substr if none occurs More... | |
| first_of_any_result | first_of_any (ro_substr s0, ro_substr s1) const |
| first_of_any_result | first_of_any (ro_substr s0, ro_substr s1, ro_substr s2) const |
| first_of_any_result | first_of_any (ro_substr s0, ro_substr s1, ro_substr s2, ro_substr s3) const |
| first_of_any_result | first_of_any (ro_substr s0, ro_substr s1, ro_substr s2, ro_substr s3, ro_substr s4) const |
| template<class It > | |
| first_of_any_result | first_of_any_iter (It first_span, It last_span) const |
| bool | begins_with (const C c) const |
true if the first character of the string is c More... | |
| bool | begins_with (const C c, size_t num) const |
true if the first num characters of the string are c More... | |
| bool | begins_with (ro_substr pattern) const |
true if the string begins with the given pattern More... | |
| bool | begins_with_any (ro_substr chars) const |
true if the first character of the string is any of the given chars More... | |
| bool | ends_with (const C c) const |
true if the last character of the string is c More... | |
| bool | ends_with (const C c, size_t num) const |
true if the last num characters of the string are c More... | |
| bool | ends_with (ro_substr pattern) const |
true if the string ends with the given pattern More... | |
| bool | ends_with_any (ro_substr chars) const |
true if the last character of the string is any of the given chars More... | |
| size_t | first_of (const C c, size_t start=0) const |
| size_t | last_of (const C c, size_t start=npos) const |
| size_t | first_of (ro_substr chars, size_t start=0) const |
| size_t | last_of (ro_substr chars, size_t start=npos) const |
| size_t | first_not_of (const C c) const |
| size_t | first_not_of (const C c, size_t start) const |
| size_t | last_not_of (const C c) const |
| size_t | last_not_of (const C c, size_t start) const |
| size_t | first_not_of (ro_substr chars) const |
| size_t | first_not_of (ro_substr chars, size_t start) const |
| size_t | last_not_of (ro_substr chars) const |
| size_t | last_not_of (ro_substr chars, size_t start) const |
Range lookup methods | |
| basic_substring | pair_range (CC open, CC close) const |
| get the range delimited by an open-close pair of characters. More... | |
| basic_substring | pair_range_esc (CC open_close, CC escape=CC('\\')) |
| get the range delimited by a single open-close character (eg, quotes). More... | |
| basic_substring | pair_range_nested (CC open, CC close) const |
| get the range delimited by an open-close pair of characters, with possibly nested occurrences. More... | |
| basic_substring | unquoted () const |
Path-like manipulation methods | |
| basic_substring | basename (C sep=C('/')) const |
| basic_substring | dirname (C sep=C('/')) const |
| basic_substring | name_wo_extshort () const |
| basic_substring | name_wo_extlong () const |
| basic_substring | extshort () const |
| basic_substring | extlong () const |
Content-modification methods (only for non-const C) | |
| void | toupper () |
| convert the string to upper-case More... | |
| void | tolower () |
| convert the string to lower-case More... | |
| void | fill (C val) |
fill the entire contents with the given val More... | |
| void | copy_from (ro_substr that, size_t ifirst=0, size_t num=npos) |
| set the current substring to a copy of the given csubstr More... | |
| void | reverse () |
| reverse in place More... | |
| void | reverse_sub (size_t ifirst, size_t num) |
| revert a subpart in place More... | |
| void | reverse_range (size_t ifirst, size_t ilast) |
| revert a range in place More... | |
| basic_substring | erase (size_t pos, size_t num) |
| erase part of the string. More... | |
| basic_substring | erase_range (size_t first, size_t last) |
| basic_substring | erase (ro_substr sub) |
| erase a part of the string. More... | |
| size_t | replace (C value, C repl, size_t pos=0) |
replace every occurrence of character value with the character repl More... | |
| size_t | replace (ro_substr chars, C repl, size_t pos=0) |
replace every occurrence of each character in value with the character repl. More... | |
| size_t | replace_all (rw_substr dst, ro_substr pattern, ro_substr repl, size_t pos=0) const |
replace pattern with repl, and write the result into dst. More... | |
Public Attributes | |
| C * | str |
| a restricted pointer to the first character of the substring More... | |
| size_t | len |
| the length of the substring More... | |
Types | |
| enum | : size_t { npos = (size_t)-1 , NONE = (size_t)-1 } |
| using | CC = typename std::add_const< C >::type |
| CC=const char. More... | |
| using | NCC_ = typename std::remove_const< C >::type |
| NCC_=non const char. More... | |
| using | ro_substr = basic_substring< CC > |
| using | rw_substr = basic_substring< NCC_ > |
| using | char_type = C |
| using | size_type = size_t |
| using | iterator = C * |
| using | const_iterator = CC * |
| template<class U = C> | |
| operator typename std::enable_if<!std::is_const< U >::value, ro_substr const & >::type () const noexcept | |
| convert automatically to substring of const C More... | |
Splitting methods | |
| using | split_proxy = split_proxy_impl |
| bool | next_split (C sep, size_t *start_pos, basic_substring *out) const |
| returns true if the string has not been exhausted yet, meaning it's ok to call next_split() again. More... | |
| split_proxy | split (C sep, size_t start_pos=0) const |
| a view into the splits More... | |
| basic_substring | pop_right (C sep=C('/'), bool skip_empty=false) const |
| pop right: return the first split from the right. More... | |
| basic_substring | pop_left (C sep=C('/'), bool skip_empty=false) const |
| return the first split from the left. More... | |
| basic_substring | gpop_left (C sep=C('/'), bool skip_empty=false) const |
| greedy pop left. More... | |
| basic_substring | gpop_right (C sep=C('/'), bool skip_empty=false) const |
| greedy pop right. More... | |
Number-matching query methods | |
| bool | is_number () const |
| bool | is_real () const |
| bool | is_integer () const |
| bool | is_unsigned_integer () const |
| basic_substring | first_non_empty_span () const |
| get the first span consisting exclusively of non-empty characters More... | |
| basic_substring | first_uint_span () const |
| get the first span which can be interpreted as an unsigned integer More... | |
| basic_substring | first_int_span () const |
| get the first span which can be interpreted as a signed integer More... | |
| basic_substring | _first_integral_span (size_t skip_start) const |
| basic_substring | first_real_span () const |
| get the first span which can be interpreted as a real (floating-point) number More... | |
| basic_substring | _word_follows (size_t pos, csubstr word) const noexcept |
| basic_substring | _first_real_span_dec (size_t pos) const noexcept |
| basic_substring | _first_real_span_hex (size_t pos) const noexcept |
| basic_substring | _first_real_span_bin (size_t pos) const noexcept |
| basic_substring | _first_real_span_oct (size_t pos) const noexcept |
| static constexpr C4_CONST bool | _is_delim_char (char c) noexcept |
| true if the character is a delimiter character at the end More... | |
| static constexpr C4_CONST bool | _is_hex_char (char c) noexcept |
| true if the character is in [0-9a-fA-F] More... | |
a non-owning string-view, consisting of a character pointer and a length.
Definition at line 72 of file substr.hpp.
| using c4::basic_substring< C >::CC = typename std::add_const<C>::type |
CC=const char.
Definition at line 86 of file substr.hpp.
| using c4::basic_substring< C >::NCC_ = typename std::remove_const<C>::type |
NCC_=non const char.
Definition at line 87 of file substr.hpp.
| using c4::basic_substring< C >::ro_substr = basic_substring<CC> |
Definition at line 89 of file substr.hpp.
| using c4::basic_substring< C >::rw_substr = basic_substring<NCC_> |
Definition at line 90 of file substr.hpp.
| using c4::basic_substring< C >::char_type = C |
Definition at line 92 of file substr.hpp.
| using c4::basic_substring< C >::size_type = size_t |
Definition at line 93 of file substr.hpp.
| using c4::basic_substring< C >::iterator = C* |
Definition at line 95 of file substr.hpp.
| using c4::basic_substring< C >::const_iterator = CC* |
Definition at line 96 of file substr.hpp.
| using c4::basic_substring< C >::split_proxy = split_proxy_impl |
Definition at line 1758 of file substr.hpp.
| anonymous enum : size_t |
|
inlineconstexprnoexcept |
Definition at line 114 of file substr.hpp.
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 118 of file substr.hpp.
|
inlineconstexprnoexcept |
Construct from an array.
Definition at line 137 of file substr.hpp.
|
inlinenoexcept |
Construct from a pointer and length.
Definition at line 140 of file substr.hpp.
|
inlinenoexcept |
Construct from two pointers.
Definition at line 144 of file substr.hpp.
|
inlinenoexcept |
Construct from a C-string (zero-terminated string)
Definition at line 152 of file substr.hpp.
|
inlinenoexcept |
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 122 of file substr.hpp.
|
inlinenoexcept |
Definition at line 124 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 158 of file substr.hpp.
|
inlinenoexcept |
Assign from a pointer and length.
Definition at line 161 of file substr.hpp.
|
inlinenoexcept |
Assign from two pointers.
Definition at line 165 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 173 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 178 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 186 of file substr.hpp.
|
inlinenoexcept |
Definition at line 195 of file substr.hpp.
|
inlinenoexcept |
Definition at line 196 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_int_span(), c4::basic_substring< C >::first_real_span(), c4::basic_substring< C >::first_uint_span(), and c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
Definition at line 197 of file substr.hpp.
|
inlinenoexcept |
Definition at line 198 of file substr.hpp.
Referenced by c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator==(), and c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 201 of file substr.hpp.
Referenced by c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
Definition at line 203 of file substr.hpp.
|
inlinenoexcept |
Definition at line 204 of file substr.hpp.
|
inlinenoexcept |
Definition at line 206 of file substr.hpp.
Referenced by c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator==().
|
inlinenoexcept |
Definition at line 207 of file substr.hpp.
|
inlinenoexcept |
Definition at line 209 of file substr.hpp.
|
inlinenoexcept |
Definition at line 210 of file substr.hpp.
|
inlinenoexcept |
Definition at line 212 of file substr.hpp.
|
inlinenoexcept |
Definition at line 213 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 234 of file substr.hpp.
|
inlinenoexcept |
Definition at line 261 of file substr.hpp.
References c4::basic_substring< C >::compare().
Referenced by c4::basic_substring< C >::compare().
|
inlinenoexcept |
Definition at line 263 of file substr.hpp.
|
inlinenoexcept |
Definition at line 264 of file substr.hpp.
|
inlinenoexcept |
Definition at line 266 of file substr.hpp.
|
inlinenoexcept |
Definition at line 267 of file substr.hpp.
|
inlinenoexcept |
Definition at line 268 of file substr.hpp.
|
inlinenoexcept |
Definition at line 269 of file substr.hpp.
|
inlinenoexcept |
Definition at line 270 of file substr.hpp.
|
inlinenoexcept |
Definition at line 271 of file substr.hpp.
|
inlinenoexcept |
Definition at line 273 of file substr.hpp.
|
inlinenoexcept |
Definition at line 274 of file substr.hpp.
|
inlinenoexcept |
Definition at line 275 of file substr.hpp.
|
inlinenoexcept |
Definition at line 276 of file substr.hpp.
|
inlinenoexcept |
Definition at line 277 of file substr.hpp.
|
inlinenoexcept |
Definition at line 278 of file substr.hpp.
|
inlinenoexcept |
Definition at line 280 of file substr.hpp.
|
inlinenoexcept |
Definition at line 281 of file substr.hpp.
|
inlinenoexcept |
Definition at line 282 of file substr.hpp.
|
inlinenoexcept |
Definition at line 283 of file substr.hpp.
|
inlinenoexcept |
Definition at line 284 of file substr.hpp.
|
inlinenoexcept |
Definition at line 285 of file substr.hpp.
|
inlinenoexcept |
true if *this is a substring of that (ie, from the same buffer)
Definition at line 295 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
true if there is overlap of at least one element between that and *this
Definition at line 310 of file substr.hpp.
Referenced by c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
return [first,len[
Definition at line 319 of file substr.hpp.
Referenced by c4::basic_substring< C >::pair_range().
|
inlinenoexcept |
return [first,first+num[.
If num==npos, return [first,len[
Definition at line 326 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return [first,last[.
If last==npos, return [first,len[
Definition at line 336 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the first num elements: [0,num[
Definition at line 346 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the last num elements: [len-num,len[
Definition at line 353 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
offset from the ends: return [left,len-right[ ; ie, trim a number of characters from the left and right.
This is equivalent to python's negative list indices.
Definition at line 364 of file substr.hpp.
References c4::fmt::left(), and c4::fmt::right().
|
inlinenoexcept |
return [0, pos[ .
Same as .first(pos), but provided for compatibility with .right_of()
Definition at line 373 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return [0, pos+include_pos[ .
Same as .first(pos+1), but provided for compatibility with .right_of()
Definition at line 382 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
given subs a substring of the current string, get the portion of the current string to the left of it
Definition at line 412 of file substr.hpp.
|
inlinenoexcept |
given subs a substring of the current string, get the portion of the current string to the right of it
Definition at line 426 of file substr.hpp.
|
inline |
|
inline |
trim left ANY of the characters.
Definition at line 458 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c from the right
Definition at line 470 of file substr.hpp.
References c4::yml::npos.
Referenced by c4::basic_substring< C >::trim().
|
inline |
trim right ANY of the characters
Definition at line 482 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c left and right
Definition at line 494 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
trim left and right ANY of the characters
Definition at line 500 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
remove a pattern from the left
Definition at line 507 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
remove a pattern from the right
Definition at line 516 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 530 of file substr.hpp.
Referenced by c4::basic_substring< C >::pair_range().
|
inline |
Definition at line 534 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
count the number of occurrences of c
Definition at line 561 of file substr.hpp.
References c4::yml::npos.
|
inline |
count the number of occurrences of s
Definition at line 575 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
get the substr consisting of the first occurrence of c after pos, or an empty substr if none occurs
Definition at line 589 of file substr.hpp.
References c4::yml::npos.
|
inline |
get the substr consisting of the first occurrence of pattern after pos, or an empty substr if none occurs
Definition at line 596 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 611 of file substr.hpp.
|
inline |
Definition at line 617 of file substr.hpp.
|
inline |
Definition at line 623 of file substr.hpp.
|
inline |
Definition at line 629 of file substr.hpp.
|
inline |
|
inline |
true if the first character of the string is c
Definition at line 667 of file substr.hpp.
|
inline |
true if the first num characters of the string are c
Definition at line 673 of file substr.hpp.
|
inline |
true if the string begins with the given pattern
Definition at line 690 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
true if the first character of the string is any of the given chars
Definition at line 707 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::basic_substring< C >::str.
|
inline |
true if the last character of the string is c
Definition at line 724 of file substr.hpp.
|
inline |
|
inline |
true if the string ends with the given pattern
Definition at line 747 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
true if the last character of the string is any of the given chars
Definition at line 764 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 783 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 795 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 809 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 824 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 886 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 907 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 929 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 950 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
get the range delimited by an open-close pair of characters.
Definition at line 984 of file substr.hpp.
References c4::basic_substring< C >::find(), c4::yml::npos, and c4::basic_substring< C >::sub().
|
inline |
get the range delimited by a single open-close character (eg, quotes).
Definition at line 999 of file substr.hpp.
References c4::yml::npos.
|
inline |
get the range delimited by an open-close pair of characters, with possibly nested occurrences.
No checks for escapes are performed.
Definition at line 1020 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1043 of file substr.hpp.
|
inline |
Definition at line 1065 of file substr.hpp.
|
inline |
Definition at line 1080 of file substr.hpp.
|
inline |
Definition at line 1091 of file substr.hpp.
|
inline |
Definition at line 1104 of file substr.hpp.
|
inline |
get the first span consisting exclusively of non-empty characters
Definition at line 1114 of file substr.hpp.
References c4::yml::npos.
|
inline |
get the first span which can be interpreted as an unsigned integer
Definition at line 1126 of file substr.hpp.
References c4::basic_substring< C >::_first_integral_span(), c4::basic_substring< C >::empty(), and c4::basic_substring< C >::str.
|
inline |
get the first span which can be interpreted as a signed integer
Definition at line 1138 of file substr.hpp.
References c4::basic_substring< C >::_first_integral_span(), c4::basic_substring< C >::empty(), and c4::basic_substring< C >::str.
|
inline |
Definition at line 1147 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_int_span(), and c4::basic_substring< C >::first_uint_span().
|
inline |
get the first span which can be interpreted as a real (floating-point) number
Definition at line 1213 of file substr.hpp.
References c4::basic_substring< C >::_first_real_span_bin(), c4::basic_substring< C >::_first_real_span_dec(), c4::basic_substring< C >::_first_real_span_hex(), c4::basic_substring< C >::_first_real_span_oct(), c4::basic_substring< C >::_word_follows(), c4::basic_substring< C >::empty(), c4::basic_substring< C >::len, and c4::basic_substring< C >::str.
|
inlinestaticconstexprnoexcept |
true if the character is a delimiter character at the end
Definition at line 1268 of file substr.hpp.
|
inlinestaticconstexprnoexcept |
true if the character is in [0-9a-fA-F]
Definition at line 1276 of file substr.hpp.
|
inlinenoexcept |
Definition at line 1281 of file substr.hpp.
References c4::basic_substring< C >::len.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1291 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1378 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1468 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1558 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inline |
returns true if the string has not been exhausted yet, meaning it's ok to call next_split() again.
When no instance of sep exists in the string, returns the full string. When the input is an empty string, the output string is the empty string.
Definition at line 1658 of file substr.hpp.
|
inline |
|
inline |
pop right: return the first split from the right.
Use gpop_left() to get the reciprocal part.
Definition at line 1774 of file substr.hpp.
References c4::yml::npos.
|
inline |
return the first split from the left.
Use gpop_right() to get the reciprocal part.
Definition at line 1827 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop left.
eg, csubstr("a/b/c").gpop_left('/')="c"
Definition at line 1882 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop right.
eg, csubstr("a/b/c").gpop_right('/')="a"
Definition at line 1904 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1932 of file substr.hpp.
|
inline |
Definition at line 1939 of file substr.hpp.
|
inline |
Definition at line 1946 of file substr.hpp.
|
inline |
Definition at line 1951 of file substr.hpp.
|
inline |
Definition at line 1956 of file substr.hpp.
|
inline |
Definition at line 1961 of file substr.hpp.
|
inline |
convert the string to upper-case
Definition at line 1975 of file substr.hpp.
|
inline |
convert the string to lower-case
Definition at line 1985 of file substr.hpp.
|
inline |
fill the entire contents with the given val
Definition at line 1997 of file substr.hpp.
|
inline |
set the current substring to a copy of the given csubstr
Definition at line 2009 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
|
inline |
revert a subpart in place
Definition at line 2034 of file substr.hpp.
|
inline |
revert a range in place
Definition at line 2044 of file substr.hpp.
|
inline |
erase part of the string.
eg, with char s[] = "0123456789", substr(s).erase(3, 2) = "01256789", and s is now "01245678989"
Definition at line 2057 of file substr.hpp.
|
inline |
Definition at line 2066 of file substr.hpp.
|
inline |
erase a part of the string.
sub must be a substring of this string Definition at line 2075 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::basic_substring< C >::str.
|
inline |
replace every occurrence of character value with the character repl
Definition at line 2087 of file substr.hpp.
References c4::yml::npos.
|
inline |
replace every occurrence of each character in value with the character repl.
Definition at line 2103 of file substr.hpp.
References c4::yml::npos.
|
inline |
replace pattern with repl, and write the result into dst.
pattern and repl don't need equal sizes.
<
<
Definition at line 2121 of file substr.hpp.
References _c4append, c4::basic_substring< C >::begin(), c4::basic_substring< C >::empty(), c4::basic_substring< C >::end(), c4::yml::npos, c4::basic_substring< C >::overlaps(), and c4::basic_substring< C >::size().
| C* c4::basic_substring< C >::str |
a restricted pointer to the first character of the substring
Definition at line 77 of file substr.hpp.
Referenced by c4::basic_substring< C >::begins_with_any(), c4::basic_substring< C >::copy_from(), c4::basic_substring< C >::erase(), c4::basic_substring< C >::find(), c4::basic_substring< C >::first_int_span(), c4::basic_substring< C >::first_not_of(), c4::basic_substring< C >::first_real_span(), c4::basic_substring< C >::first_uint_span(), c4::basic_substring< C >::last_not_of(), and c4::operator<<().
| size_t c4::basic_substring< C >::len |
the length of the substring
Definition at line 79 of file substr.hpp.
Referenced by c4::basic_substring< C >::_word_follows(), c4::basic_substring< C >::begins_with(), c4::basic_substring< C >::begins_with_any(), c4::basic_substring< C >::copy_from(), c4::basic_substring< C >::count(), c4::basic_substring< C >::ends_with(), c4::basic_substring< C >::ends_with_any(), c4::basic_substring< C >::erase(), c4::basic_substring< C >::find(), c4::basic_substring< C >::first_not_of(), c4::basic_substring< C >::first_of(), c4::basic_substring< C >::first_real_span(), c4::basic_substring< C >::last_not_of(), c4::basic_substring< C >::last_of(), c4::operator<<(), c4::basic_substring< C >::select(), c4::basic_substring< C >::stripl(), and c4::basic_substring< C >::stripr().