#include #include "IGeomIdFinder.hxx" //========================================================================= // ModuleNo //========================================================================= int COMET::IGeomIdFinder::ModuleNo(const std::string& name) { size_t begin = name.find("_")+1; size_t end = name.find_last_of("_"); // Illegal string if(begin == std::string::npos || end == std::string::npos) return -1; return atoi(name.substr(begin, end-begin).c_str()); } //========================================================================= // ModuleNo //========================================================================= int COMET::IGeomIdFinder:: ModuleNo(const std::vector& names, unsigned int position) { if(position < names.size()){ const std::string& name = names.at(position); return ModuleNo(name); } return -1; } //========================================================================= // GetFullNodePath //========================================================================= std::string COMET::IGeomIdFinder:: GetFullNodePath(const std::vector& names) { std::string ret = ""; for(std::vector::const_iterator name = names.begin(); name != names.end(); name++){ ret += "/"; ret += *name; } return ret; }