1#ifndef CYCLUS_SRC_INFILE_TREE_H_
2#define CYCLUS_SRC_INFILE_TREE_H_
8#include <boost/algorithm/string.hpp>
9#include <boost/lexical_cast.hpp>
73 std::set<InfileTree*> spawned_children_;
74 xmlpp::Node* current_node_;
85 return boost::lexical_cast<T>(tree->
GetString(
query, index).c_str());
97 return boost::lexical_cast<int>(
s.c_str());
104 return boost::lexical_cast<float>(
s.c_str());
111 return boost::lexical_cast<double>(
s.c_str());
136 val = boost::lexical_cast<int>(
s.c_str());
150 std::transform(
s.begin(),
s.end(),
s.begin(),
::tolower);
151 return s ==
"true" ||
s ==
"t" ||
s ==
"1";
161 val = boost::lexical_cast<float>(
s.c_str());
173 val = boost::lexical_cast<double>(
s.c_str());
A class for extracting information from a given XML parser.
virtual InfileTree * GetEngineFromQuery(std::string query, int index)
every derived infile must return a new instance initialized by a query.
InfileTree(XMLParser &parser)
constructor given a parser
virtual int NMatches(std::string query)
investigates the current status and returns the number of elements matching a query
virtual std::string GetElementName(int index=0)
investigates the current status and returns a string representing the name of a given index
InfileTree * SubTree(std::string query, int index=0)
populates a child infile based on a query and index
void SetCurrentNode(xmlpp::Node *node)
sets the current node to a given node
virtual std::string GetString(std::string query, int index=0)
investigates the current status and returns a string representing the content of a query at a given i...
A helper class to hold xml file data and provide automatic validation.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
T Query(InfileTree *tree, std::string query, int index=0)
a query method for required parameters
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters