From f290f94301726aa3aab45c3b99aa051030cf8114 Mon Sep 17 00:00:00 2001 From: mac Date: Wed, 22 Mar 2000 18:55:12 +0000 Subject: [PATCH] Adapted it for the poor stdc++ support of g++ --- eo/src/utils/eoParser.cpp | 8 +++++--- eo/src/utils/eoState.cpp | 12 ++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 2ef30b77..9a669c6c 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -2,6 +2,7 @@ #pragma warning(disable:4786) #endif +#include #include #include #include @@ -57,7 +58,7 @@ void eoParser::doRegisterParam(eoParam& param) const { if (param.required() && !isItThere(param)) { - throw runtime_error("required parameter missing"); + throw std::runtime_error("required parameter missing"); } pair value = getValue(param); @@ -182,8 +183,9 @@ void eoParser::printOn(ostream& os) const eoParam* param = p->second; string str = "--" + param->longName() + "=" + param->getValue(); - - os << left << setw(40) << str; + + //os.setf(ios_base::left, ios_base::adjustfield); + os << setw(40) << str; os << " # " << '-' << param->shortName() << " : " << param->description(); if (param->required()) diff --git a/eo/src/utils/eoState.cpp b/eo/src/utils/eoState.cpp index edd4d9ca..3d60ed44 100644 --- a/eo/src/utils/eoState.cpp +++ b/eo/src/utils/eoState.cpp @@ -52,18 +52,18 @@ void eoState::registerObject(eoPersistent& registrant) void eoState::load(const string& _filename) { ifstream is (_filename.c_str()); - - if (is.fail()) - { - string str = "Could not open file " + _filename; - throw runtime_error(str); - } string str; string name; getline(is, str); + if (is.fail()) + { + string str = "Could not open file " + _filename; + throw runtime_error(str); + } + while(is) { // parse section header if (is_section(str, name))