General Utility Library for C++14
2.11
|
A string view that can automatically convert numbers into strings.
This class is primarily intended for use as a parameter in gul14::cat(). For string-like arguments, it acts similar to gul14::string_view. Number-like arguments (double, int, ...) are converted into strings in a default format using std::to_string. Arguments of type char are converted into a string of length 1.
#include <cat.h>
Public Member Functions | |
ConvertingStringView (const std::string &str) | |
Construct a ConvertingStringView from a std::string. | |
ConvertingStringView (string_view sv) | |
Construct a ConvertingStringView from a string_view. | |
ConvertingStringView (const char *str) | |
Construct a ConvertingStringView from a const char *. | |
ConvertingStringView (char c) | |
Construct a ConvertingStringView from a character. | |
ConvertingStringView (int a) | |
Construct a ConvertingStringView from an integer. | |
ConvertingStringView (unsigned int a) | |
Construct a ConvertingStringView from an unsigned integer. | |
ConvertingStringView (long a) | |
Construct a ConvertingStringView from a long integer. | |
ConvertingStringView (unsigned long a) | |
Construct a ConvertingStringView from an unsigned long integer. | |
ConvertingStringView (long long a) | |
Construct a ConvertingStringView from a long long integer. | |
ConvertingStringView (unsigned long long a) | |
Construct a ConvertingStringView from an unsigned long long integer. | |
ConvertingStringView (float a) | |
Construct a ConvertingStringView from a float. | |
ConvertingStringView (double a) | |
Construct a ConvertingStringView from a double. | |
const char * | data () const noexcept |
Return a pointer to the internal character buffer. More... | |
std::size_t | length () const noexcept |
Return the length of the string. | |
std::size_t | size () const noexcept |
Return the length of the string. | |
operator std::string () const | |
Construct a std::string from this ConvertingStringView. | |
|
inlinenoexcept |
Return a pointer to the internal character buffer.
The contained string is usually not null-terminated.
Referenced by gul14::cat().