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

Public Types | |
| enum | Encoding { ENCODING_INVALID , ENCODING_BINARY_OLD , ENCODING_BINARY_OLD_SFM , ENCODING_BINARY , ENCODING_BINARY_SEQIDS , ENCODING_KEYVALUES2_OLD , ENCODING_KEYVALUES2_FLAT_OLD , ENCODING_KEYVALUES2 , ENCODING_KEYVALUES2_FLAT , ENCODING_KEYVALUES2_NOIDS } |
| using | iterator = std::vector<DMXElement>::iterator |
| using | const_iterator = std::vector<DMXElement>::const_iterator |
Public Member Functions | |
| DMX (Encoding encodingType_, int encodingVersion_, std::string formatType_, int formatVersion_) | |
| DMX (std::span< const std::byte > dmxData) | |
| DMX (std::string_view dmxData) | |
| operator bool () const | |
| Encoding | getEncodingType () const |
| void | setEncodingType (Encoding encodingType_) |
| bool | doesEncodingTypeHaveUnicodePrefix () const |
| void | shouldEncodingTypeHaveUnicodePrefix (bool encodingTypeHasUnicodePrefix_) |
| int | getEncodingVersion () const |
| void | setEncodingVersion (int encodingVersion_) |
| std::string_view | getFormatType () const |
| void | setFormatType (std::string formatType_) |
| int | getFormatVersion () const |
| void | setFormatVersion (int formatVersion_) |
| DMXElement & | addPrefixAttributeContainer () |
| uint64_t | getPrefixAttributeContainerCount () const |
| Get the number of prefix attributes. | |
| const std::vector< DMXElement > & | getPrefixAttributeContainers () const |
| std::vector< DMXElement > & | getPrefixAttributeContainers () |
| void | removePrefixAttributeContainer (unsigned int n) |
| bool | hasElement (std::string_view key) const |
| Check if the element list has one or more elements with the given name. | |
| DMXElement & | addElement (std::string type, std::string key) |
| Add an element to the element list. | |
| uint64_t | getElementCount () const |
| Get the number of elements. | |
| uint64_t | getElementCount (std::string_view key) const |
| Get the number of elements with the given key. | |
| const std::vector< DMXElement > & | getElements () const |
| std::vector< DMXElement > & | getElements () |
| 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 DMXElement & | operator[] (unsigned int n) const |
| Get the element in the element list at the given index. | |
| DMXElement & | operator[] (unsigned int n) |
| Get the element in the element list at the given index. | |
| const DMXElement & | operator[] (std::string_view key) const |
| Get the first element in the element list with the given key. | |
| DMXElement & | operator[] (std::string_view key) |
| Get the first element in the element list with the given key, or create a new element if it doesn't exist. | |
| const DMXElement & | operator() (std::string_view key) const |
| Get the first element in the element list with the given key. | |
| DMXElement & | operator() (std::string_view key) |
| Get the first element in the element list with the given key, or create a new element if it doesn't exist. | |
| const DMXElement & | operator() (std::string_view key, unsigned int n) const |
| Get the nth element in the element list with the given key. | |
| DMXElement & | operator() (std::string_view key, unsigned int n) |
| Get the nth element in the element list with the given key, or create a new element if it doesn't exist. | |
| void | removeElement (unsigned int n) |
| Remove an element from the element list and update all element references. | |
| std::vector< std::byte > | bake () const |
| void | bake (const std::filesystem::path &dmxPath) const |
Static Public Member Functions | |
| static constexpr bool | isEncodingVersionValid (Encoding encodingType, int encodingVersion) |
| static DMXValue::UUID | createRandomUUID () |
| static const DMXElement & | getInvalidElement () |
Protected Attributes | |
| Encoding | encodingType = ENCODING_INVALID |
| bool | encodingTypeHasUnicodePrefix = false |
| int | encodingVersion = -1 |
| std::string | formatType |
| int | formatVersion = -1 |
| std::vector< DMXElement > | prefixAttributeContainers |
| std::vector< DMXElement > | elements |
| using kvpp::DMX::const_iterator = std::vector<DMXElement>::const_iterator |
| using kvpp::DMX::iterator = std::vector<DMXElement>::iterator |
| enum kvpp::DMX::Encoding |
| DMX::DMX | ( | Encoding | encodingType_, |
| int | encodingVersion_, | ||
| std::string | formatType_, | ||
| int | formatVersion_ ) |
| DMXElement & DMX::addElement | ( | std::string | type, |
| std::string | key ) |
| DMXElement & DMX::addPrefixAttributeContainer | ( | ) |
| void DMX::bake | ( | const std::filesystem::path & | dmxPath | ) | const |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexpr |
|
staticnodiscard |
|
nodiscard |
|
inlinenodiscardconstexpr |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
staticnodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
inlinestaticnodiscardconstexpr |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| void DMX::removeElement | ( | unsigned int | n | ) |
| void DMX::shouldEncodingTypeHaveUnicodePrefix | ( | bool | encodingTypeHasUnicodePrefix_ | ) |
|
protected |
|
protected |
|
protected |
|
protected |