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

String Impala::GetTmpPath (  )  [inline]

Returns an user-specified temporary storage path, or the current folder if none specified.

The returned path does *not* end in a / or \.

Definition at line 14 of file FileNameTmp.h.

References Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetString(), ILOG_INFO, ILOG_VAR, and StringReplaceAll().

Referenced by FileNameTmp(), Impala::Core::ImageSet::InterestPointProc::HandleDoneDir(), Impala::Core::VideoSet::InterestPointProc::HandleDoneFile(), Impala::Core::ImageSet::InterestPointProc::HandleNewFile(), and Impala::Core::VideoSet::InterestPointProc::HandleNewFrame().

00015 {
00016     ILOG_VAR(Impala.Basis.FileNameTmp);
00017     static String tempFolder("*");
00018     if (tempFolder == "*")
00019     {
00020         CmdOptions& options = CmdOptions::GetInstance();
00021         tempFolder = options.GetString("tmpPath");
00022         if (!tempFolder.empty())
00023         {
00024             if ((tempFolder[tempFolder.size()-1] == '/') ||
00025                 (tempFolder[tempFolder.size()-1] == '\\'))
00026             {
00027                 tempFolder = tempFolder.substr(0, tempFolder.size() - 1);
00028             }
00029             // if you are on Windows, then the path should just exist already
00030             // on *nix, we try to make the path for the user
00031 #ifdef unix
00032             String cmd = "mkdir -p " + tempFolder;
00033             int sysRes = system(cmd.c_str());
00034             if (sysRes != 0)
00035             {
00036                 ILOG_INFO("Can't create tempFolder " << tempFolder <<
00037                           ", using .");
00038                 tempFolder = ".";
00039             }
00040 #else
00041             if ((_mkdir(StringReplaceAll(tempFolder, "/", "\\").c_str()) != 0) && 
00042                 (errno != EEXIST))
00043             {
00044                 ILOG_INFO("Can't create tempFolder " << tempFolder <<
00045                           ", using .");
00046                 tempFolder = ".";
00047             }
00048 #endif
00049         }
00050     }
00051     return tempFolder;
00052 }

Here is the call graph for this function:


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