arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/utility/dynamic_string_view.hpp>
Public Types | |
using | value_type = string::value_type |
! Value type | |
using | allocator_type = string::allocator_type |
! Allocator type | |
using | size_type = string::size_type |
! Size type | |
using | difference_type = string::difference_type |
! Difference type | |
using | const_reference = string::const_reference |
! Reference type | |
using | const_pointer = string::const_pointer |
! Pointer type | |
using | const_iterator = std::string_view::const_iterator |
! Iterator type | |
Public Member Functions | |
dynamic_string_view (std::string_view sv={}) noexcept | |
dynamic_string_view (const char *str) noexcept | |
dynamic_string_view (string &&str) noexcept | |
dynamic_string_view (const dynamic_string_view &other) | |
dynamic_string_view (dynamic_string_view &&other) noexcept | |
dynamic_string_view & | operator= (dynamic_string_view other) |
void | convert_to_internal_storage () |
operator std::string_view () const noexcept | |
bool | operator== (const dynamic_string_view &other) const noexcept |
bool | operator!= (const dynamic_string_view &other) const noexcept |
template<typename T , typename = std::enable_if_t<!std::is_same_v<std::decay_t<T>, dynamic_string_view>>> | |
dynamic_string_view & | operator+= (T &&other) |
size_type | size () const noexcept |
size_type | internal_storage_size () const noexcept |
bool | empty () const noexcept |
const_iterator | begin () const noexcept |
const_iterator | end () const noexcept |
Friends | |
void | swap (dynamic_string_view &a, dynamic_string_view &b) |
A view that can own the memory pointed at by the view if required.
This is a view until the user needs to modify the string, at which point the string data is copied into internal storage.
Definition at line 19 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Default constructor.
View is assigned from sv and internal storage is empty.
sv | Initial view data, or empty |
Definition at line 36 of file dynamic_string_view.hpp.
|
inlinenoexcept |
String literal constructor.
View is assigned from str and internal storage is empty.
str | Initial view data, or empty |
Definition at line 44 of file dynamic_string_view.hpp.
|
inlinenoexcept |
String move constructor.
str is moved into internal storage. View is set to point to the internal storage.
str | Initial string data |
Definition at line 52 of file dynamic_string_view.hpp.
|
inline |
Copy constructor.
If other is just a view, this instance will be duplicate. Otherwise the internal storage is copied too and the view updated to match
other | Instance to copy from |
Definition at line 60 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Move constructor.
other | Instance to move from |
Definition at line 71 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Definition at line 160 of file dynamic_string_view.hpp.
|
inline |
Copy the view data into internal storage and update the view to match.
Does nothing if already in internal storage.
Definition at line 91 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Definition at line 157 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Definition at line 162 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Definition at line 155 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Implicit conversion operator for std::string_view.
Definition at line 104 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Inequality operator.
other | Instance to compare against |
Definition at line 121 of file dynamic_string_view.hpp.
|
inline |
In-place concatenation operator.
T | Type of other |
other | String-like instance to append |
Definition at line 134 of file dynamic_string_view.hpp.
|
inline |
Assignment operator.
other | Instance to copy or move from |
Definition at line 81 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Equality operator.
other | Instance to compare against |
Definition at line 111 of file dynamic_string_view.hpp.
|
inlinenoexcept |
Definition at line 153 of file dynamic_string_view.hpp.
|
friend |
Swaps a and b.
a | First instance |
b | Second instance |
Definition at line 169 of file dynamic_string_view.hpp.