Back to index

nux  3.0.0
Classes | Public Member Functions
nux::NFileManager Class Reference

#include <NFileManagerGeneric.h>

Inheritance diagram for nux::NFileManager:
Inheritance graph
[legend]

List of all members.

Classes

struct  FileTimeStamp
 Timestamp structure. More...

Public Member Functions

 NFileManager ()
virtual ~NFileManager ()
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 long long 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, long long &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
 Creates a unique file name.
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.


Constructor & Destructor Documentation

Definition at line 82 of file NFileManagerGeneric.h.

{}
virtual nux::NFileManager::~NFileManager ( ) [inline, virtual]

Definition at line 83 of file NFileManagerGeneric.h.

{}

Member Function Documentation

virtual int nux::NFileManager::Copy ( const TCHAR Dest,
const TCHAR Src,
bool  OverWriteExisting = true,
bool  OverWriteReadOnly = false,
NFileTransferMonitor Progress = NULL 
) [pure virtual]
virtual NSerializer* nux::NFileManager::CreateFileReader ( const TCHAR Filename,
DWORD  ReadFlags = 0,
LogOutputDevice Error = GNullDevice 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

Here is the caller graph for this function:

virtual NSerializer* nux::NFileManager::CreateFileWriter ( const TCHAR Filename,
DWORD  WriteFlags = 0,
LogOutputDevice Error = GNullDevice 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

Here is the caller graph for this function:

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::Delete ( const TCHAR Filename,
bool  OverWriteReadOnly = false 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

Here is the caller graph for this function:

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 bool nux::NFileManager::FileExist ( const TCHAR Filename) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual long long 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.

virtual void nux::NFileManager::FindFiles ( std::vector< NString > &  FileNames,
const TCHAR Filename,
bool  Files,
bool  Directories 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

Here is the caller graph for this function:

virtual NString nux::NFileManager::GetCurrentDirectory ( ) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual double nux::NFileManager::GetFileAgeSeconds ( const TCHAR Filename) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual bool nux::NFileManager::GetFileAttribute ( const TCHAR Filename,
bool &  isDirectory,
bool &  IsReadOnly,
bool &  IsHidden,
long long &  Size 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual time_t nux::NFileManager::GetFileLastModified ( const TCHAR Filename) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual bool nux::NFileManager::GetTimeStamp ( const TCHAR Path,
FileTimeStamp Timestamp 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual void nux::NFileManager::Init ( bool  Startup) [inline, virtual]

Definition at line 107 of file NFileManagerGeneric.h.

{}
virtual bool nux::NFileManager::IsDirectory ( const TCHAR DirectoryName) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual bool nux::NFileManager::IsHidden ( const TCHAR Filename) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual bool nux::NFileManager::IsReadOnly ( const TCHAR Filename) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual void nux::NFileManager::ListFilesInDirectory ( std::vector< NString > &  Result,
const TCHAR DirName 
) [pure virtual]

Implemented in nux::NFileManagerGNU.

virtual bool nux::NFileManager::MakeDirectory ( const TCHAR Path,
bool  CreateCompletePath = false 
) [pure virtual]
virtual bool nux::NFileManager::Move ( const TCHAR Dest,
const TCHAR Src,
bool  OverWriteExisting = true,
bool  OverWriteReadOnly = false,
NFileTransferMonitor Monitor = NULL 
) [pure virtual]
virtual bool nux::NFileManager::SetDefaultDirectory ( ) [pure virtual]

Implemented in nux::NFileManagerGNU.


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