Browse Source

Adds file-is-there check

master
Nick Overdijk 14 years ago
parent
commit
6e2d55b6d7
  1. 6
      Attractor.hpp

6
Attractor.hpp

@ -2,6 +2,7 @@
#define ATTRACTOR_HPP #define ATTRACTOR_HPP
#include "Logger.hpp" #include "Logger.hpp"
#include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>
@ -17,7 +18,10 @@ public:
LogInfo("Reading file '%s'...\n", filename.c_str()); LogInfo("Reading file '%s'...\n", filename.c_str());
stfu::node system; stfu::node system;
system.read(filename.c_str()); if(!system.read(filename.c_str())){
std::cerr << "Couldn't open file(" << filename << ") for reading\n";
exit(-1);
}
kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel")); kernel = AttractorKernel::createAttractorKernel(system.getChild("AttractorKernel"));
projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension()); projector = Projector::createProjector(system.getChild(system.getValue("Projector")), kernel->getDimension());