jayjaybillings / fire

Repository for the Fire framework
Other
0 stars 2 forks source link

Add some sort of parse() utility function #8

Closed jayjaybillings closed 7 years ago

jayjaybillings commented 7 years ago

Parsing is kind of dirty right now. It can be done in a stereotypically annoying way

LocalParser<T> parser;
parser.setSource(fileName);
parser.parse();
shared_ptr<T> myData = parser.getData();

or a shorter but more confusing way

auto parser = build<LocalParser<vector<T>>, const string &>(fileName);
auto myData = speciesParser.getData();

What I would like to have is something like

auto myData = parse<T>(filename);
jayjaybillings commented 7 years ago

Done. I like this a lot! It makes client code super succinct.