Various File system commands. More...
Collaboration diagram for MAKLogger::DtLgrFileSystem:Static Public Member Functions | |
| static DtString | tempFileName () |
| Get an unique temporary filename in the current working directory. | |
| static void | setTempDirectory (const DtString &directory) |
| Set the temp file directory. | |
| static bool | fileExists (const DtString &filename) |
| Check to see if a given file exists. | |
| static void | removeFile (const DtString &filename) |
| Delete a file. | |
| static void | duplicateFile (const DtString ©Location, const DtString &oldLocation) |
| Duplicate a file. | |
| static DtString | backupFileName (const DtString &filename) |
| Get the name of the a backup file name given the input filename. | |
| static void | moveFile (const DtString &newLocation, const DtString &oldLocation) |
| Destructively replace the old file with the new file. | |
| static void | backupAndReplaceFile (const DtString &originalFile, const DtString &newFile) |
| Backs up the old file and replaces it with the new file Operation is equivalent to: if(exists originalFile) rename originalFile to originalFile.bak rename newFile to originalFile. | |
| static void | backupAndDuplicateFile (const DtString &originalFile, const DtString &newFile) |
| Backs up the old file and replaces it with a copy of the new file Operation is equivalent to: if(exists originalFile) rename originalFile to oldfile.bak copy newFile to originalFile. | |
| static const DtString & | backupExtension () |
| Get the backup extension. | |
| static void | setBackupExtension (const DtString &ext) |
| Set the backup extension. By default it is ".bak". | |
| static void | setDefaultDir (DtFilename filename) |
| Set the default file storage directory. | |
| static const DtFilename & | defaultDir () |
| Get the default file storage directory. | |
| static void | constructFileName (const DtFilename &filename, const DtFilename &filePath, long id, DtFilename &constructedName) |
| Construct a file name and path using given file name (should be just the base name), ID and path. | |
Static Protected Attributes | |
| static DtString | theBackupExtension |
| String added to backup files. | |
| static DtString | theTempPath |
| static DtFilename | theDefaultDir |
Private Member Functions | |
| DtLgrFileSystem () | |
| Not Implemented. | |
| DtLgrFileSystem (const DtLgrFileSystem &) | |
| Not Implemented. | |
| DtLgrFileSystem & | operator= (const DtLgrFileSystem &) |
| Not Implemented. | |
| ~DtLgrFileSystem () | |
| Not Implemented. | |
Various File system commands.
| static void MAKLogger::DtLgrFileSystem::backupAndReplaceFile | ( | const DtString & | originalFile, |
| const DtString & | newFile | ||
| ) | [static] |
Backs up the old file and replaces it with the new file Operation is equivalent to: if(exists originalFile) rename originalFile to originalFile.bak rename newFile to originalFile.
Get the name of the a backup file name given the input filename.
This does not make any claims of either files existence and is only used for determining the valid strings.
| static void MAKLogger::DtLgrFileSystem::duplicateFile | ( | const DtString & | copyLocation, |
| const DtString & | oldLocation | ||
| ) | [static] |
Duplicate a file.
The file at oldLocation is copied to a new file at the copyLocation.
| static void MAKLogger::DtLgrFileSystem::moveFile | ( | const DtString & | newLocation, |
| const DtString & | oldLocation | ||
| ) | [static] |
Destructively replace the old file with the new file.
Operation is equivalent to: if(exists originalFile) delete originalFile rename newFile to originalFile.
| static void MAKLogger::DtLgrFileSystem::removeFile | ( | const DtString & | filename | ) | [static] |
Delete a file.
The file is assume to exist and the user has the proper permissions.
| static DtString MAKLogger::DtLgrFileSystem::tempFileName | ( | ) | [static] |
Get an unique temporary filename in the current working directory.
DtString MAKLogger::DtLgrFileSystem::theBackupExtension [static, protected] |
String added to backup files.
Default = ".bak" Typically assigned before file extension "test.lgr" -> "test.bak.lgr"