|
rapidyaml
0.11.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 (C const *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) |
| copy a string to this substr, starting at 0 More... | |
| void | copy_from (ro_substr that, size_t ifirst, size_t num=npos) |
| copy a string to this substr, starting at a specified given position 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 73 of file substr.hpp.
| using c4::basic_substring< C >::CC = typename std::add_const<C>::type |
CC=const char.
Definition at line 87 of file substr.hpp.
| using c4::basic_substring< C >::NCC_ = typename std::remove_const<C>::type |
NCC_=non const char.
Definition at line 88 of file substr.hpp.
| using c4::basic_substring< C >::ro_substr = basic_substring<CC> |
Definition at line 90 of file substr.hpp.
| using c4::basic_substring< C >::rw_substr = basic_substring<NCC_> |
Definition at line 91 of file substr.hpp.
| using c4::basic_substring< C >::char_type = C |
Definition at line 93 of file substr.hpp.
| using c4::basic_substring< C >::size_type = size_t |
Definition at line 94 of file substr.hpp.
| using c4::basic_substring< C >::iterator = C* |
Definition at line 96 of file substr.hpp.
| using c4::basic_substring< C >::const_iterator = CC* |
Definition at line 97 of file substr.hpp.
| using c4::basic_substring< C >::split_proxy = split_proxy_impl |
Definition at line 1771 of file substr.hpp.
| anonymous enum : size_t |
|
inlineconstexprnoexcept |
Definition at line 115 of file substr.hpp.
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 119 of file substr.hpp.
|
inlineconstexprnoexcept |
Construct from an array.
Definition at line 138 of file substr.hpp.
|
inlinenoexcept |
Construct from a pointer and length.
Definition at line 141 of file substr.hpp.
|
inlinenoexcept |
Construct from two pointers.
Definition at line 145 of file substr.hpp.
|
inlinenoexcept |
Construct from a C-string (zero-terminated string)
Definition at line 153 of file substr.hpp.
|
inlinenoexcept |
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 123 of file substr.hpp.
|
inlinenoexcept |
Definition at line 125 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 159 of file substr.hpp.
|
inlinenoexcept |
Assign from a pointer and length.
Definition at line 162 of file substr.hpp.
|
inlinenoexcept |
Assign from two pointers.
Definition at line 166 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 174 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 179 of file substr.hpp.
|
inlinenoexcept |
Assign from a C-string (zero-terminated string)
Definition at line 187 of file substr.hpp.
|
inlinenoexcept |
Definition at line 196 of file substr.hpp.
|
inlinenoexcept |
Definition at line 197 of file substr.hpp.
|
inlinenoexcept |
Definition at line 198 of file substr.hpp.
|
inlinenoexcept |
Definition at line 199 of file substr.hpp.
|
inlinenoexcept |
Definition at line 201 of file substr.hpp.
|
inlinenoexcept |
Definition at line 202 of file substr.hpp.
|
inlinenoexcept |
Definition at line 204 of file substr.hpp.
|
inlinenoexcept |
Definition at line 205 of file substr.hpp.
|
inlinenoexcept |
Definition at line 207 of file substr.hpp.
|
inlinenoexcept |
Definition at line 208 of file substr.hpp.
|
inlinenoexcept |
Definition at line 210 of file substr.hpp.
|
inlinenoexcept |
Definition at line 211 of file substr.hpp.
|
inlinenoexcept |
Definition at line 213 of file substr.hpp.
|
inlinenoexcept |
Definition at line 214 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 235 of file substr.hpp.
|
inlinenoexcept |
|
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 |
Definition at line 287 of file substr.hpp.
|
inlinenoexcept |
Definition at line 288 of file substr.hpp.
|
inlinenoexcept |
Definition at line 289 of file substr.hpp.
|
inlinenoexcept |
Definition at line 290 of file substr.hpp.
|
inlinenoexcept |
Definition at line 291 of file substr.hpp.
|
inlinenoexcept |
Definition at line 292 of file substr.hpp.
|
inlinenoexcept |
true if *this is a substring of that (ie, from the same buffer)
Definition at line 302 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
true if there is overlap of at least one element between that and *this
Definition at line 317 of file substr.hpp.
|
inlinenoexcept |
return [first,len[
Definition at line 326 of file substr.hpp.
|
inlinenoexcept |
return [first,first+num[.
If num==npos, return [first,len[
Definition at line 333 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return [first,last[.
If last==npos, return [first,len[
Definition at line 343 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the first num elements: [0,num[
Definition at line 353 of file substr.hpp.
References c4::yml::npos.
|
inlinenoexcept |
return the last num elements: [len-num,len[
Definition at line 360 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 371 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 380 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 389 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 419 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 433 of file substr.hpp.
|
inline |
|
inline |
trim left ANY of the characters.
Definition at line 465 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c from the right
Definition at line 477 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim right ANY of the characters
Definition at line 489 of file substr.hpp.
References c4::yml::npos.
|
inline |
trim the character c left and right
Definition at line 501 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
trim left and right ANY of the characters
Definition at line 507 of file substr.hpp.
References c4::basic_substring< C >::trimr().
|
inline |
remove a pattern from the left
Definition at line 514 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
remove a pattern from the right
Definition at line 523 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 537 of file substr.hpp.
|
inline |
Definition at line 541 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 568 of file substr.hpp.
References c4::yml::npos.
|
inline |
count the number of occurrences of s
Definition at line 582 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 596 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 603 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 618 of file substr.hpp.
|
inline |
Definition at line 624 of file substr.hpp.
|
inline |
Definition at line 630 of file substr.hpp.
|
inline |
Definition at line 636 of file substr.hpp.
|
inline |
|
inline |
true if the first character of the string is c
Definition at line 674 of file substr.hpp.
|
inline |
true if the first num characters of the string are c
Definition at line 686 of file substr.hpp.
|
inline |
true if the string begins with the given pattern
Definition at line 703 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 720 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 737 of file substr.hpp.
|
inline |
|
inline |
true if the string ends with the given pattern
Definition at line 760 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 777 of file substr.hpp.
References c4::basic_substring< C >::len.
|
inline |
Definition at line 796 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 808 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 822 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
Definition at line 837 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::yml::npos.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 899 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 920 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 942 of file substr.hpp.
References c4::basic_substring< C >::len, c4::yml::npos, and c4::basic_substring< C >::str.
|
inline |
Definition at line 963 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 997 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 1012 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 1033 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1056 of file substr.hpp.
|
inline |
Definition at line 1078 of file substr.hpp.
|
inline |
Definition at line 1093 of file substr.hpp.
|
inline |
Definition at line 1104 of file substr.hpp.
|
inline |
Definition at line 1117 of file substr.hpp.
|
inline |
get the first span consisting exclusively of non-empty characters
Definition at line 1127 of file substr.hpp.
References c4::yml::npos.
|
inline |
get the first span which can be interpreted as an unsigned integer
Definition at line 1139 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 1151 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 1160 of file substr.hpp.
|
inline |
get the first span which can be interpreted as a real (floating-point) number
Definition at line 1226 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 1281 of file substr.hpp.
|
inlinestaticconstexprnoexcept |
true if the character is in [0-9a-fA-F]
Definition at line 1289 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1304 of file substr.hpp.
|
inlinenoexcept |
Definition at line 1391 of file substr.hpp.
|
inlinenoexcept |
Definition at line 1481 of file substr.hpp.
|
inlinenoexcept |
Definition at line 1571 of file substr.hpp.
|
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 1671 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 1787 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 1840 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop left.
eg, csubstr("a/b/c").gpop_left('/')="c"
Definition at line 1895 of file substr.hpp.
References c4::yml::npos.
|
inline |
greedy pop right.
eg, csubstr("a/b/c").gpop_right('/')="a"
Definition at line 1917 of file substr.hpp.
References c4::yml::npos.
|
inline |
Definition at line 1945 of file substr.hpp.
|
inline |
Definition at line 1952 of file substr.hpp.
|
inline |
Definition at line 1959 of file substr.hpp.
|
inline |
Definition at line 1964 of file substr.hpp.
|
inline |
Definition at line 1969 of file substr.hpp.
|
inline |
Definition at line 1974 of file substr.hpp.
|
inline |
convert the string to upper-case
Definition at line 1988 of file substr.hpp.
|
inline |
convert the string to lower-case
Definition at line 1998 of file substr.hpp.
|
inline |
fill the entire contents with the given val
Definition at line 2010 of file substr.hpp.
|
inline |
copy a string to this substr, starting at 0
Definition at line 2020 of file substr.hpp.
References c4::basic_substring< C >::len, and c4::basic_substring< C >::str.
|
inline |
copy a string to this substr, starting at a specified given position
Definition at line 2033 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 2058 of file substr.hpp.
|
inline |
revert a range in place
Definition at line 2068 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 2081 of file substr.hpp.
|
inline |
Definition at line 2090 of file substr.hpp.
|
inline |
erase a part of the string.
sub must be a substring of this string Definition at line 2099 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 2111 of file substr.hpp.
References c4::yml::npos.
|
inline |
replace every occurrence of each character in value with the character repl.
Definition at line 2127 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 2145 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 78 of file substr.hpp.
| size_t c4::basic_substring< C >::len |
the length of the substring
Definition at line 80 of file substr.hpp.