1 #ifndef OPENMW_COMPONENTS_FALLBACK_VALIDATE_H
2 #define OPENMW_COMPONENTS_FALLBACK_VALIDATE_H
4 #include <boost/program_options.hpp>
16 std::map<std::string, std::string>
mMap;
28 for (std::vector<std::string>::const_iterator it = tokens.begin(); it != tokens.end(); ++it)
31 int sep = temp.find(
",");
32 if (sep < 1 || sep == (
int)temp.length() - 1)
33 #
if (BOOST_VERSION < 104200)
34 throw boost::program_options::validation_error(
"invalid value");
36 throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value);
39 std::string key(temp.substr(0, sep));
40 std::string value(temp.substr(sep + 1));
42 if (map->
mMap.find(key) == map->
mMap.end())
44 map->
mMap.insert(std::make_pair(key, value));
void validate(boost::any &v, std::vector< std::string > const &tokens, FallbackMap *, int)
Definition: validate.hpp:19
static std::string processString(const std::string &str)
Definition: escape.cpp:28
Definition: validate.hpp:15
std::map< std::string, std::string > mMap
Definition: validate.hpp:16