![]() |
VR-Link API Documentation for HLA Evolved
|
Class to read JSON configuration files containing configuration for the DtEnumDictionary. More...
Collaboration diagram for DtEnumDictionaryConfig:Public Member Functions | |
| DtEnumDictionaryConfig () | |
| Constructor. More... | |
| virtual | ~DtEnumDictionaryConfig () |
| Destructor. More... | |
| DtEnumDictionaryConfig (const DtEnumDictionaryConfig &orig) | |
| Copy constructor. More... | |
| DtEnumDictionaryConfig & | operator= (const DtEnumDictionaryConfig &orig) |
| Assignment operator. More... | |
| virtual bool | loadConfigFile (const DtFilename &filename) |
| Load configuration from JSON file. More... | |
| virtual bool | getEntityDescriptionSettings (const DtEntityType &entityType, std::vector< DtEntityTypeField > &fields) const |
| Get the entity type description settings for a specific entity type. More... | |
| virtual bool | getEntityDescriptionSettings (const DtString &entityTypeStr, std::vector< DtEntityTypeField > &fields) const |
| Get the entity type description settings for a specific entity type by string. More... | |
| virtual void | getDefaultDescriptionSettings (std::vector< DtEntityTypeField > &fields) const |
| Get the default entity type description settings, used when no entity-specific entry matches. More... | |
| virtual void | clear () |
| Clear all loaded configuration. More... | |
| virtual size_t | size () const |
| Get the number of configured entity types. More... | |
Protected Member Functions | |
| virtual bool | parseJsonContent (const std::string &jsonContent) |
| Parse JSON content from string. More... | |
| virtual bool | readFileContent (const DtFilename &filename, std::string &content) |
| Read file content into string. More... | |
| virtual bool | extractJsonValue (const std::string &json, const std::string &key, std::string &value) |
| Simple JSON value extraction helper. More... | |
| virtual bool | parseJsonArray (const std::string &arrayStr, std::vector< DtEntityTypeField > &fields) const |
| Parse a JSON array of field name strings into a vector of DtEntityTypeField values. More... | |
| virtual bool | parseEntityTypeField (const std::string &fieldStr, DtEntityTypeField &field) const |
| Parse a field name string into a DtEntityTypeField enum value. More... | |
| std::string | trim (const std::string &str) const |
Protected Attributes | |
| std::map< DtEntityType, std::vector< DtEntityTypeField > > | myEntityConfigMap |
| Map of entity types to their associated entity type field settings. More... | |
| std::vector< DtEntityTypeField > | myDefaultFields |
| Default field settings, used when no entity-specific entry matches. More... | |
Class to read JSON configuration files containing configuration for the DtEnumDictionary.
The configuration file contains settings for how to generate entity type descriptions for different entity types. It allows specifying which fields of the entity type should be concatenated to form the description, and it supports default settings as well as specific settings for particular entity types or patterns of entity types. An example of what a configuration file might look like:
| DtEnumDictionaryConfig::DtEnumDictionaryConfig | ( | ) |
Constructor.
|
virtual |
Destructor.
| DtEnumDictionaryConfig::DtEnumDictionaryConfig | ( | const DtEnumDictionaryConfig & | orig | ) |
Copy constructor.
|
virtual |
Clear all loaded configuration.
|
protectedvirtual |
Simple JSON value extraction helper.
| json | JSON string |
| key | Key to find |
| value | Output value |
|
virtual |
Get the default entity type description settings, used when no entity-specific entry matches.
| fields | Vector of entity type fields that should be concatenated to form the description. |
|
virtual |
Get the entity type description settings for a specific entity type.
| entityType | The entity type to look up |
| fields | Vector of entity type fields that should be concatenated to form the description. |
|
virtual |
Get the entity type description settings for a specific entity type by string.
| entityTypeStr | Entity type in format "1:2:3:4:5:6:7" or "1.2.3.4.5.6.7" |
| fields | Vector of entity type fields that should be concatenated to form the description. |
|
virtual |
Load configuration from JSON file.
| filename | Path to JSON configuration file |
| DtEnumDictionaryConfig& DtEnumDictionaryConfig::operator= | ( | const DtEnumDictionaryConfig & | orig | ) |
Assignment operator.
|
protectedvirtual |
Parse a field name string into a DtEntityTypeField enum value.
| fieldStr | Field name string (e.g. "kind", "domain", "country", etc.) |
| field | Output field enum value |
|
protectedvirtual |
Parse a JSON array of field name strings into a vector of DtEntityTypeField values.
| arrayStr | JSON array string like ["kind", "domain"] |
| fields | Output vector to receive the parsed field values |
|
protectedvirtual |
Parse JSON content from string.
| jsonContent | The JSON content as string |
|
protectedvirtual |
Read file content into string.
| filename | Path to file |
| content | Output string to receive file content |
|
virtual |
Get the number of configured entity types.
|
protected |
|
protected |
Default field settings, used when no entity-specific entry matches.
|
protected |
Map of entity types to their associated entity type field settings.