|
rapidyaml 0.15.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. | |
| basic_substring (C *s_, size_t len_) noexcept | |
| Construct from a pointer and length. | |
| basic_substring (C *beg_, C *end_) noexcept | |
| Construct from two pointers. | |
| template<class CharPtr, typename std::enable_if< can_borrow_char_ptr< CharPtr, C >::value, int >::type = 0> | |
| basic_substring (CharPtr s_) noexcept | |
| Construct from a C-string (zero-terminated string). | |
| template<size_t N> | |
| void | assign (C(&s_)[N]) noexcept |
| Assign from an array. | |
| void | assign (C *s_, size_t len_) noexcept |
| Assign from a pointer and length. | |
| void | assign (C *beg_, C *end_) noexcept |
| Assign from two pointers. | |
| template<class CharPtr, typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type = 0> | |
| void | assign (CharPtr s_) noexcept |
| Assign from a C-string (zero-terminated string of type const C* or C*). | |
| template<size_t N> | |
| basic_substring & | operator= (C(&s_)[N]) noexcept |
| Assign from an array. | |
| template<class CharPtr, typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type = 0> | |
| basic_substring & | operator= (CharPtr s_) noexcept |
| Assign from a C-string (zero-terminated string of type const C* or C*). | |
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 |
| template<class CharPtr> | |
| auto | compare (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class U> | |
| int | compare (basic_substring< U > 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(&arr)[N]) const noexcept |
| template<size_t N> | |
| bool | operator!= (const char(&arr)[N]) const noexcept |
| template<size_t N> | |
| bool | operator< (const char(&arr)[N]) const noexcept |
| template<size_t N> | |
| bool | operator> (const char(&arr)[N]) const noexcept |
| template<size_t N> | |
| bool | operator<= (const char(&arr)[N]) const noexcept |
| template<size_t N> | |
| bool | operator>= (const char(&arr)[N]) const noexcept |
| template<class CharPtr> | |
| auto | operator== (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class CharPtr> | |
| auto | operator!= (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class CharPtr> | |
| auto | operator< (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class CharPtr> | |
| auto | operator> (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class CharPtr> | |
| auto | operator<= (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
| template<class CharPtr> | |
| auto | operator>= (CharPtr c_str) const noexcept -> typename std::enable_if< is_compatible_char_ptr< CharPtr, C >::value, int >::type |
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) | |
| bool | is_super (ro_substr const that) const noexcept |
| true if that is a substring of *this (ie, from the same buffer) | |
| bool | overlaps (ro_substr const that) const noexcept |
| true if there is overlap of at least one element between that and *this | |
| basic_substring | sub (size_t first) const noexcept |
| return [first,len[ | |
| basic_substring | sub (size_t first, size_t num) const noexcept |
| return [first,first+num[. | |
| basic_substring | range (size_t first, size_t last=npos) const noexcept |
| return [first,last[. | |
| basic_substring | first (size_t num) const noexcept |
return the first num elements: [0,num[ | |
| basic_substring | last (size_t num) const noexcept |
return the last num elements: [len-num,len[ | |
| 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. | |
| basic_substring | left_of (size_t pos) const noexcept |
| return [0, pos[ . | |
| basic_substring | left_of (size_t pos, bool include_pos) const noexcept |
| return [0, pos+include_pos[ . | |
| basic_substring | right_of (size_t pos) const noexcept |
| return [pos+1, len[ | |
| basic_substring | right_of (size_t pos, bool include_pos) const noexcept |
| return [pos+!include_pos, len[ | |
| 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 | |
| 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 | |
Removing characters (trim()) / patterns (strip()) from the tips of the string | |
| basic_substring | triml (const C c) const |
| trim left | |
| basic_substring | triml (ro_substr chars) const |
| trim left ANY of the characters. | |
| basic_substring | trimr (const C c) const |
| trim the character c from the right | |
| basic_substring | trimr (ro_substr chars) const |
| trim right ANY of the characters | |
| basic_substring | trim (const C c) const |
| trim the character c left and right | |
| basic_substring | trim (ro_substr const chars) const |
| trim left and right ANY of the characters | |
| basic_substring | stripl (ro_substr pattern) const |
| remove a pattern from the left | |
| basic_substring | stripr (ro_substr pattern) const |
| remove a pattern from the right | |
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 | |
| size_t | count (ro_substr c, size_t pos=0) const |
| count the number of occurrences of s | |
| 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 | |
| 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 | |
| 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 noexcept |
true if the first character of the string is c | |
| bool | begins_with (const C c, size_t num) const noexcept |
true if the first num characters of the string are c | |
| bool | begins_with (ro_substr pattern) const noexcept |
true if the string begins with the given pattern | |
| bool | begins_with_any (ro_substr chars) const noexcept |
true if the first character of the string is any of the given chars | |
| bool | ends_with (const C c) const noexcept |
true if the last character of the string is c | |
| bool | ends_with (const C c, const size_t num) const noexcept |
true if the last num characters of the string are c | |
| bool | ends_with (ro_substr pattern) const noexcept |
true if the string ends with the given pattern | |
| bool | ends_with_any (ro_substr chars) const noexcept |
true if the last character of the string is any of the given chars | |
| 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. | |
| basic_substring | pair_range_esc (CC open_close, CC escape=CC('\\')) |
| get the range delimited by a single open-close character (eg, quotes). | |
| 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. | |
| 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) | |
| template<typename U = C> | |
| auto | toupper () -> typename std::enable_if< ! std::is_const< U >::value, void >::type |
| convert the string to upper-case | |
| template<typename U = C> | |
| auto | tolower () -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| convert the string to lower-case | |
| template<typename U = C> | |
| auto | fill (C val) -> typename std::enable_if< !std::is_const< U >::value, void >::type |
fill the entire contents with the given val | |
| template<typename U = C> | |
| auto | copy_from (ro_substr that) -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| copy a string to this substr, starting at 0 | |
| template<typename U = C> | |
| auto | copy_from (ro_substr that, size_t ifirst, size_t num=npos) -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| copy a string to this substr, starting at a specified given position | |
| template<typename U = C> | |
| auto | reverse () -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| reverse in place | |
| template<typename U = C> | |
| auto | reverse_sub (size_t ifirst, size_t num) -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| revert a subpart in place | |
| template<typename U = C> | |
| auto | reverse_range (size_t ifirst, size_t ilast) -> typename std::enable_if< !std::is_const< U >::value, void >::type |
| revert a range in place | |
| template<typename U = C> | |
| auto | erase (size_t pos, size_t num) -> typename std::enable_if< !std::is_const< U >::value, basic_substring >::type |
| erase part of the string. | |
| template<typename U = C> | |
| auto | erase_range (size_t first, size_t last) -> typename std::enable_if< !std::is_const< U >::value, basic_substring >::type |
| template<typename U = C> | |
| auto | erase (ro_substr sub) -> typename std::enable_if< !std::is_const< U >::value, basic_substring >::type |
| erase a part of the string. | |
| template<typename U = C> | |
| auto | replace (C value, C repl, size_t pos=0) -> typename std::enable_if< ! std::is_const< U >::value, size_t >::type |
replace every occurrence of character value with the character repl | |
| template<typename U = C> | |
| auto | replace (ro_substr chars, C repl, size_t pos=0) -> typename std::enable_if< ! std::is_const< U >::value, size_t >::type |
replace every occurrence of each character in value with the character repl. | |
| 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. | |
Public Attributes | |
| C * | str |
| a restricted pointer to the first character of the substring | |
| size_t | len |
| the length of the substring | |
Types | |
| enum | : size_t { npos = (size_t)-1 , NONE = (size_t)-1 } |
| using | CC = typename std::add_const<C>::type |
| CC=const char. | |
| using | NCC_ = typename std::remove_const<C>::type |
| NCC_=non const char. | |
| using | ro_substr = basic_substring<CC> |
| using | rw_substr = basic_substring<NCC_> |
| using | value_type = C |
| 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 from substr (of C) to csubstr (of const C) | |
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. | |
| split_proxy | split (C sep, size_t start_pos=0) const |
| a view into the splits | |
| basic_substring | pop_right (C sep=C('/'), bool skip_empty=false) const |
| pop right: return the first split from the right. | |
| basic_substring | pop_left (C sep=C('/'), bool skip_empty=false) const |
| return the first split from the left. | |
| basic_substring | gpop_left (C sep=C('/'), bool skip_empty=false) const |
| greedy pop left. | |
| basic_substring | gpop_right (C sep=C('/'), bool skip_empty=false) const |
| greedy pop right. | |
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 | |
| basic_substring | first_uint_span () const |
| get the first span which can be interpreted as an unsigned integer | |
| basic_substring | first_int_span () const |
| get the first span which can be interpreted as a signed integer | |
| 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 | |
| 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 | |
| static constexpr C4_CONST bool | _is_hex_char (char c) noexcept |
| true if the character is in [0-9a-fA-F] | |
a non-owning string-view, consisting of a character pointer and a length.
Definition at line 211 of file substr.hpp.
| using c4::basic_substring< C >::CC = typename std::add_const<C>::type |
CC=const char.
Definition at line 225 of file substr.hpp.
| using c4::basic_substring< C >::NCC_ = typename std::remove_const<C>::type |
NCC_=non const char.
Definition at line 226 of file substr.hpp.
| using c4::basic_substring< C >::ro_substr = basic_substring<CC> |
Definition at line 228 of file substr.hpp.
| using c4::basic_substring< C >::rw_substr = basic_substring<NCC_> |
Definition at line 229 of file substr.hpp.
| using c4::basic_substring< C >::value_type = C |
Definition at line 231 of file substr.hpp.
| using c4::basic_substring< C >::char_type = C |
Definition at line 232 of file substr.hpp.
| using c4::basic_substring< C >::size_type = size_t |
Definition at line 233 of file substr.hpp.
| using c4::basic_substring< C >::iterator = C* |
Definition at line 235 of file substr.hpp.
| using c4::basic_substring< C >::const_iterator = CC* |
Definition at line 236 of file substr.hpp.
| using c4::basic_substring< C >::split_proxy = split_proxy_impl |
Definition at line 1909 of file substr.hpp.
| anonymous enum : size_t |
| Enumerator | |
|---|---|
| npos | |
| NONE | |
Definition at line 238 of file substr.hpp.
|
inlineconstexprnoexcept |
Definition at line 255 of file substr.hpp.
Referenced by c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator*(), and c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator->().
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 259 of file substr.hpp.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Construct from a C-string (zero-terminated string).
Definition at line 293 of file substr.hpp.
|
inlinenoexcept |
convert automatically from substr (of C) to csubstr (of const C)
Definition at line 242 of file substr.hpp.
|
inlinedefaultnoexcept |
|
inlinedefaultnoexcept |
|
inlinenoexcept |
Definition at line 263 of file substr.hpp.
|
inlinenoexcept |
Definition at line 265 of file substr.hpp.
|
inlinenoexcept |
Assign from an array.
Definition at line 300 of file substr.hpp.
Referenced by c4::yml::NodeRef::operator=().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Assign from a C-string (zero-terminated string of type const C* or C*).
Definition at line 315 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Assign from a C-string (zero-terminated string of type const C* or C*).
Definition at line 337 of file substr.hpp.
|
inlinenoexcept |
Definition at line 355 of file substr.hpp.
|
inlinenoexcept |
Definition at line 356 of file substr.hpp.
Referenced by c4::yml::Tree::add_tag_directive(), c4::basic_substring< CC >::first_int_span(), c4::basic_substring< CC >::first_real_span(), c4::basic_substring< CC >::first_uint_span(), c4::yml::location_format(), c4::yml::location_format_with_context(), c4::yml::Tree::lookup_path(), c4::basic_substring< CC >::replace_all(), sample_error_basic(), sample_error_parse(), sample_error_visit(), sample_fundamental_types(), sample_quick_overview(), sample_tree_arena(), c4::to_csubstr(), and c4::to_substr().
|
inlinenoexcept |
Definition at line 357 of file substr.hpp.
|
inlinenoexcept |
Definition at line 358 of file substr.hpp.
Referenced by c4::catrs_append(), c4::catseprs_append(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), c4::formatrs_append(), c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator==(), c4::basic_substring< CC >::replace_all(), sample_formatting(), sample_substr(), and sample_tree_arena().
|
inlinenoexcept |
Definition at line 360 of file substr.hpp.
Referenced by c4::atoi_first(), c4::atou_first(), c4::from_chars(), c4::basic_substring< CC >::replace_all(), IntsResult::reset_yaml(), and c4::to_chars().
|
inlinenoexcept |
Definition at line 361 of file substr.hpp.
Referenced by c4::atod_first(), c4::atof_first(), c4::atoi_first(), c4::atou_first(), c4::from_chars(), c4::from_chars_first(), c4::from_chars_first(), c4::basic_substring< CC >::replace_all(), IntsResult::reset_yaml(), and c4::to_chars().
|
inlinenoexcept |
Definition at line 363 of file substr.hpp.
|
inlinenoexcept |
Definition at line 364 of file substr.hpp.
|
inlinenoexcept |
Definition at line 366 of file substr.hpp.
Referenced by c4::basic_substring< C >::split_proxy_impl::split_iterator_impl::operator==(), sample_substr(), and sample_tree_arena().
|
inlinenoexcept |
Definition at line 367 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 375 of file substr.hpp.
Referenced by sample_substr().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 385 of file substr.hpp.
Referenced by c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator!=(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator<=(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator==(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>(), c4::operator>=(), c4::operator>=(), c4::operator>=(), c4::operator>=(), c4::operator>=(), c4::operator>=(), c4::operator>=(), and c4::operator>=().
|
inlinenoexcept |
Definition at line 394 of file substr.hpp.
|
inlinenoexcept |
Definition at line 427 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 439 of file substr.hpp.
|
inlinenoexcept |
Definition at line 440 of file substr.hpp.
|
inlinenoexcept |
Definition at line 442 of file substr.hpp.
|
inlinenoexcept |
Definition at line 443 of file substr.hpp.
|
inlinenoexcept |
Definition at line 444 of file substr.hpp.
|
inlinenoexcept |
Definition at line 445 of file substr.hpp.
|
inlinenoexcept |
Definition at line 446 of file substr.hpp.
|
inlinenoexcept |
Definition at line 447 of file substr.hpp.
|
inlinenoexcept |
Definition at line 449 of file substr.hpp.
|
inlinenoexcept |
Definition at line 450 of file substr.hpp.
|
inlinenoexcept |
Definition at line 451 of file substr.hpp.
|
inlinenoexcept |
Definition at line 452 of file substr.hpp.
|
inlinenoexcept |
Definition at line 453 of file substr.hpp.
|
inlinenoexcept |
Definition at line 454 of file substr.hpp.
|
inlinenoexcept |
Definition at line 456 of file substr.hpp.
|
inlinenoexcept |
Definition at line 457 of file substr.hpp.
|
inlinenoexcept |
Definition at line 458 of file substr.hpp.
|
inlinenoexcept |
Definition at line 459 of file substr.hpp.
|
inlinenoexcept |
Definition at line 460 of file substr.hpp.
|
inlinenoexcept |
Definition at line 461 of file substr.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
true if *this is a substring of that (ie, from the same buffer)
Definition at line 478 of file substr.hpp.
Referenced by sample_formatting(), sample_substr(), and sample_tree_arena().
|
inlinenoexcept |
true if that is a substring of *this (ie, from the same buffer)
Definition at line 484 of file substr.hpp.
Referenced by sample_substr(), and sample_tree_arena().
|
inlinenoexcept |
true if there is overlap of at least one element between that and *this
Definition at line 493 of file substr.hpp.
Referenced by c4::yml::Tree::copy_to_arena(), c4::yml::dump(), c4::yml::escape_scalar(), c4::from_chars_first(), c4::yml::normalize_tag_long(), c4::basic_substring< CC >::replace_all(), c4::yml::TagDirectives::resolve(), sample_formatting(), sample_substr(), and sample_tree_arena().
|
inlinenoexcept |
return [first,len[
Definition at line 502 of file substr.hpp.
Referenced by c4::yml::extra::EventHandlerInts::arena_rem(), c4::atod(), c4::atof(), c4::cat(), c4::catrs_append(), c4::catsep(), c4::catseprs_append(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), c4::yml::escape_scalar_fn(), c4::yml::extra::events_ints_to_testsuite(), c4::format(), c4::formatrs_append(), c4::yml::is_valid_tag_handle(), c4::yml::normalize_tag(), c4::yml::normalize_tag_long(), c4::yml::normalize_tag_long(), c4::basic_substring< CC >::pair_range(), c4::yml::TagDirectives::resolve(), sample_substr(), c4::yml::EventHandlerTree::set_key_ref(), c4::yml::extra::EventHandlerInts::set_key_ref(), c4::yml::EventHandlerTree::set_val_ref(), c4::yml::extra::EventHandlerInts::set_val_ref(), c4::skip_bom(), c4::skip_bom(), c4::to_chars(), c4::to_chars(), c4::yml::to_tag(), c4::yml::transform_tag(), c4::uncat(), c4::uncatsep(), and c4::unformat().
|
inlinenoexcept |
return [first,first+num[.
If num==npos, return [first,len[
Definition at line 509 of file substr.hpp.
|
inlinenoexcept |
return [first,last[.
If last==npos, return [first,len[
Definition at line 519 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), c4::catrs_append(), c4::catseprs_append(), c4::yml::escape_scalar_fn(), c4::formatrs_append(), sample_substr(), and c4::yml::transform_tag().
|
inlinenoexcept |
return the first num elements: [0,num[
Definition at line 529 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), c4::yml::extra::EventHandlerInts::arena(), c4::decode_code_point(), c4::get_bom(), c4::get_bom(), c4::yml::normalize_tag_long(), c4::yml::TagDirectives::resolve(), c4::yml::Tree::resolve_tag_sub(), c4::yml::Tree::lookup_result::resolved(), sample_base64(), sample_formatting(), sample_substr(), sample_tree_arena(), c4::yml::serialize_to_arena_scalar(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::yml::extra::ievt::to_str_sub(), and c4::uncatsep().
|
inlinenoexcept |
return the last num elements: [len-num,len[
Definition at line 536 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), c4::yml::extra::EventHandlerInts::arena_rem(), c4::yml::extra::events_ints_to_testsuite(), and sample_substr().
|
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 547 of file substr.hpp.
Referenced by c4::yml::is_valid_tag_handle(), c4::yml::TagDirectives::resolve(), sample_substr(), and c4::yml::to_tag().
|
inlinenoexcept |
return [0, pos[ .
Same as .first(pos), but provided for compatibility with .right_of()
Definition at line 556 of file substr.hpp.
Referenced by sample_substr().
|
inlinenoexcept |
return [0, pos+include_pos[ .
Same as .first(pos+1), but provided for compatibility with .right_of()
Definition at line 565 of file substr.hpp.
|
inlinenoexcept |
return [pos+1, len[
Definition at line 574 of file substr.hpp.
Referenced by sample_substr().
|
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 595 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 609 of file substr.hpp.
|
inline |
trim left
Definition at line 629 of file substr.hpp.
Referenced by sample_substr(), c4::yml::Tree::set_key_anchor(), and c4::yml::Tree::set_val_anchor().
|
inline |
|
inline |
trim the character c from the right
Definition at line 653 of file substr.hpp.
Referenced by sample_substr().
|
inline |
|
inline |
trim the character c left and right
Definition at line 677 of file substr.hpp.
Referenced by sample_substr().
|
inline |
|
inline |
remove a pattern from the left
Definition at line 690 of file substr.hpp.
Referenced by sample_substr().
|
inline |
remove a pattern from the right
Definition at line 699 of file substr.hpp.
Referenced by sample_substr().
|
inline |
Definition at line 713 of file substr.hpp.
Referenced by c4::yml::is_custom_tag(), c4::basic_substring< CC >::pair_range(), sample_substr(), and c4::uncatsep().
|
inline |
Definition at line 717 of file substr.hpp.
|
inline |
count the number of occurrences of c
Definition at line 744 of file substr.hpp.
Referenced by sample_substr().
|
inline |
|
inline |
get the substr consisting of the first occurrence of c after pos, or an empty substr if none occurs
Definition at line 772 of file substr.hpp.
Referenced by sample_substr().
|
inline |
|
inline |
Definition at line 794 of file substr.hpp.
|
inline |
Definition at line 800 of file substr.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 819 of file substr.hpp.
|
inlinenoexcept |
true if the first character of the string is c
Definition at line 850 of file substr.hpp.
Referenced by c4::decode_code_point(), c4::yml::extra::events_ints_to_testsuite(), c4::yml::is_valid_tag_handle(), c4::yml::normalize_tag(), c4::yml::normalize_tag_long(), c4::yml::normalize_tag_long(), c4::yml::TagDirectives::resolve(), sample_location_tracking(), sample_quick_overview(), sample_substr(), c4::yml::EventHandlerTree::set_key_anchor(), c4::yml::EventHandlerTree::set_key_ref(), c4::yml::extra::EventHandlerInts::set_key_ref(), c4::yml::EventHandlerTree::set_val_anchor(), c4::yml::EventHandlerTree::set_val_ref(), c4::yml::extra::EventHandlerInts::set_val_ref(), and c4::yml::to_tag().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
true if the last character of the string is c
Definition at line 894 of file substr.hpp.
Referenced by c4::yml::is_valid_tag_handle(), c4::yml::TagDirectives::resolve(), c4::yml::Tree::lookup_result::resolved(), and sample_substr().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Definition at line 934 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), and sample_substr().
|
inline |
Definition at line 946 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), and sample_substr().
|
inline |
Definition at line 960 of file substr.hpp.
|
inline |
Definition at line 975 of file substr.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 1037 of file substr.hpp.
|
inline |
Definition at line 1058 of file substr.hpp.
|
inline |
Definition at line 1080 of file substr.hpp.
|
inline |
Definition at line 1101 of file substr.hpp.
|
inline |
get the range delimited by an open-close pair of characters.
Definition at line 1135 of file substr.hpp.
|
inline |
get the range delimited by a single open-close character (eg, quotes).
Definition at line 1150 of file substr.hpp.
|
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 1171 of file substr.hpp.
|
inline |
Definition at line 1194 of file substr.hpp.
|
inline |
Definition at line 1216 of file substr.hpp.
|
inline |
Definition at line 1231 of file substr.hpp.
|
inline |
Definition at line 1242 of file substr.hpp.
|
inline |
Definition at line 1255 of file substr.hpp.
|
inline |
get the first span consisting exclusively of non-empty characters
Definition at line 1265 of file substr.hpp.
|
inline |
get the first span which can be interpreted as an unsigned integer
Definition at line 1277 of file substr.hpp.
Referenced by c4::atou_first().
|
inline |
get the first span which can be interpreted as a signed integer
Definition at line 1289 of file substr.hpp.
Referenced by c4::atoi_first().
|
inline |
Definition at line 1298 of file substr.hpp.
Referenced by c4::basic_substring< CC >::first_int_span(), and c4::basic_substring< CC >::first_uint_span().
|
inline |
get the first span which can be interpreted as a real (floating-point) number
Definition at line 1364 of file substr.hpp.
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
Definition at line 1432 of file substr.hpp.
Referenced by c4::basic_substring< CC >::first_real_span().
|
inlinenoexcept |
Definition at line 1442 of file substr.hpp.
Referenced by c4::basic_substring< CC >::first_real_span().
|
inlinenoexcept |
Definition at line 1529 of file substr.hpp.
Referenced by c4::basic_substring< CC >::first_real_span().
|
inlinenoexcept |
Definition at line 1619 of file substr.hpp.
Referenced by c4::basic_substring< CC >::first_real_span().
|
inlinenoexcept |
Definition at line 1709 of file substr.hpp.
Referenced by c4::basic_substring< CC >::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 1809 of file substr.hpp.
|
inline |
a view into the splits
Definition at line 1912 of file substr.hpp.
Referenced by c4::yml::location_format_with_context().
|
inline |
pop right: return the first split from the right.
Use gpop_left() to get the reciprocal part.
Definition at line 1925 of file substr.hpp.
|
inline |
return the first split from the left.
Use gpop_right() to get the reciprocal part.
Definition at line 1978 of file substr.hpp.
|
inline |
greedy pop left.
eg, csubstr("a/b/c").gpop_left('/')="c"
Definition at line 2033 of file substr.hpp.
|
inline |
greedy pop right.
eg, csubstr("a/b/c").gpop_right('/')="a"
Definition at line 2055 of file substr.hpp.
|
inline |
|
inline |
Definition at line 2090 of file substr.hpp.
|
inline |
Definition at line 2097 of file substr.hpp.
|
inline |
Definition at line 2102 of file substr.hpp.
|
inline |
Definition at line 2107 of file substr.hpp.
|
inline |
Definition at line 2112 of file substr.hpp.
|
inline |
convert the string to upper-case
Definition at line 2127 of file substr.hpp.
Referenced by sample_substr().
|
inline |
convert the string to lower-case
Definition at line 2139 of file substr.hpp.
Referenced by sample_substr().
|
inline |
fill the entire contents with the given val
Definition at line 2153 of file substr.hpp.
Referenced by sample_substr(), c4::to_chars(), c4::to_chars(), and c4::to_chars().
|
inline |
copy a string to this substr, starting at 0
Definition at line 2165 of file substr.hpp.
Referenced by c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), and c4::to_chars().
|
inline |
copy a string to this substr, starting at a specified given position
Definition at line 2180 of file substr.hpp.
|
inline |
reverse in place
Definition at line 2199 of file substr.hpp.
Referenced by sample_substr().
|
inline |
revert a subpart in place
Definition at line 2209 of file substr.hpp.
Referenced by sample_substr().
|
inline |
revert a range in place
Definition at line 2221 of file substr.hpp.
Referenced by sample_substr().
|
inline |
erase part of the string.
eg, with char s[] = "0123456789", substr(s).erase(3, 2) = "01256789", and s is now "0125678989"
Definition at line 2236 of file substr.hpp.
|
inline |
Definition at line 2247 of file substr.hpp.
|
inline |
erase a part of the string.
sub must be a substring of this string Definition at line 2258 of file substr.hpp.
|
inline |
replace every occurrence of character value with the character repl
Definition at line 2272 of file substr.hpp.
Referenced by sample_substr().
|
inline |
replace every occurrence of each character in value with the character repl.
Definition at line 2290 of file substr.hpp.
|
inline |
replace pattern with repl, and write the result into dst.
pattern and repl don't need equal sizes.
<
<
Definition at line 2309 of file substr.hpp.
| C* c4::basic_substring< C >::str |
a restricted pointer to the first character of the substring
Definition at line 216 of file substr.hpp.
Referenced by c4::yml::extra::EventHandlerInts::alloc_arena(), c4::atod(), c4::atof(), c4::fmt::base64(), c4::fmt::base64(), c4::cat_sub(), c4::catsep_sub(), c4::fmt::cbase64(), c4::yml::Tree::copy_to_arena(), c4::decode_code_point(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), c4::yml::escape_scalar(), c4::yml::escape_scalar_fn(), c4::yml::extra::estimate_events_ints_size(), c4::yml::estimate_tree_capacity(), c4::yml::extra::events_ints_print(), c4::yml::extra::events_ints_to_testsuite(), c4::basic_substring< CC >::find(), c4::basic_substring< CC >::first_int_span(), c4::basic_substring< CC >::first_not_of(), c4::basic_substring< CC >::first_not_of(), c4::basic_substring< CC >::first_of(), c4::basic_substring< CC >::first_real_span(), c4::basic_substring< CC >::first_uint_span(), c4::yml::format_exc(), c4::yml::format_exc(), c4::yml::format_exc(), c4::format_sub(), c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::from_chars_first(), c4::yml::WriterBuf::get_result(), c4::yml::is_custom_tag(), c4::basic_substring< CC >::last_not_of(), c4::basic_substring< CC >::last_not_of(), c4::yml::Tree::location(), c4::yml::normalize_tag_long(), ErrorHandlerExample::on_error_basic(), ErrorHandlerExample::on_error_parse(), ErrorHandlerExample::on_error_visit(), c4::operator<<(), c4::yml::NodeRef::operator==(), c4::yml::Tree::reserve_arena(), c4::yml::TagDirectives::resolve(), c4::yml::FilterProcessorInplaceEndExtending::result(), c4::yml::FilterProcessorInplaceMidExtending::result(), c4::yml::FilterProcessorSrcDst::result(), sample_create_tree(), sample_deserialize_error(), sample_emit_to_container(), sample_empty_null_values(), sample_error_parse(), sample_error_visit_location(), sample_formatting(), sample_substr(), sample_tree_arena(), c4::yml::serialize_to_arena_str(), c4::yml::extra::EventHandlerInts::set_key_scalar_dquoted(), c4::yml::extra::EventHandlerInts::set_key_scalar_folded(), c4::yml::extra::EventHandlerInts::set_key_scalar_literal(), c4::yml::extra::EventHandlerInts::set_key_scalar_plain(), c4::yml::extra::EventHandlerInts::set_key_scalar_squoted(), c4::yml::extra::EventHandlerInts::set_key_tag(), c4::yml::extra::EventHandlerInts::set_val_scalar_dquoted(), c4::yml::extra::EventHandlerInts::set_val_scalar_folded(), c4::yml::extra::EventHandlerInts::set_val_scalar_literal(), c4::yml::extra::EventHandlerInts::set_val_scalar_plain(), c4::yml::extra::EventHandlerInts::set_val_scalar_squoted(), c4::yml::extra::EventHandlerInts::set_val_tag(), c4::yml::extra::EventHandlerInts::start_parse(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::yml::transform_tag(), and c4::yml::NodeType::type_str_sub().
| size_t c4::basic_substring< C >::len |
the length of the substring
Definition at line 218 of file substr.hpp.
Referenced by c4::yml::detail::_get_text_region(), c4::yml::extra::EventHandlerInts::alloc_arena(), c4::yml::extra::EventHandlerInts::arena(), c4::yml::extra::EventHandlerInts::arena_rem(), c4::atod(), c4::atod_first(), c4::atof(), c4::atof_first(), c4::atoi_first(), c4::atou_first(), c4::fmt::base64(), c4::fmt::base64(), c4::cat(), c4::cat_sub(), c4::catrs(), c4::catrs_append(), c4::catsep(), c4::catsep_sub(), c4::catseprs(), c4::catseprs_append(), c4::fmt::cbase64(), c4::yml::Tree::copy_to_arena(), c4::basic_substring< CC >::count(), c4::decode_code_point(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), c4::yml::escape_scalar(), c4::yml::escape_scalar_fn(), c4::yml::extra::estimate_events_ints_size(), c4::yml::estimate_tree_capacity(), c4::yml::extra::events_ints_print(), c4::yml::extra::events_ints_to_testsuite(), c4::basic_substring< CC >::find(), c4::first_non_bom(), c4::basic_substring< CC >::first_not_of(), c4::basic_substring< CC >::first_not_of(), c4::basic_substring< CC >::first_of(), c4::basic_substring< CC >::first_real_span(), c4::yml::extra::EventHandlerInts::fits_buffers(), c4::format(), c4::yml::format_exc(), c4::yml::format_exc(), c4::yml::format_exc(), c4::format_sub(), c4::formatrs(), c4::formatrs_append(), c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::from_chars(), c4::from_chars_first(), c4::from_chars_first(), c4::from_chars_first(), c4::yml::WriterBuf::get_result(), c4::yml::is_custom_tag(), c4::basic_substring< CC >::last_not_of(), c4::basic_substring< CC >::last_not_of(), c4::basic_substring< CC >::last_of(), c4::yml::location_format(), c4::yml::location_format_with_context(), c4::yml::normalize_tag_long(), ErrorHandlerExample::on_error_basic(), ErrorHandlerExample::on_error_parse(), ErrorHandlerExample::on_error_visit(), c4::operator<<(), c4::yml::NodeRef::operator==(), c4::yml::Tree::reserve_arena(), c4::yml::TagDirectives::resolve(), c4::yml::Tree::resolve_tag_sub(), c4::yml::Tree::lookup_result::resolved(), c4::yml::FilterProcessorInplaceEndExtending::result(), c4::yml::FilterProcessorInplaceMidExtending::result(), c4::yml::FilterProcessorSrcDst::result(), sample_base64(), sample_emit_to_container(), sample_empty_null_values(), sample_error_parse(), sample_error_visit_location(), sample_formatting(), sample_substr(), sample_tree_arena(), c4::basic_substring< CC >::select(), c4::yml::serialize_to_arena_scalar(), c4::yml::serialize_to_arena_str(), c4::yml::EventHandlerTree::set_key_anchor(), c4::yml::EventHandlerTree::set_key_ref(), c4::yml::extra::EventHandlerInts::set_key_scalar_dquoted(), c4::yml::extra::EventHandlerInts::set_key_scalar_folded(), c4::yml::extra::EventHandlerInts::set_key_scalar_literal(), c4::yml::extra::EventHandlerInts::set_key_scalar_plain(), c4::yml::extra::EventHandlerInts::set_key_scalar_squoted(), c4::yml::EventHandlerTree::set_key_tag(), c4::yml::extra::EventHandlerInts::set_key_tag(), c4::yml::EventHandlerTree::set_val_anchor(), c4::yml::EventHandlerTree::set_val_ref(), c4::yml::extra::EventHandlerInts::set_val_scalar_dquoted(), c4::yml::extra::EventHandlerInts::set_val_scalar_folded(), c4::yml::extra::EventHandlerInts::set_val_scalar_literal(), c4::yml::extra::EventHandlerInts::set_val_scalar_plain(), c4::yml::extra::EventHandlerInts::set_val_scalar_squoted(), c4::yml::EventHandlerTree::set_val_tag(), c4::yml::extra::EventHandlerInts::set_val_tag(), c4::yml::extra::EventHandlerInts::start_parse(), c4::basic_substring< CC >::stripl(), c4::basic_substring< CC >::stripr(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::to_chars(), c4::yml::extra::ievt::to_str_sub(), c4::yml::to_tag(), c4::yml::transform_tag(), c4::yml::NodeType::type_str_sub(), c4::uncat(), c4::uncatsep(), and c4::unformat().