FACT++  1.0
int StateMachineSmartFACT::EvalOptions ( Configuration conf)
inline

Definition at line 3383 of file smartfact.cc.

References Error(), fIsServer, Configuration::Get(), Time::JavaDate(), and PixelMap::Read().

3384  {
3385  if (!fPixelMap.Read(conf.Get<string>("pixel-map-file")))
3386  {
3387  Error("Reading mapping table from "+conf.Get<string>("pixel-map-file")+" failed.");
3388  return 1;
3389  }
3390 
3391  fPath = conf.Get<string>("path");
3392  fDatabase = conf.Get<string>("source-database");
3393 
3394  struct stat st;
3395  if (stat(fPath.c_str(), &st))
3396  {
3397  Error(fPath+" does not exist!");
3398  return 2;
3399  }
3400 
3401  if ((st.st_mode&S_IFDIR)==0)
3402  {
3403  Error(fPath+" not a directory!");
3404  return 3;
3405  }
3406 
3407  if ((st.st_mode&S_IWUSR)==0)
3408  {
3409  Error(fPath+" has no write permission!");
3410  return 4;
3411  }
3412 
3413  if ((st.st_mode&S_IXUSR)==0)
3414  {
3415  Error(fPath+" has no execute permission!");
3416  return 5;
3417  }
3418 
3419  ostringstream out;
3420  out << Time().JavaDate() << '\n';
3421 
3422  ofstream(fPath+"/error.data") << out.str();
3423 
3424  return -1;
3425  }
uint64_t JavaDate() const
Definition: Time.h:111
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
T Get(const std::string &var)
int Error(const std::string &str)
Definition: MessageImp.h:49
bool Read(const std::string &fname)
Definition: PixelMap.h:56

+ Here is the call graph for this function: