1#ifndef NGEN_REALIZATION_CONFIG_PROPERTIES_H
2#define NGEN_REALIZATION_CONFIG_PROPERTIES_H
6#include "JSONProperty.hpp"
24 const std::string &pattern,
const std::string &replacement)
26 auto it = properties.find(key);
32 std::string value = it->second.as_string();
34 size_t id_index = value.find(pattern);
36 if (id_index != std::string::npos) {
38 value = value.replace(id_index,
sizeof(pattern.c_str()) - 2, replacement);
39 id_index = value.find(pattern);
40 }
while (id_index != std::string::npos);
42 properties.erase(key);
@TODO: Convert JSONProperty into a variant of the supported types
Definition JSONProperty.hpp:161
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
void pattern_substitution(geojson::PropertyMap &properties, const std::string &key, const std::string &pattern, const std::string &replacement)
Perform in-place substitution on the given config property item, if the item and the pattern are pres...
Definition properties.hpp:23
Definition HY_CatchmentRealization.hpp:13