Fixed-size string field backed by std::array.
More...
#include <crunch_string.hpp>
|
|
using | ValueType = std::string_view |
| |
|
|
constexpr | String (std::string_view sv) |
| |
|
constexpr std::string_view | get () const noexcept |
| |
|
constexpr std::optional< Error > | set (std::string_view sv) noexcept |
| |
|
constexpr void | clear () noexcept |
| |
|
constexpr bool | operator== (const String &other) const noexcept |
| |
|
constexpr auto | Validate (FieldId id=0) const noexcept -> std::optional< Error > |
| |
|
|
static constexpr auto | Validate (std::string_view v, FieldId id=0) noexcept -> std::optional< Error > |
| |
|
|
std::array< char, MaxSize > | buffer_ {} |
| |
|
std::size_t | current_len_ {0} |
| |
|
|
static constexpr std::size_t | max_size = MaxSize |
| |
template<std::size_t MaxSize, typename... Validators>
requires ((Validator<Validators, std::string_view> && ...) && (sizeof...(Validators) > 0))
class Crunch::fields::String< MaxSize, Validators >
Fixed-size string field backed by std::array.
- Template Parameters
-
| MaxSize | Maximum capacity of the string (compile-time). |
| Validators | Zero or more validators (e.g., Length, OneOf). |
The documentation for this class was generated from the following file: