129 if (pathNm.empty()) {
136 MyMap::iterator it =
m_cache.find(pathNm);
143 const string& pathNm_real = it->second;
144 if (pathNm_real[0] ==
'/') {
145 pathNm = pathNm_real;
152 string pathNm_orig = pathNm;
165 const string& pathNm_real = it->second;
166 if (pathNm_real[0] ==
'/') {
167 pathNm = pathNm_real;
171 m_cache.insert(make_pair(pathNm_orig, pathNm_real));
177 string pathNm_real = pathNm;
180 pathNm_real =
RealPath(pathNm.c_str());
183 const char* pathNm_pf;
194 pathNm_real = pathNm_pf;
198 pathNm = pathNm_real;
199 m_cache.insert(make_pair(pathNm_orig, pathNm_real));
202 return (pathNm[0] ==
'/');
209 std::vector<std::string> searchPathVec;
215 for (
uint i = 0; i < searchPathVec.size(); ++i) {
216 string path = searchPathVec[i];
223 else if (path !=
".") {
237 std::ostringstream os;
245 const char* pfx)
const 247 os << pfx <<
"[ RealPathMgr:" << std::endl;
248 for (MyMap::const_iterator it =
m_cache.begin(); it !=
m_cache.end(); ++it) {
249 const string& x = it->first;
250 const string& y = it->second;
251 os << pfx <<
" " << x <<
" => " << y << std::endl;
253 os << pfx <<
"]" << std::endl;
263 dump(std::cerr, flags);
std::string replace(const std::string &path) const
static int isRecursivePath(const char *path)
static PathFindMgr & singleton()
const char * pathfind(const char *pathList, const char *name, const char *mode)
void ddump(uint flags=0) const
static RealPathMgr & singleton()
void tokenize_str(const std::string &tokenstr, const char *delim, std::vector< std::string > &tokenvec)
PathReplacementMgr * m_pathReplaceMgr
bool realpath(std::string &pathNm) const
static PathReplacementMgr & singleton()
std::string m_searchPaths
static RealPathMgr s_singleton
std::string toString(uint flags=0) const
PathFindMgr * m_pathFindMgr
static const int RecursivePathSfxLn
const std::string & searchPaths() const
std::ostream & dump(std::ostream &os, uint flags=0, const char *pfx="") const
const char * RealPath(const char *nm)