Skip to content
Snippets Groups Projects
Commit a8ff6b2b authored by Ulrich Kemloh's avatar Ulrich Kemloh
Browse files

Fixed issue #22. checking if the file name match the extension.

parent a79ddc00
No related branches found
No related tags found
No related merge requests found
File moved
...@@ -219,7 +219,7 @@ bool ArgumentParser::ParseIniFile(string inifile) ...@@ -219,7 +219,7 @@ bool ArgumentParser::ParseIniFile(string inifile)
if(xMainNode->FirstChild("geometry")) if(xMainNode->FirstChild("geometry"))
{ {
_geometryFileName=_projectRootDir+xMainNode->FirstChildElement("geometry")->Attribute("file"); _geometryFileName=_projectRootDir+xMainNode->FirstChildElement("geometry")->Attribute("file");
Log->Write("INFO: \tGeometry File is:\t <"+_geometryFileName+">"); Log->Write("INFO: \tGeometry File is: <"+_geometryFileName+">");
} }
//trajectories //trajectories
...@@ -228,7 +228,7 @@ bool ArgumentParser::ParseIniFile(string inifile) ...@@ -228,7 +228,7 @@ bool ArgumentParser::ParseIniFile(string inifile)
{ {
//add the extension point //add the extension point
string fmt = "."+string (xmltoa(xMainNode->FirstChildElement("trajectories")->Attribute("format"))); string fmt = "."+string (xmltoa(xMainNode->FirstChildElement("trajectories")->Attribute("format")));
Log->Write("INFO: \tFormat of the trajectory file is:\t<%s>", fmt.c_str()); Log->Write("INFO: \tFormat of the trajectory file is: <%s>", fmt.c_str());
if (fmt == ".xml") if (fmt == ".xml")
{ {
_fileFormat = FORMAT_XML_PLAIN; _fileFormat = FORMAT_XML_PLAIN;
...@@ -257,8 +257,18 @@ bool ArgumentParser::ParseIniFile(string inifile) ...@@ -257,8 +257,18 @@ bool ArgumentParser::ParseIniFile(string inifile)
_trajectoriesFilename = _trajectoriesFilename =
+ xFile->Attribute("name"); + xFile->Attribute("name");
_trajectoriesFiles.push_back(_trajectoriesFilename); _trajectoriesFiles.push_back(_trajectoriesFilename);
//check if the given file match the format
if(boost::algorithm::ends_with(_trajectoriesFilename,fmt))
{
Log->Write("INFO: \tInput trajectory file is\t<"+ (_trajectoriesFilename)+">"); Log->Write("INFO: \tInput trajectory file is\t<"+ (_trajectoriesFilename)+">");
} }
else
{
Log->Write("ERROR: \tWrong file extension\t<%s> for file <%s>",fmt.c_str(),_trajectoriesFilename.c_str());
return false;
}
}
if (xTrajectories->FirstChildElement("path")) if (xTrajectories->FirstChildElement("path"))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment