Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

String Impala::Util::Database::DoMkDirPathLocal ( CString  dirWithBackSlashes  )  [inline, private]

Definition at line 354 of file Database.h.

References DoMkDir(), ILOG_DEBUG, and Impala::StringReplaceAll().

Referenced by DoMkDirPath().

00355     {
00356         String dir = StringReplaceAll(dirWithBackSlashes, "\\", "/");
00357         ILOG_DEBUG("DoMkDirPath: " << dir);
00358 
00359         String path = "";
00360         if (dir[0] == '/')
00361         {
00362 #ifdef WIN32
00363             if (dir.find("//") == 0)
00364             {
00365                 // construct path head upto and including fourth slash
00366                 int headEndPos = 1;
00367                 int nextSlashPos = dir.find("/", headEndPos + 1);
00368                 if (nextSlashPos != String::npos)
00369                 {
00370                     headEndPos = nextSlashPos;
00371                     nextSlashPos = dir.find("/", headEndPos + 1);
00372                     if (nextSlashPos != String::npos)
00373                         headEndPos = nextSlashPos;
00374                 }
00375                 path = dir.substr(0, headEndPos + 1);
00376                 dir = dir.substr(headEndPos + 1);
00377             }
00378             else
00379 #endif
00380                 path = String("/");
00381         }
00382         
00383         StringList subDirs(dir, '/');
00384         for (StringListCI i=subDirs.begin() ; i!=subDirs.end() ; i++)
00385         {
00386             CString subDir = *i;
00387             ILOG_DEBUG("  DoMkDirPath: subDir = " << subDir);
00388             if (subDir.size() == 0 || subDir == ".")
00389                 continue;
00390             if ((path.size() > 0) && (*path.rbegin() != '/'))
00391                 path = path + "/";
00392             path = path + *i;
00393             DoMkDir(path);
00394         }
00395         return path;
00396     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:24:12 2011 for ImpalaSrc by  doxygen 1.5.1