Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Win32FilePeer Class Reference

#include <Win32FilePeer.h>

Inheritance diagram for VCF::Win32FilePeer:

VCF::FilePeer VCF::Object List of all members.

Public Member Functions

 Win32FilePeer (File *file)
virtual ~Win32FilePeer ()
virtual String getName ()
virtual void setFile (File *file)
 close any open handles, reset all internal data, and it associates itself to a given file instance.
virtual uint64 getSize ()
 returns the size of the file in bytes
virtual DateTime getDateModified ()
 get the modification date of the file
virtual DateTime getDateCreated ()
 get the creation date of the file
virtual DateTime getDateAccessed ()
 get the latest date the file has been accessed.
virtual void updateStat (File::StatMask statMask=File::smMaskAll)
 updates the informations about the file from the file system
virtual void setFileAttributes (const File::FileAttributes fileAttributes)
 set the fileAttributes of the file
virtual bool isExecutable ()
 tells if the file can be run by the OS.
virtual void setDateModified (const DateTime &dateModified)
 set the modification date of the file
virtual void open (const String &fileName, uint32 openFlags=File::ofRead, File::ShareFlags shareFlags=File::shMaskAny)
 opens a file with read/write access Closes the old one if previously opened
virtual void close ()
 closes the file if open it can be called even if it was not opened
virtual void create (uint32 openFlags)
 creates the file if the last character in the filename_ is a 'DirectorySeparator' character, then a directory is created instead of a file.
virtual void remove ()
 deletes the file from the file system
virtual void move (const String &newFileName)
 renames/moves a file
virtual void copyTo (const String &copyFileName)
 copies the file into another one
virtual void initFileSearch (Directory::Finder *finder)
 initialize the search and allocates meemory if necessary
virtual FilefindNextFileInSearch (Directory::Finder *finder)
 the core of the search 'engine'
virtual void endFileSearch (Directory::Finder *finder)
 finalize the search closing any handles if necessary
virtual void continueSearch (Directory::Finder *finder, File *file)
 sets the finder to continue the search in the next subdirectory yet to search and switch displayMode if necessary
virtual void goDirDown (Directory::Finder *finder, File *file)
 sets the finder for a search one level down in the directory tree
virtual void goDirUp (Directory::Finder *finder, File *file)
 sets the finder for the first level up in the directory tree in which the search has not been completed yet
HANDLE getFileHandle ()

Static Public Member Functions

static DateTime convertFileTimeToDateTime (const FILETIME &ft)
static DateTime convertUtcFileTimeToLocalDateTime (const FILETIME &ftUtc)
static String getAlternateFileName (const String &fileName)
 Windows specific function: gets the alternate filename of a file This is the the old dos name composed of 8+3 characters.
static FileupdateFindDataInfos (File *file, Win32FindData *findData, File::StatMask statMask=File::smMaskAll)
 copies the data contained in our Win32FindData structure into File Be careful! This function, beside the other informations, it copies the baseName only, not the is full path.
static uint32 convertAttributesFromSystemSpecific (const uint32 &dwAttributes)
 converts the file attributes from the OS specific format into the vcf format.
static uint32 convertAttributesToSystemSpecific (File::FileAttributes dwAttributes)
 converts the file attributes from the vcf format into the OS specific format.

Protected Member Functions

void initDataSearch ()

Static Protected Member Functions

static void copyFromAttributeData (File *file, WIN32_FILE_ATTRIBUTE_DATA &fileAttribData, File::StatMask statMask=File::smMaskAll)

Protected Attributes

Win32FindDatafindData_
HANDLE searchHandle_
HANDLE fileHandle_
Filefile_

Classes

class  Win32FindData
class  Win32FindDataA
class  Win32FindDataW

Constructor & Destructor Documentation

VCF::Win32FilePeer::Win32FilePeer File file  ) 
 

virtual VCF::Win32FilePeer::~Win32FilePeer  )  [virtual]
 


Member Function Documentation

virtual void VCF::Win32FilePeer::close  )  [virtual]
 

closes the file if open it can be called even if it was not opened

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::continueSearch Directory::Finder finder,
File file
[virtual]
 

sets the finder to continue the search in the next subdirectory yet to search and switch displayMode if necessary

static uint32 VCF::Win32FilePeer::convertAttributesFromSystemSpecific const uint32 dwAttributes  )  [static]
 

converts the file attributes from the OS specific format into the vcf format.

static uint32 VCF::Win32FilePeer::convertAttributesToSystemSpecific File::FileAttributes  dwAttributes  )  [static]
 

converts the file attributes from the vcf format into the OS specific format.

static DateTime VCF::Win32FilePeer::convertFileTimeToDateTime const FILETIME &  ft  )  [static]
 

static DateTime VCF::Win32FilePeer::convertUtcFileTimeToLocalDateTime const FILETIME &  ftUtc  )  [static]
 

static void VCF::Win32FilePeer::copyFromAttributeData File file,
WIN32_FILE_ATTRIBUTE_DATA &  fileAttribData,
File::StatMask  statMask = File::smMaskAll
[static, protected]
 

virtual void VCF::Win32FilePeer::copyTo const String copyFileName  )  [virtual]
 

copies the file into another one

Parameters:
fileNameToCopyTo the filename to create/overwrite.

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::create uint32  openFlags  )  [virtual]
 

creates the file if the last character in the filename_ is a 'DirectorySeparator' character, then a directory is created instead of a file.

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::endFileSearch Directory::Finder finder  )  [virtual]
 

finalize the search closing any handles if necessary

Implements VCF::FilePeer.

virtual File* VCF::Win32FilePeer::findNextFileInSearch Directory::Finder finder  )  [virtual]
 

the core of the search 'engine'

Implements VCF::FilePeer.

static String VCF::Win32FilePeer::getAlternateFileName const String fileName  )  [static]
 

Windows specific function: gets the alternate filename of a file This is the the old dos name composed of 8+3 characters.

Parameters:
String the full filename of the file
Returns:
String the alternate filename

virtual DateTime VCF::Win32FilePeer::getDateAccessed  )  [virtual]
 

get the latest date the file has been accessed.

Returns:
DateTime, the access date.

Implements VCF::FilePeer.

virtual DateTime VCF::Win32FilePeer::getDateCreated  )  [virtual]
 

get the creation date of the file

Returns:
DateTime, the creation date.

Implements VCF::FilePeer.

virtual DateTime VCF::Win32FilePeer::getDateModified  )  [virtual]
 

get the modification date of the file

Returns:
DateTime, the modification date.

Implements VCF::FilePeer.

HANDLE VCF::Win32FilePeer::getFileHandle  )  [inline]
 

virtual String VCF::Win32FilePeer::getName  )  [inline, virtual]
 

virtual uint64 VCF::Win32FilePeer::getSize  )  [virtual]
 

returns the size of the file in bytes

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::goDirDown Directory::Finder finder,
File file
[virtual]
 

sets the finder for a search one level down in the directory tree

virtual void VCF::Win32FilePeer::goDirUp Directory::Finder finder,
File file
[virtual]
 

sets the finder for the first level up in the directory tree in which the search has not been completed yet

void VCF::Win32FilePeer::initDataSearch  )  [protected]
 

virtual void VCF::Win32FilePeer::initFileSearch Directory::Finder finder  )  [virtual]
 

initialize the search and allocates meemory if necessary

Implements VCF::FilePeer.

virtual bool VCF::Win32FilePeer::isExecutable  )  [virtual]
 

tells if the file can be run by the OS.

Returns:
bool, true if it does.

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::move const String newFileName  )  [virtual]
 

renames/moves a file

Parameters:
newFileName the filename

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::open const String fileName,
uint32  openFlags = File::ofRead,
File::ShareFlags  shareFlags = File::shMaskAny
[virtual]
 

opens a file with read/write access Closes the old one if previously opened

Parameters:
fileName the desired new filename
openFlags 
shareFlags 

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::remove  )  [virtual]
 

deletes the file from the file system

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::setDateModified const DateTime dateModified  )  [virtual]
 

set the modification date of the file

Parameters:
date the desired modification date

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::setFile File file  )  [virtual]
 

close any open handles, reset all internal data, and it associates itself to a given file instance.

Parameters:
File* pointer to a File instance

Implements VCF::FilePeer.

virtual void VCF::Win32FilePeer::setFileAttributes const File::FileAttributes  fileAttributes  )  [virtual]
 

set the fileAttributes of the file

Parameters:
fileAttributes the desired attributes

Implements VCF::FilePeer.

static File* VCF::Win32FilePeer::updateFindDataInfos File file,
Win32FindData findData,
File::StatMask  statMask = File::smMaskAll
[static]
 

copies the data contained in our Win32FindData structure into File Be careful! This function, beside the other informations, it copies the baseName only, not the is full path.

virtual void VCF::Win32FilePeer::updateStat File::StatMask  statMask = File::smMaskAll  )  [virtual]
 

updates the informations about the file from the file system

Parameters:
statMask the mask indicating the infos we want to update

Implements VCF::FilePeer.


Member Data Documentation

File* VCF::Win32FilePeer::file_ [protected]
 

HANDLE VCF::Win32FilePeer::fileHandle_ [protected]
 

Win32FindData* VCF::Win32FilePeer::findData_ [protected]
 

HANDLE VCF::Win32FilePeer::searchHandle_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information