|
rapidyaml
0.7.2
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 75 of file substr.hpp.
| using c4::basic_substring< C >::CC = typename std::add_const<C>::type |
CC=const char.
Definition at line 89 of file substr.hpp.
| using c4::basic_substring< C >::NCC_ = typename std::remove_const<C>::type |
NCC_=non const char.
Definition at line 90 of file substr.hpp.
| using c4::basic_substring< C >::ro_substr = basic_substring<CC> |
Definition at line 92 of file substr.hpp.
| using c4::basic_substring< C >::rw_substr = basic_substring<NCC_> |
Definition at line 93 of file substr.hpp.
| using c4::basic_substring< C >::char_type = C |
Definition at line 95 of file substr.hpp.
| using c4::basic_substring< C >::size_type = size_t |
Definition at line 96 of file substr.hpp.
| using c4::basic_substring< C >::iterator = C* |
Definition at line 98 of file substr.hpp.
| using c4::basic_substring< C >::const_iterator = CC* |
Definition at line 99 of file substr.hpp.
| using c4::basic_substring< C >::split_proxy = split_proxy_impl |
Definition at line 1761 of file substr.hpp.
| anonymous enum : size_t |
|
inlineconstexprnoexcept |
Definition at line 117 of file substr.hpp.
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 121 of file substr.hpp.
|
inlineconstexprnoexcept |
Construct from an array.
Definition at line 140 of file substr.hpp.
|
inlinenoexcept |
Construct from a pointer and length.
Definition at line 143 of file substr.hpp.
|
inlinenoexcept |
Construct from two pointers.
Definition at line 147 of file substr.hpp.
|
inlinenoexcept |
Construct from a C-string (zero-terminated string)
Definition at line 155 of file substr.hpp.
|
inlinenoexcept |
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 125 of file substr.hpp.
|
inlinenoexcept |
Definition at line 127 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 161 of file substr.hpp.
|
inlinenoexcept |
Assign from a pointer and length.
Definition at line 164 of file substr.hpp.
|
inlinenoexcept |
Assign from two pointers.
Definition at line 168 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 176 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 181 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 189 of file substr.hpp.
|
inlinenoexcept |
Definition at line 198 of file substr.hpp.
|
inlinenoexcept |
Definition at line 199 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 200 of file substr.hpp.
|
inlinenoexcept |
Definition at line 201 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 204 of file substr.hpp.
Referenced by c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
Definition at line 206 of file substr.hpp.
|
inlinenoexcept |
Definition at line 207 of file substr.hpp.
|
inlinenoexcept |
Definition at line 209 of file substr.hpp.
Referenced by c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator==().
|
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 |
Definition at line 215 of file substr.hpp.
|
inlinenoexcept |
Definition at line 216 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 237 of file substr.hpp.
|
inlinenoexcept |
Definition at line 264 of file substr.hpp.
References c4::basic_substring< C >::compare().
Referenced by c4::basic_substring< C >::compare().
|
inlinenoexcept |
Definition at line 266 of file substr.hpp.
|
inlinenoexcept |
Definition at line 267 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 272 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 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 279 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 283 of file substr.hpp.
|
inlinenoexcept |
Definition at line 284 of file substr.hpp.
|
inlinenoexcept |
Definition at line 285 of file substr.hpp.
|
inlinenoexcept |
Definition at line 286 of file substr.hpp.
|
inlinenoexcept |
Definition at line 287 of file substr.hpp.
|
inlinenoexcept |
Definition at line 288 of file substr.hpp.
|
inlinenoexcept |
true if *this is a substring of that (ie, from the same buffer)
Definition at line 298 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
true if there is overlap of at least one element between that and *this
Definition at line 313 of file substr.hpp.
Referenced by c4::basic_substring< C >::replace_all().
|
inlinenoexcept |
return [first,len[
Definition at line 322 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 329 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return [first,last[.
If last==npos, return [first,len[
Definition at line 339 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the first num elements: [0,num[
Definition at line 349 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the last num elements: [len-num,len[
Definition at line 356 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 367 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 376 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 385 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 415 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 429 of file substr.hpp.
|
inline |
|
inline |
trim left ANY of the characters.
Definition at line 461 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c from the right
Definition at line 473 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 485 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c left and right
Definition at line 497 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
trim left and right ANY of the characters
Definition at line 503 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
remove a pattern from the left
Definition at line 510 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
remove a pattern from the right
Definition at line 519 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 533 of file substr.hpp.
Referenced by c4::basic_substring< C >::pair_range().
|
inline |
Definition at line 537 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 564 of file substr.hpp.
References c4::yml::npos.
|
inline |
count the number of occurrences of s
Definition at line 578 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 592 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 599 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 614 of file substr.hpp.
|
inline |
Definition at line 620 of file substr.hpp.
|
inline |
Definition at line 626 of file substr.hpp.
|
inline |
Definition at line 632 of file substr.hpp.
|
inline |
|
inline |
true if the first character of the string is c
Definition at line 670 of file substr.hpp.
|
inline |
true if the first num characters of the string are c
Definition at line 676 of file substr.hpp.
|
inline |
true if the string begins with the given pattern
Definition at line 693 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 710 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 727 of file substr.hpp.
|
inline |
|
inline |
true if the string ends with the given pattern
Definition at line 750 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 767 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 786 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 798 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 812 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 827 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 889 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 910 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 932 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 953 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 987 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 1002 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 1023 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1046 of file substr.hpp.
|
inline |
Definition at line 1068 of file substr.hpp.
|
inline |
Definition at line 1083 of file substr.hpp.
|
inline |
Definition at line 1094 of file substr.hpp.
|
inline |
Definition at line 1107 of file substr.hpp.
|
inline |
get the first span consisting exclusively of non-empty characters
Definition at line 1117 of file substr.hpp.
References c4::yml::npos.
|
inline |
get the first span which can be interpreted as an unsigned integer
Definition at line 1129 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 1141 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 1150 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 1216 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 1271 of file substr.hpp.
|
inlinestaticconstexprnoexcept |
true if the character is in [0-9a-fA-F]
Definition at line 1279 of file substr.hpp.
|
inlinenoexcept |
Definition at line 1284 of file substr.hpp.
References c4::basic_substring< C >::len.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1294 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1381 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1471 of file substr.hpp.
Referenced by c4::basic_substring< C >::first_real_span().
|
inlinenoexcept |
Definition at line 1561 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 1661 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 1777 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 1830 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop left.
eg, csubstr("a/b/c").gpop_left('/')="c"
Definition at line 1885 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop right.
eg, csubstr("a/b/c").gpop_right('/')="a"
Definition at line 1907 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1935 of file substr.hpp.
|
inline |
Definition at line 1942 of file substr.hpp.
|
inline |
Definition at line 1949 of file substr.hpp.
|
inline |
Definition at line 1954 of file substr.hpp.
|
inline |
Definition at line 1959 of file substr.hpp.
|
inline |
Definition at line 1964 of file substr.hpp.
|
inline |
convert the string to upper-case
Definition at line 1978 of file substr.hpp.
|
inline |
convert the string to lower-case
Definition at line 1988 of file substr.hpp.
|
inline |
fill the entire contents with the given val
Definition at line 2000 of file substr.hpp.
|
inline |
set the current substring to a copy of the given csubstr
Definition at line 2012 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 2037 of file substr.hpp.
|
inline |
revert a range in place
Definition at line 2047 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 2060 of file substr.hpp.
|
inline |
Definition at line 2069 of file substr.hpp.
|
inline |
erase a part of the string.
sub must be a substring of this string Definition at line 2078 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 2090 of file substr.hpp.
References c4::yml::npos.
|
inline |
replace every occurrence of each character in value with the character repl.
Definition at line 2106 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 2124 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 80 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 82 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().