MeteoIODoc 20261119.86f8ff36
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
mio::VarExpander Class Reference

Detailed Description

Expansion of the variables of key/values (see special values): references to other keys, environment variables (recursively) and arithmetic expressions.

It works on references to existing key/values (nothing is copied) and expands extra key/values (an "overlay"), which may refer to each other and to the existing ones. This is used both while reading an ini file (the keys containing variables being the overlay of the keys already known) and after (see Config::resolveOverlay()).

#include <Config.h>

Public Member Functions

 VarExpander (const std::map< std::string, std::string > &i_properties, const std::set< std::string > &i_sections)
 
void resolveOverlay (std::map< std::string, std::string > &overlay, const std::string &sourcename="")
 Expand the given key/values, in rounds until all are done (they may refer to each other)
 

Constructor & Destructor Documentation

◆ VarExpander()

mio::VarExpander::VarExpander ( const std::map< std::string, std::string > &  i_properties,
const std::set< std::string > &  i_sections 
)
Parameters
[in]i_propertiesthe key/values the overlay may refer to (they have priority over the overlay keys)
[in]i_sectionsall the sections, to recognize the section prefixes of the references

Member Function Documentation

◆ resolveOverlay()

void mio::VarExpander::resolveOverlay ( std::map< std::string, std::string > &  overlay,
const std::string &  sourcename = "" 
)

Expand the given key/values, in rounds until all are done (they may refer to each other)

Parameters
overlayfull keys (SECTION::KEY) and their raw values; on return, they hold the expanded values
[in]sourcenamedescription of the source of the key/values, for the error messages

The documentation for this class was generated from the following files: