Static Public Member Functions | Static Protected Attributes
MAKLogger::DtLgrFileSystem Class Reference

Various File system commands. More...

+ Collaboration diagram for MAKLogger::DtLgrFileSystem:

List of all members.

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 &copyLocation, 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.
DtLgrFileSystemoperator= (const DtLgrFileSystem &)
 Not Implemented.
 ~DtLgrFileSystem ()
 Not Implemented.

Detailed Description

Various File system commands.


Member Function Documentation

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.

static DtString MAKLogger::DtLgrFileSystem::backupFileName ( const DtString &  filename) [static]

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.


Member Data Documentation

DtString MAKLogger::DtLgrFileSystem::theBackupExtension [static, protected]

String added to backup files.

Default = ".bak" Typically assigned before file extension "test.lgr" -> "test.bak.lgr"


The documentation for this class was generated from the following file:

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)