24  boost::property_tree::ptree 
parse(std::string str)
 
   26    boost::algorithm::trim(str);
 
   27    boost::property_tree::ptree pt;
 
   28    boost::tokenizer<boost::char_separator<char> > tok(str, 
args_sep);
 
   30    BOOST_FOREACH(std::string s, tok)
 
   32      boost::algorithm::trim(s);
 
   33      boost::tokenizer<boost::char_separator<char> > fields(s, 
fields_sep);
 
   34      typedef boost::tokenizer<boost::char_separator<char> >::iterator Iter;
 
   36      Iter it = fields.begin();
 
   38      std::string varname = *it;
 
   39      boost::algorithm::trim(varname);
 
   42      if (it != fields.end()) {
 
   43        std::string val = *it;
 
   44        boost::algorithm::trim(val);
 
   49        throw std::runtime_error(
"Parsing error: malformed input buffer.");
 
   52      if (it != fields.end()) {
 
   53        throw std::runtime_error(
"Parsing error: malformed input buffer.");