Changeset 2855


Ignore:
Timestamp:
21/01/2011 20:16:13 (16 months ago)
Author:
chris
Message:

Move TemporaryDirectory?.h into Utils.h and Utils.cpp to avoid duplicate
definitions of inline functions.

Location:
box/trunk/lib/common
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/Utils.cpp

    r2727 r2855  
    336336        return result.str(); 
    337337} 
     338 
     339std::string BoxGetTemporaryDirectoryName() 
     340{ 
     341#ifdef WIN32 
     342        // http://msdn.microsoft.com/library/default.asp? 
     343        // url=/library/en-us/fileio/fs/creating_and_using_a_temporary_file.asp 
     344 
     345        DWORD dwRetVal; 
     346        char lpPathBuffer[1024]; 
     347        DWORD dwBufSize = sizeof(lpPathBuffer); 
     348         
     349        // Get the temp path. 
     350        dwRetVal = GetTempPath(dwBufSize,     // length of the buffer 
     351                                                   lpPathBuffer); // buffer for path  
     352        if (dwRetVal > dwBufSize) 
     353        { 
     354                THROW_EXCEPTION(CommonException, TempDirPathTooLong) 
     355        } 
     356         
     357        return std::string(lpPathBuffer); 
     358#elif defined TEMP_DIRECTORY_NAME 
     359        return std::string(TEMP_DIRECTORY_NAME); 
     360#else    
     361        #error non-static temporary directory names not supported yet 
     362#endif 
     363} 
     364 
     365 
  • box/trunk/lib/common/Utils.h

    r2551 r2855  
    4040        bool MachineReadable); 
    4141 
     42std::string BoxGetTemporaryDirectoryName(); 
     43 
    4244#include "MemLeakFindOff.h" 
    4345 
Note: See TracChangeset for help on using the changeset viewer.