const std::string key(std::string comp){ kul::String::replaceAll(comp, ".exe", ""); if(cs.count(comp) > 0)return comp; if(comp.find(" ") != std::string::npos) for(const std::string& s :kul::String::split(comp, ' ')){ if(cs.count(s) > 0) return s; if(std::string(kul::Dir(s).locl()).find(kul::Dir::SEP()) != std::string::npos) if(cs.count(s.substr(s.rfind(kul::Dir::SEP()) + 1)) > 0) return s.substr(s.rfind(kul::Dir::SEP()) + 1); } if(std::string(kul::Dir(comp).locl()).find(kul::Dir::SEP()) != std::string::npos) if(cs.count(comp.substr(comp.rfind(kul::Dir::SEP()) + 1)) > 0) return comp.substr(comp.rfind(kul::Dir::SEP()) + 1); KEXCEPT(CompilerNotFoundException, "Compiler for " + comp + " is not implemented"); }
const Compiler* get(std::string comp) throw(CompilerNotFoundException){ return (*cs.find(key(comp))).second; }
const SCM& get(const std::string& s) throw(NotFoundException){ if(SCMs.count(s) > 0) return *(*SCMs.find(s)).second; KEXCEPT(NotFoundException, "Source Control Management for " + s + " is not implemented"); }