|
Lightweight 0.20260303.0
|
#include <SqlFixedString.hpp>
Public Types | |
| using | value_type = T |
| The element type of the string. | |
| using | iterator = T * |
| Iterator type for the string. | |
| using | const_iterator = T const * |
| Const iterator type for the string. | |
| using | pointer_type = T * |
| Pointer type for the string. | |
| using | const_pointer_type = T const * |
| Const pointer type for the string. | |
Public Member Functions | |
| template<std::size_t SourceSize> | |
| constexpr LIGHTWEIGHT_FORCE_INLINE | SqlFixedString (T const (&text)[SourceSize]) |
| Constructs a fixed-size string from a string literal. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString () noexcept=default |
| Defaulted default constructor. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (SqlFixedString const &) noexcept=default |
| Defaulted copy constructor. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr SqlFixedString & | operator= (SqlFixedString const &) noexcept=default |
| Defaulted copy assignment operator. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (SqlFixedString &&) noexcept=default |
| Defaulted move constructor. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr SqlFixedString & | operator= (SqlFixedString &&) noexcept=default |
| Defaulted move assignment operator. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | ~SqlFixedString () noexcept=default |
| Defaulted destructor. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (std::basic_string_view< T > s) noexcept |
| Constructs a fixed-size string from a string view. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (std::basic_string< T > const &s) noexcept |
| Constructs a fixed-size string from a string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (T const *s, std::size_t len) noexcept |
| Constructs a fixed-size string from a string pointer and length. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlFixedString (T const *s, T const *e) noexcept |
| Constructs a fixed-size string from a string pointer and end pointer. | |
| LIGHTWEIGHT_FORCE_INLINE void | reserve (std::size_t capacity) |
| Reserves capacity for the string. Throws if capacity exceeds the maximum. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | empty () const noexcept |
| Tests if the string is empty. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::size_t | size () const noexcept |
| Returns the size of the string. | |
| LIGHTWEIGHT_FORCE_INLINE void | setsize (std::size_t n) noexcept |
| Sets the size of the string, capped at the maximum capacity. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | resize (std::size_t n) noexcept |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::size_t | capacity () const noexcept |
| Returns the maximum capacity of the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | clear () noexcept |
| Clears the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | push_back (T c) noexcept |
| Appends a character to the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | pop_back () noexcept |
| Removes the last character from the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string_view< T > | substr (std::size_t offset=0, std::size_t count=(std::numeric_limits< std::size_t >::max)()) const noexcept |
| Returns a sub string of the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string_view< T > | str () const noexcept |
| Returns a string view of the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr pointer_type | data () noexcept |
| Returns a pointer to the underlying mutable data. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr iterator | begin () noexcept |
| Returns a mutable iterator to the beginning. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr iterator | end () noexcept |
| Returns a mutable iterator to the end. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr T & | operator[] (std::size_t i) noexcept |
| Returns a mutable reference to the element at the given index. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr const_pointer_type | c_str () const noexcept |
| Returns a pointer to the null-terminated C string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr const_pointer_type | data () const noexcept |
| Returns a const pointer to the underlying data. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr const_iterator | begin () const noexcept |
| Returns a const iterator to the beginning. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr const_iterator | end () const noexcept |
| Returns a const iterator to the end. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr T const & | operator[] (std::size_t i) const noexcept |
| Returns a const reference to the element at the given index. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string< T > | ToString () const noexcept |
| Returns a std::basic_string<T> from the string. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr std::basic_string_view< T > | ToStringView () const noexcept |
| Returns a std::basic_string_view<T> from the string. | |
| template<std::size_t OtherSize, SqlFixedStringMode OtherMode> | |
| LIGHTWEIGHT_FORCE_INLINE std::weak_ordering | operator<=> (SqlFixedString< OtherSize, T, OtherMode > const &other) const noexcept |
| Three-way comparison operator. | |
| template<std::size_t OtherSize, SqlFixedStringMode OtherMode> | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | operator== (SqlFixedString< OtherSize, T, OtherMode > const &other) const noexcept |
| Equality comparison operator. | |
| template<std::size_t OtherSize, SqlFixedStringMode OtherMode> | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | operator!= (SqlFixedString< OtherSize, T, OtherMode > const &other) const noexcept |
| Inequality comparison operator. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | operator== (std::basic_string_view< T > other) const noexcept |
| Equality comparison with a string view. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | operator!= (std::basic_string_view< T > other) const noexcept |
| Inequality comparison with a string view. | |
Static Public Attributes | |
| static constexpr std::size_t | Capacity = N |
| The specified width of the string, which is also the maximum size of the string. | |
| static constexpr SqlFixedStringMode | PostRetrieveOperation = Mode |
SQL fixed-capacity string that mimmicks standard library string/string_view with a fixed-size underlying buffer.
The underlying storage will not be guaranteed to be \0-terminated unless a call to mutable/const c_str() has been performed.
Definition at line 40 of file SqlFixedString.hpp.
| using Lightweight::SqlFixedString< N, T, Mode >::value_type = T |
The element type of the string.
Definition at line 48 of file SqlFixedString.hpp.
| using Lightweight::SqlFixedString< N, T, Mode >::iterator = T* |
Iterator type for the string.
Definition at line 51 of file SqlFixedString.hpp.
| using Lightweight::SqlFixedString< N, T, Mode >::const_iterator = T const* |
Const iterator type for the string.
Definition at line 54 of file SqlFixedString.hpp.
| using Lightweight::SqlFixedString< N, T, Mode >::pointer_type = T* |
Pointer type for the string.
Definition at line 57 of file SqlFixedString.hpp.
| using Lightweight::SqlFixedString< N, T, Mode >::const_pointer_type = T const* |
Const pointer type for the string.
Definition at line 60 of file SqlFixedString.hpp.
|
inlineconstexpr |
Constructs a fixed-size string from a string literal.
Definition at line 71 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Constructs a fixed-size string from a string view.
Definition at line 97 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Constructs a fixed-size string from a string.
Definition at line 104 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Constructs a fixed-size string from a string pointer and length.
Definition at line 111 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Constructs a fixed-size string from a string pointer and end pointer.
Definition at line 118 of file SqlFixedString.hpp.
|
inline |
Reserves capacity for the string. Throws if capacity exceeds the maximum.
Definition at line 125 of file SqlFixedString.hpp.
References Lightweight::SqlFixedString< N, T, Mode >::capacity().
|
inlineconstexprnoexcept |
Tests if the string is empty.
Definition at line 132 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns the size of the string.
Definition at line 138 of file SqlFixedString.hpp.
Referenced by Lightweight::SqlFixedString< N, T, Mode >::end(), Lightweight::SqlFixedString< N, T, Mode >::end(), and Lightweight::SqlFixedString< N, T, Mode >::operator<=>().
|
inlinenoexcept |
Sets the size of the string, capped at the maximum capacity.
Definition at line 145 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Resizes the string.
This sets the size of the string to n. If n is greater than the current size, capped at the maximum capacity.
Definition at line 156 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns the maximum capacity of the string.
Definition at line 164 of file SqlFixedString.hpp.
Referenced by Lightweight::SqlFixedString< N, T, Mode >::reserve().
|
inlineconstexprnoexcept |
Clears the string.
Definition at line 170 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Appends a character to the string.
Definition at line 192 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Removes the last character from the string.
Definition at line 202 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a sub string of the string.
Definition at line 209 of file SqlFixedString.hpp.
Referenced by Lightweight::SqlFixedString< N, T, Mode >::operator==().
|
inlineconstexprnoexcept |
Returns a string view of the string.
Definition at line 222 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the underlying mutable data.
Definition at line 229 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a mutable iterator to the beginning.
Definition at line 231 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a mutable iterator to the end.
Definition at line 233 of file SqlFixedString.hpp.
References Lightweight::SqlFixedString< N, T, Mode >::size().
|
inlineconstexprnoexcept |
Returns a mutable reference to the element at the given index.
Definition at line 235 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the null-terminated C string.
Definition at line 238 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a const pointer to the underlying data.
Definition at line 240 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a const iterator to the beginning.
Definition at line 242 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a const iterator to the end.
Definition at line 244 of file SqlFixedString.hpp.
References Lightweight::SqlFixedString< N, T, Mode >::size().
|
inlineconstexprnoexcept |
Returns a const reference to the element at the given index.
Definition at line 246 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a std::basic_string<T> from the string.
Definition at line 250 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Returns a std::basic_string_view<T> from the string.
Definition at line 262 of file SqlFixedString.hpp.
|
inlinenoexcept |
Three-way comparison operator.
Definition at line 275 of file SqlFixedString.hpp.
References Lightweight::SqlFixedString< N, T, Mode >::size().
|
inlineconstexprnoexcept |
Equality comparison operator.
Definition at line 289 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Inequality comparison operator.
Definition at line 296 of file SqlFixedString.hpp.
|
inlineconstexprnoexcept |
Equality comparison with a string view.
Definition at line 302 of file SqlFixedString.hpp.
References Lightweight::SqlFixedString< N, T, Mode >::substr().
|
inlineconstexprnoexcept |
Inequality comparison with a string view.
Definition at line 308 of file SqlFixedString.hpp.
|
staticconstexpr |
The specified width of the string, which is also the maximum size of the string.
Definition at line 63 of file SqlFixedString.hpp.
|
staticconstexpr |
Handling mode for the post-retrieval operation that defines how the string should be treated when it is retrieved from the database.
Definition at line 67 of file SqlFixedString.hpp.