| Flow 2.0.0
    Flow project: Full implementation reference. | 
Essentially alias for a C++17-conforming string-view class template, which is a very lightweight std::string-like representation of a character sequence already in memory.  
 More...
#include <string_view.hpp>
| Public Types | |
| using | Base = std::basic_string_view< Ch, Traits > | 
| Short-hand for the base. We add no data of our own in this subclass, just a handful of APIs.  More... | |
| Public Member Functions | |
| constexpr | Basic_string_view () noexcept | 
| Constructs null view: identical to Base API. | |
| constexpr | Basic_string_view (Ch const *s, size_t count) | 
| Constructs view to string at given start location and length: identical to Base API.  More... | |
| constexpr | Basic_string_view (Ch const *s) | 
| Constructs view to given NUL-terminated string: identical to Base API.  More... | |
| constexpr | Basic_string_view (const Basic_string_view &s) noexcept | 
| Boring copy constructor: identical to Base API.  More... | |
| constexpr | Basic_string_view (Base s) | 
| Identical to copy constructor but converts from a vanilla Base.  More... | |
| Basic_string_view (const std::basic_string< Ch, Traits > &s) | |
| Constructs view directly into a std::basic_string(e.g.,std::string).  More... | |
| constexpr Basic_string_view & | operator= (const Basic_string_view &s) noexcept | 
| Boring copy assignment: identical to Base API.  More... | |
| bool | starts_with (Basic_string_view needle) const | 
| Equivalent to C++20 basic_string_view::starts_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
| bool | starts_with (Ch const *needle) const | 
| Equivalent to C++20 basic_string_view::starts_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
| bool | starts_with (Ch needle) const | 
| Equivalent to C++20 basic_string_view::starts_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
| bool | ends_with (Basic_string_view needle) const | 
| Equivalent to C++20 basic_string_view::ends_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
| bool | ends_with (Ch const *needle) const | 
| Equivalent to C++20 basic_string_view::ends_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
| bool | ends_with (Ch needle) const | 
| Equivalent to C++20 basic_string_view::ends_with()which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalentstring_view.  More... | |
Essentially alias for a C++17-conforming string-view class template, which is a very lightweight std::string-like representation of a character sequence already in memory. 
As of March 2022 the alias is formally to std::basic_string_view (unlike in the past, when that was not available – until C++17). However the alias remains to, at least, avoid breaking user code – by providing the String_view related alias. In addition this API-only subclass adds starts_with() and ends_with() which implement the common-sense C++20 basic_string_view operations starts_with() and ends_width(). These existed in the Boost basic_string_view that, pre-C++17, used to be the String_view alias target (when Ch is char). The downgrade due to their lack of inclusion in C++17 (which inaugurated *string_view in C++ STL) is unfortunate; but these replacements are fine.
std::string_view what the present template is to std::basic_string_view. I.e., when working with char string sequences, which is typical, use String_view.Why is this even a thing? Why not use std::basic_string_view and std::string_view all over? Answer: It is mostly historic. Flow was C++14 until ~3/2022. std::string_view was added in C++17. Before then, String_view aliased to boost::string_view (another possibility would have been boost::string_ref – same API – long story), because it was available for C++14. Now that we're on C++17, it's better to use the std thing, especially since many STL (and Boost, nowadays) APIs take std::string_view directly. Hence the alias changed as planned all along.
However the type alias remains. Pragmatically: much code uses String_view, even outside Flow, and there's no harm in an alias, particularly since we add the nice starts_with() and ends_with(). The alias was actively useful before; now removing it is a breaking change.
It would have been ideal to define the various constructors by simply inheriting all of std::basic_string_view ctors via the single statement using Base::Base. However, at least with our gcc, it appears to cause some issue in propagating constexprness of these constructors (which is effectively used, at least, by the flow::log macros to make certain optimizations possible): compile errors. To avoid this and various conversion issues, a number of constructors are explicitly (re)defined. 
Definition at line 67 of file string_view.hpp.
| using flow::util::Basic_string_view< Ch, Traits >::Base = std::basic_string_view<Ch, Traits> | 
Short-hand for the base. We add no data of our own in this subclass, just a handful of APIs.
Definition at line 74 of file string_view.hpp.
| 
 | constexpr | 
Constructs view to string at given start location and length: identical to Base API.
Definition at line 196 of file string_view.hpp.
| 
 | constexpr | 
Constructs view to given NUL-terminated string: identical to Base API.
| s | See Base API. | 
Definition at line 203 of file string_view.hpp.
| 
 | constexprdefaultnoexcept | 
| 
 | constexpr | 
Identical to copy constructor but converts from a vanilla Base.
| s | See copy constructor. | 
Definition at line 210 of file string_view.hpp.
| flow::util::Basic_string_view< Ch, Traits >::Basic_string_view | ( | const std::basic_string< Ch, Traits > & | s | ) | 
Constructs view directly into a std::basic_string (e.g., std::string). 
basic_string has a conversion operator to basic_string_view but technically not to our slight embellishment thereof, Basic_string_view. 
| s | Self-explanatory. | 
Definition at line 216 of file string_view.hpp.
| bool flow::util::Basic_string_view< Ch, Traits >::ends_with | ( | Basic_string_view< Ch, Traits > | needle | ) | const | 
Equivalent to C++20 basic_string_view::ends_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible postfix within *this. | 
*this contains needle as postfix. Definition at line 267 of file string_view.hpp.
| bool flow::util::Basic_string_view< Ch, Traits >::ends_with | ( | Ch const * | needle | ) | const | 
Equivalent to C++20 basic_string_view::ends_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible postfix within *this. | 
*this contains needle as postfix. Definition at line 288 of file string_view.hpp.
| bool flow::util::Basic_string_view< Ch, Traits >::ends_with | ( | Ch | needle | ) | const | 
Equivalent to C++20 basic_string_view::ends_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible postfix within *this. | 
*this contains needle as postfix. Definition at line 295 of file string_view.hpp.
| 
 | constexprdefaultnoexcept | 
| bool flow::util::Basic_string_view< Ch, Traits >::starts_with | ( | Basic_string_view< Ch, Traits > | needle | ) | const | 
Equivalent to C++20 basic_string_view::starts_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible prefix within *this. | 
*this contains needle as prefix. Definition at line 231 of file string_view.hpp.
| bool flow::util::Basic_string_view< Ch, Traits >::starts_with | ( | Ch const * | needle | ) | const | 
Equivalent to C++20 basic_string_view::starts_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible prefix within *this. | 
*this contains needle as prefix. Definition at line 251 of file string_view.hpp.
| bool flow::util::Basic_string_view< Ch, Traits >::starts_with | ( | Ch | needle | ) | const | 
Equivalent to C++20 basic_string_view::starts_with() which is lacking in C++17 but present in C++20 and previously-used-in-Flow Boost equivalent string_view. 
| needle | Possible prefix within *this. | 
*this contains needle as prefix. Definition at line 261 of file string_view.hpp.