|
void | setKey (std::string_view key_) |
| Set the key associated with the element.
|
|
template<KV1ValueType V> |
void | setValue (V value_) |
| Set the value associated with the element.
|
|
template<KV1ValueType V> |
KV1ElementWritable & | operator= (V value_) |
| Set the value associated with the element.
|
|
void | setConditional (std::string_view conditional_) |
| Set the conditional associated with the element.
|
|
template<KV1ValueType V = std::string_view> |
KV1ElementWritable & | addChild (std::string_view key_, V value_={}, std::string_view conditional_="") |
|
KV1ElementWritable & | operator[] (unsigned int n) |
| Get the child element of the element at the given index.
|
|
KV1ElementWritable & | operator[] (std::string_view childKey) |
| Get the first child element of the element with the given key, or create a new element if it doesn't exist.
|
|
KV1ElementWritable & | operator() (std::string_view childKey) |
| Get the first child element of the element with the given key, or create a new element if it doesn't exist.
|
|
KV1ElementWritable & | operator() (std::string_view childKey, unsigned int n) |
| Get the nth child element of the element with the given key, or create a new element if it doesn't exist.
|
|
void | removeChild (std::string_view childKey, int n=-1) |
| Remove a child element from the element. -1 means all children with the given key.
|
|
std::string_view | getKey () const |
| Get the key associated with the element.
|
|
std::string_view | getValue () const |
| Get the value associated with the element.
|
|
template<KV1ValueType V> |
V | getValue () const |
| Get the value associated with the element as the given type.
|
|
std::string_view | getConditional () const |
| Get the conditional associated with the element.
|
|
bool | hasChild (std::string_view childKey) const |
| Check if the element has one or more children with the given name.
|
|
uint64_t | getChildCount () const |
| Get the number of child elements.
|
|
uint64_t | getChildCount (std::string_view childKey) const |
| Get the number of child elements with the given key.
|
|
const std::vector< K > & | getChildren () const |
| Get the child elements of the element.
|
|
const KV1ElementBase & | operator[] (unsigned int n) const |
| Get the child element of the element at the given index.
|
|
const KV1ElementBase & | operator[] (std::string_view childKey) const |
| Get the first child element of the element with the given key.
|
|
const KV1ElementBase & | operator() (std::string_view childKey) const |
| Get the first child element of the element with the given key.
|
|
const KV1ElementBase & | operator() (std::string_view childKey, unsigned int n) const |
| Get the nth child element of the element with the given key.
|
|
bool | isInvalid () const |
| Check if the given element is invalid.
|
|
template<typename S = std::string>
requires std::convertible_to<S, std::string_view>
class kvpp::KV1ElementWritable< S >
Definition at line 204 of file KV1.h.