Skip to content

Commit

Permalink
responded to Travis's comments RE my last PR w/ imports, stream, etc.…
Browse files Browse the repository at this point in the history
… Cleaned up code accordingly and tested. Removed compiled code. Not sure how to add binaries to a .gitignore but I think it would be a good idea to do so.
  • Loading branch information
maxvonhippel authored and argiopetech committed Dec 27, 2016
1 parent 7b31fad commit 6b894fb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions base9/Settings.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <vector>

Expand All @@ -26,8 +25,6 @@ using YAML::LoadFile;
static void printUsage ();
static void printVersion ();

using namespace std;

void Settings::fromYaml (const string yamlFile)
{
Node configNode;
Expand Down Expand Up @@ -499,7 +496,7 @@ template<typename T> T Settings::getDefault (Node & n, string && f, T def)
}
}

template<typename T> T Settings::getOrDie (Node & n, string && f)
template<typename T> T Settings::getOrDie (Node & n, string && f)
{
if (n[f])
{
Expand All @@ -521,11 +518,10 @@ template<typename T> T Settings::getOrRequest (Node & n, string && f)
{
string input = "";
cout << "Please enter your desired setting for field: '" + f + "':\n";
getline(cin, input);
cout << "Field '" + f + "' set to: " << input << endl;
YAML::Node node;
node[f] = input;
return node[f].as<T> ();
getline(std::cin, input);
T t;
istringstream(input) >> t;
return t;
}
}

Expand Down

0 comments on commit 6b894fb

Please sign in to comment.