Manages field dictionary and conversions based on JSON configuration.
More...
#include <FieldTranslator.hpp>
Manages field dictionary and conversions based on JSON configuration.
◆ FieldTranslator()
| config::FieldTranslator::FieldTranslator |
( |
| ) |
|
◆ ~FieldTranslator()
| config::FieldTranslator::~FieldTranslator |
( |
| ) |
|
|
default |
◆ FormatTooltip()
| std::string config::FieldTranslator::FormatTooltip |
( |
const std::string & |
templateStr, |
|
|
std::string_view |
original, |
|
|
std::string_view |
converted |
|
) |
| const |
|
private |
◆ GetAllTranslations()
| const std::map< std::string, FieldDictionary > & config::FieldTranslator::GetAllTranslations |
( |
| ) |
const |
Get all dictionary entries.
- Returns
- Map of all field dictionary entries
◆ HasTranslation()
| bool config::FieldTranslator::HasTranslation |
( |
std::string_view |
key | ) |
const |
Check if a field has a dictionary entry configured.
- Parameters
-
- Returns
- true if dictionary entry exists for this key
◆ LoadFromFile()
Load dictionary from JSON file.
- Parameters
-
| filePath | Path to the dictionary JSON file |
- Returns
- Ok({}) on success, Err with details on failure
◆ RebuildLowercaseCache()
| void config::FieldTranslator::RebuildLowercaseCache |
( |
| ) |
const |
|
private |
◆ RemoveTranslation()
| void config::FieldTranslator::RemoveTranslation |
( |
const std::string & |
key | ) |
|
Remove a dictionary entry.
- Parameters
-
| key | The field key to remove |
◆ SaveToFile()
| bool config::FieldTranslator::SaveToFile |
( |
const std::string & |
filePath | ) |
const |
Save dictionary to JSON file.
- Parameters
-
| filePath | Path to save the dictionary JSON file |
- Returns
- true if saved successfully
◆ SetTranslation()
| void config::FieldTranslator::SetTranslation |
( |
const FieldDictionary & |
translation | ) |
|
Add or update a dictionary entry.
- Parameters
-
| translation | The dictionary entry to add/update |
◆ ToLower()
| std::string config::FieldTranslator::ToLower |
( |
std::string_view |
str | ) |
const |
|
private |
◆ Translate()
| TranslationResult config::FieldTranslator::Translate |
( |
std::string_view |
key, |
|
|
std::string_view |
value |
|
) |
| const |
Apply dictionary lookup/conversion to a field value.
- Parameters
-
| key | The field key name |
| value | The original value |
- Returns
- TranslationResult with converted value and tooltip
◆ m_dictionary
| std::map<std::string, FieldDictionary> config::FieldTranslator::m_dictionary |
|
private |
◆ m_lowercaseKeyCache
| std::map<std::string, std::string> config::FieldTranslator::m_lowercaseKeyCache |
|
mutableprivate |
The documentation for this class was generated from the following files: