+/*!
+ *brief Read in and parse a configuration file.
+ *\arg file String containing the filename
+ *\return Empty Vector or Vector full of strings containing
+ * the error message(s).
+ */
+vector<string> configuration_manager::read_file(string filename){
+ vector<string>result;
+ FILE * fp=fopen(filename.c_str(),"r");
+ if (! fp) {
+ result.insert(result.end(),"Error!");
+ result.insert(result.end(),"Could not open file:"+filename);
+ return result;
+ }
+
+ char buffer[1000];
+ while(fgets(buffer,1000,fp)){
+ if (strlen (buffer)){
+ char*l2=buffer+strspn(buffer," \t");
+ if (l2[0]!='#'){
+ string line=l2;
+ unsigned int pos=line.find("=");
+ if (pos==0){
+ result.insert(result.end(),"Error!");
+ result.insert(result.end(),"In File:"+filename);
+ result.insert(result.end(),"Line beginning with '='!");
+ return result;
+ }
+
+ } // if not #
+
+ } // if (strlen())
+ } // while(...)
+
+
+ fclose (fp);
+ return result;
+}
+