Definition at line 292 of file FileSystem.h. References DoMkDir(), ILOG_DEBUG, and Impala::StringReplaceAll(). Referenced by DoMkDirPath(). 00293 { 00294 String dir = StringReplaceAll(dirWithBackSlashes, "\\", "/"); 00295 ILOG_DEBUG("DoMkDirPath: " << dir); 00296 00297 String path = ""; 00298 if (dir[0] == '/') 00299 { 00300 #ifdef WIN32 00301 if (dir.find("//") == 0) 00302 { 00303 // construct path head upto and including fourth slash 00304 int headEndPos = 1; 00305 int nextSlashPos = dir.find("/", headEndPos + 1); 00306 if (nextSlashPos != String::npos) 00307 { 00308 headEndPos = nextSlashPos; 00309 nextSlashPos = dir.find("/", headEndPos + 1); 00310 if (nextSlashPos != String::npos) 00311 headEndPos = nextSlashPos; 00312 } 00313 path = dir.substr(0, headEndPos + 1); 00314 dir = dir.substr(headEndPos + 1); 00315 } 00316 else 00317 #endif 00318 path = String("/"); 00319 } 00320 00321 StringList subDirs(dir, '/'); 00322 for (StringListCI i=subDirs.begin() ; i!=subDirs.end() ; i++) 00323 { 00324 CString subDir = *i; 00325 ILOG_DEBUG(" DoMkDirPath: subDir = " << subDir); 00326 if (subDir.size() == 0 || subDir == ".") 00327 continue; 00328 if ((path.size() > 0) && (*path.rbegin() != '/')) 00329 path = path + "/"; 00330 path = path + *i; 00331 DoMkDir(path); 00332 } 00333 return path; 00334 }
Here is the call graph for this function: ![]()
|