31 #include <boost/tokenizer.hpp> 42 typedef boost::escaped_list_separator<char> SeparatorType;
43 typedef boost::tokenizer<SeparatorType> TokenizerType;
46 SeparatorType sep(
'\\',
'.');
47 TokenizerType tok(input, sep);
48 copy(tok.begin(), tok.end(), back_inserter(output));
49 }
catch (boost::escaped_list_error &e) {
50 throw invalid_argument(e.what());
53 for (vector<string>::const_iterator outputIt = output.begin();
54 outputIt != output.end(); ++outputIt) {
55 if (outputIt->empty()) {
56 throw invalid_argument(
"Empty component in key '" + input +
"'");
61 throw invalid_argument(
"Option key is empty");
void splitKeyAtDots(const std::string &input, std::vector< std::string > &output)
Creates a key vector structure used in the options backend from a dot-separated string.