From cce80ff09a83a020c442974a88cda7d4751b1530 Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon.praetorius@tu-dresden.de>
Date: Fri, 3 Jun 2011 13:21:03 +0000
Subject: [PATCH] Initfile parser - small changes

---
 AMDiS/src/Initfile.cc |  4 ++++
 AMDiS/src/Initfile.h  | 12 ++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc
index e22348b7..0c65647f 100644
--- a/AMDiS/src/Initfile.cc
+++ b/AMDiS/src/Initfile.cc
@@ -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);
 };
+
+}
diff --git a/AMDiS/src/Initfile.h b/AMDiS/src/Initfile.h
index 5f815214..00be10fa 100644
--- a/AMDiS/src/Initfile.h
+++ b/AMDiS/src/Initfile.h
@@ -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
-- 
GitLab