![]() |
SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
|
#include <KV1Binary.h>


Public Types | |
| using | iterator = std::vector<KV1BinaryElement>::iterator |
| using | const_iterator = std::vector<KV1BinaryElement>::const_iterator |
Public Member Functions | |
| KV1BinaryElement ()=default | |
| std::string_view | getKey () const |
| Get the key associated with the element. | |
| void | setKey (std::string_view key_) |
| Set the key associated with the element. | |
| const KV1BinaryValue & | getValue () const |
| Get the value associated with the element. | |
| template<KV1BinaryValueNoChildren V> | |
| std::optional< V > | getValue () const |
| Get the value associated with the element as the given type. | |
| void | setValue (KV1BinaryValue value_) |
| Set the value associated with the element. | |
| KV1BinaryElement & | operator= (KV1BinaryValue value_) |
| Set the value associated with the element. | |
| template<KV1BinaryValueNoChildren V> | |
| void | setValue (V value_) |
| Set the value associated with the element. | |
| template<KV1BinaryValueNoChildren V> | |
| KV1BinaryElement & | operator= (V value_) |
| Set the value associated with the element. | |
| bool | hasChild (std::string_view childKey) const |
| Check if the element has one or more children with the given name. | |
| KV1BinaryElement & | addChild (std::string_view key_, KV1BinaryValue value_={}) |
| Add a child element to the element. | |
| template<KV1BinaryValueNoChildren V> | |
| KV1BinaryElement & | addChild (std::string_view key_, V value_={}) |
| Add a child element to the element. | |
| 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< KV1BinaryElement > & | getChildren () const |
| Get the child elements of the element. | |
| std::vector< KV1BinaryElement > & | getChildren () |
| Get the child elements of the element. | |
| constexpr iterator | begin () |
| constexpr iterator | end () |
| constexpr const_iterator | begin () const |
| constexpr const_iterator | end () const |
| constexpr const_iterator | cbegin () const |
| constexpr const_iterator | cend () const |
| const KV1BinaryElement & | operator[] (unsigned int n) const |
| Get the child element of the element at the given index. | |
| KV1BinaryElement & | operator[] (unsigned int n) |
| Get the child element of the element at the given index. | |
| const KV1BinaryElement & | operator[] (std::string_view childKey) const |
| Get the first child element of the element with the given key. | |
| KV1BinaryElement & | 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. | |
| const KV1BinaryElement & | operator() (std::string_view childKey) const |
| Get the first child element of the element with the given key. | |
| KV1BinaryElement & | 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. | |
| const KV1BinaryElement & | operator() (std::string_view childKey, unsigned int n) const |
| Get the nth child element of the element with the given key. | |
| KV1BinaryElement & | 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 (unsigned int n) |
| Remove a child element from the element. | |
| void | removeChild (std::string_view childKey, int n=-1) |
| Remove a child element from the element with the given key. -1 means all children with the given key. | |
| bool | isInvalid () const |
| Check if the given element is invalid. | |
| operator bool () const | |
Static Public Member Functions | |
| static const KV1BinaryElement & | getInvalid () |
Protected Attributes | |
| std::string | key |
| KV1BinaryValue | value |
| std::vector< KV1BinaryElement > | children |
Definition at line 48 of file KV1Binary.h.
| using kvpp::KV1BinaryElement::const_iterator = std::vector<KV1BinaryElement>::const_iterator |
Definition at line 127 of file KV1Binary.h.
| using kvpp::KV1BinaryElement::iterator = std::vector<KV1BinaryElement>::iterator |
Definition at line 117 of file KV1Binary.h.
|
default |
| KV1BinaryElement & KV1BinaryElement::addChild | ( | std::string_view | key_, |
| KV1BinaryValue | value_ = {} ) |
Add a child element to the element.
Definition at line 42 of file KV1Binary.cpp.
|
inline |
Add a child element to the element.
Definition at line 97 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 119 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 129 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 137 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 141 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 123 of file KV1Binary.h.
|
inlinenodiscardconstexpr |
Definition at line 133 of file KV1Binary.h.
|
nodiscard |
Get the number of child elements.
Definition at line 50 of file KV1Binary.cpp.
|
nodiscard |
Get the number of child elements with the given key.
Definition at line 54 of file KV1Binary.cpp.
|
nodiscard |
Get the child elements of the element.
Definition at line 68 of file KV1Binary.cpp.
|
nodiscard |
Get the child elements of the element.
Definition at line 64 of file KV1Binary.cpp.
|
static |
Definition at line 161 of file KV1Binary.cpp.
|
nodiscard |
Get the key associated with the element.
Definition at line 17 of file KV1Binary.cpp.
|
nodiscard |
Get the value associated with the element.
Definition at line 25 of file KV1Binary.cpp.
|
inlinenodiscard |
Get the value associated with the element as the given type.
Definition at line 63 of file KV1Binary.h.
|
nodiscard |
Check if the element has one or more children with the given name.
Definition at line 38 of file KV1Binary.cpp.
|
nodiscard |
Check if the given element is invalid.
Definition at line 157 of file KV1Binary.cpp.
|
explicitnodiscard |
Definition at line 166 of file KV1Binary.cpp.
|
nodiscard |
Get the first child element of the element with the given key, or create a new element if it doesn't exist.
Definition at line 97 of file KV1Binary.cpp.
|
nodiscard |
Get the first child element of the element with the given key.
Definition at line 88 of file KV1Binary.cpp.
|
nodiscard |
Get the nth child element of the element with the given key, or create a new element if it doesn't exist.
Definition at line 121 of file KV1Binary.cpp.
|
nodiscard |
Get the nth child element of the element with the given key.
Definition at line 106 of file KV1Binary.cpp.
| KV1BinaryElement & KV1BinaryElement::operator= | ( | KV1BinaryValue | value_ | ) |
Set the value associated with the element.
Definition at line 33 of file KV1Binary.cpp.
|
inline |
Set the value associated with the element.
Definition at line 84 of file KV1Binary.h.
|
nodiscard |
Get the first child element of the element with the given key, or create a new element if it doesn't exist.
Definition at line 84 of file KV1Binary.cpp.
|
nodiscard |
Get the first child element of the element with the given key.
Definition at line 80 of file KV1Binary.cpp.
|
nodiscard |
Get the child element of the element at the given index.
Definition at line 76 of file KV1Binary.cpp.
|
nodiscard |
Get the child element of the element at the given index.
Definition at line 72 of file KV1Binary.cpp.
| void KV1BinaryElement::removeChild | ( | std::string_view | childKey, |
| int | n = -1 ) |
Remove a child element from the element with the given key. -1 means all children with the given key.
Definition at line 142 of file KV1Binary.cpp.
| void KV1BinaryElement::removeChild | ( | unsigned int | n | ) |
Remove a child element from the element.
Definition at line 136 of file KV1Binary.cpp.
| void KV1BinaryElement::setKey | ( | std::string_view | key_ | ) |
Set the key associated with the element.
Definition at line 21 of file KV1Binary.cpp.
| void KV1BinaryElement::setValue | ( | KV1BinaryValue | value_ | ) |
Set the value associated with the element.
Definition at line 29 of file KV1Binary.cpp.
|
inline |
Set the value associated with the element.
Definition at line 78 of file KV1Binary.h.
|
protected |
Definition at line 185 of file KV1Binary.h.
|
protected |
Definition at line 183 of file KV1Binary.h.
|
protected |
Definition at line 184 of file KV1Binary.h.