Flow123d
release_3.0.0-1210-g1d9e2bd
|
#include <format.h>
Public Member Functions | |
BasicStringRef (const Char *s, std::size_t size) | |
BasicStringRef (const Char *s) | |
BasicStringRef (const std::basic_string< Char > &s) | |
std::basic_string< Char > | to_string () const |
const Char * | data () const |
std::size_t | size () const |
int | compare (BasicStringRef other) const |
Private Attributes | |
const Char * | data_ |
std::size_t | size_ |
Friends | |
bool | operator== (BasicStringRef lhs, BasicStringRef rhs) |
bool | operator!= (BasicStringRef lhs, BasicStringRef rhs) |
bool | operator< (BasicStringRef lhs, BasicStringRef rhs) |
bool | operator<= (BasicStringRef lhs, BasicStringRef rhs) |
bool | operator> (BasicStringRef lhs, BasicStringRef rhs) |
bool | operator>= (BasicStringRef lhs, BasicStringRef rhs) |
A string reference. It can be constructed from a C string or std::string
.
You can use one of the following typedefs for common character types:
+---------—+----------------------—+ | Type | Definition | +============+=========================+ | StringRef | BasicStringRef<char> | +---------—+----------------------—+ | WStringRef | BasicStringRef<wchar_t> | +---------—+----------------------—+
This class is most useful as a parameter type to allow passing different types of strings to a function, for example::
template <typename... Args> std::string format(StringRef format_str, const Args & ... args);
format("{}", 42); format(std::string("{}"), 42);
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |