nux-1.16.0
nux::NFileManager Class Reference
Inheritance diagram for nux::NFileManager:
nux::NFileManagerGeneric nux::NFileManagerGNU

List of all members.

Classes

struct  FileTimeStamp
 Timestamp structure. More...

Public Member Functions

virtual void Init (bool Startup)
virtual NSerializerCreateFileReader (const TCHAR *Filename, DWORD ReadFlags=0, LogOutputDevice &Error=GNullDevice)=0
virtual NSerializerCreateFileWriter (const TCHAR *Filename, DWORD WriteFlags=0, LogOutputDevice &Error=GNullDevice)=0
virtual t_s64 FileSize (const TCHAR *Filename)=0
 Return TRUE if the file exist.
virtual bool FileExist (const TCHAR *Filename)=0
virtual int Copy (const TCHAR *Dest, const TCHAR *Src, bool OverWriteExisting=true, bool OverWriteReadOnly=false, NFileTransferMonitor *Progress=NULL)=0
virtual bool Move (const TCHAR *Dest, const TCHAR *Src, bool OverWriteExisting=true, bool OverWriteReadOnly=false, NFileTransferMonitor *Monitor=NULL)=0
virtual bool Delete (const TCHAR *Filename, bool OverWriteReadOnly=false)=0
virtual bool IsReadOnly (const TCHAR *Filename)=0
virtual bool IsDirectory (const TCHAR *DirectoryName)=0
virtual bool IsHidden (const TCHAR *Filename)=0
virtual bool GetFileAttribute (const TCHAR *Filename, bool &isDirectory, bool &IsReadOnly, bool &IsHidden, t_s64 &Size)=0
virtual bool MakeDirectory (const TCHAR *Path, bool CreateCompletePath=false)=0
virtual bool DeleteDirectory (const TCHAR *Path, bool DeleteContentFirst=false)=0
 Delete directory.
virtual int CreateUniqueFileName (const TCHAR *Filename, const TCHAR *Extension, NString &OutputFilename, unsigned int BaseIndex=0xffffffff)=0
virtual void FindFiles (std::vector< NString > &FileNames, const TCHAR *Filename, bool Files, bool Directories)=0
virtual void ListFilesInDirectory (std::vector< NString > &Result, const TCHAR *DirName)=0
virtual time_t GetFileLastModified (const TCHAR *Filename)=0
virtual double GetFileAgeSeconds (const TCHAR *Filename)=0
virtual bool SetDefaultDirectory ()=0
virtual NString GetCurrentDirectory ()=0
virtual bool GetTimeStamp (const TCHAR *Path, FileTimeStamp &Timestamp)=0

Detailed Description

Definition at line 78 of file NFileManagerGeneric.h.


Member Function Documentation

virtual int nux::NFileManager::CreateUniqueFileName ( const TCHAR *  Filename,
const TCHAR *  Extension,
NString OutputFilename,
unsigned int  BaseIndex = 0xffffffff 
) [pure virtual]

Creates a unique file name. The format of the name is "DirectoryPath/BaseName####.Extension" where #### is a 4-digit number in [0, 9999]. The new name is unique and does not exist in the path directory. The function returns the value of the index created for the new file name or -1 if none could be found. The return value can be saved and passed the he next call to CreateUniqueFileName in order to speed up the search. Example usage: Create a new file name for of form DirectoryPath/Filename####.ext CreateUniqueFileName(TEXT("DirectoryPath/Filename"), TEXT("ext"), Output);

Parameters:
FilenameFilename with optional path.
ExtensionExtension.
OutputFilenameNew filename.
BaseIndexBase for index search.
Returns:
Index of the new file. -1 if the file couldn't be created The index has to be in the range [0, 9999].

Implemented in nux::NFileManagerGeneric.

virtual bool nux::NFileManager::DeleteDirectory ( const TCHAR *  Path,
bool  DeleteContentFirst = false 
) [pure virtual]

Delete directory.

Delete a Directory. If DeleteContent is true, The content of the directory is deleted before the directory itself;

Parameters:
PathPath of the directory
DeleteContentFirstDelete the content of the directory before deleting the directory itself.
Returns:
TRUE if the directory was deleted.

Implemented in nux::NFileManagerGeneric, and nux::NFileManagerGNU.

virtual t_s64 nux::NFileManager::FileSize ( const TCHAR *  Filename) [pure virtual]

Return TRUE if the file exist.

Return TRUE if the file exist.

Parameters:
Filenamethe full path of the file to search.
Returns:
TRUE if the file exist.

Implemented in nux::NFileManagerGNU.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends