Changeset 19805 for trunk/FACT++
- Timestamp:
- 10/27/19 12:52:15 (5 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Configuration.cc
r19454 r19805 1558 1558 << std::endl; 1559 1559 } 1560 1561 // -------------------------------------------------------------------------- 1562 // 1563 //! Splits a given argument of the form something/somethingelse into its 1564 //! two parts something and somethingelse and stores it in the pair of 1565 //! Configuration::Map. 1566 //! 1567 std::istream &operator>>(std::istream &in, Configuration::Map &m) 1568 { 1569 const istreambuf_iterator<char> eos; 1570 string txt(istreambuf_iterator<char>(in), eos); 1571 1572 const boost::regex expr("((.*)[^\\\\])/(.*)"); 1573 boost::smatch match; 1574 if (!boost::regex_match(txt, match, expr)) 1575 throw runtime_error("Could not evaluate map argument: "+txt); 1576 1577 m.first = match[1].str(); 1578 m.second = match[3].str(); 1579 1580 return in; 1581 } -
trunk/FACT++/src/Configuration.h
r19385 r19805 80 80 81 81 public: 82 struct Map : std::pair<std::string, std::string> 83 { 84 Map() { } 85 }; 86 82 87 Configuration(const std::string &prgname=""); 83 88 virtual ~Configuration() { } … … 281 286 { return po::value<bool>()->implicit_value(true)->default_value(def); } 282 287 288 289 std::istream &operator>>(std::istream &in, Configuration::Map &m); 290 283 291 #endif
Note:
See TracChangeset
for help on using the changeset viewer.