Skip to content
Snippets Groups Projects
Commit cce80ff0 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Initfile parser - small changes

parent 00561533
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
#include <sstream>
using namespace std;
namespace AMDiS {
/// the small parser for the initfile. see description of read(Initfile&, istream&)
struct Parser {
Parser(const string& line) {
......@@ -140,3 +142,5 @@ void Initfile::write(std::string fn) {
write(outFile);
};
}
......@@ -16,9 +16,11 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
using namespace AMDiS;
namespace InitfileInternal {
namespace AMDiS {
namespace InitfileInternal {
/// Exceptions
struct WrongVectorSize : std::runtime_error {
WrongVectorSize(std::string m):std::runtime_error(m) {}
......@@ -50,7 +52,7 @@ namespace InitfileInternal {
return swap;
}
/// return the delimiter or throw an exception if there is no known delimiter in value
size_t checkDelim(const std::string& value, const std::string& delims) {
inline size_t checkDelim(const std::string& value, const std::string& delims) {
size_t pos(std::string::npos);
for (unsigned i= 0; i<delims.length(); ++i) {
pos= value.find(delims[i]);
......@@ -164,7 +166,7 @@ namespace InitfileInternal {
temp_vec[i]= c[i];
convert(temp_vec, valStr);
}
} // end namespace InitfileInternal
} // end namespace InitfileInternal
/** The entry in an initfile. This helper class was constructed to allow calls like
* val = data.get(tag)
......@@ -375,4 +377,6 @@ protected:
int msgInfo, msgWait, paramInfo;
};
} // end namespace AMDiS
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment