class represents a single file or directory.
|
Public Types |
| enum | FileAttributes {
faNone = 0x00000000,
faReadOnly = 0x00000001,
faHidden = 0x00000002,
faSystem = 0x00000004,
faExecutable = 0x00000008,
faDirectory = 0x00000010,
faArchive = 0x00000020,
faDevice = 0x00000040,
faNormal = 0x00000080,
faMaskFile = faReadOnly | faHidden | faSystem | faArchive | faNormal,
faMaskFileExec = faReadOnly | faHidden | faSystem | faArchive | faNormal | faExecutable,
faMaskDir = faMaskFile | faDirectory,
faMaskAll = faMaskDir | faDevice | faExecutable
} |
| enum | StatMask {
smStatNone = 0x0,
smSize = 0x1,
smAttributes = 0x2,
smDateCreation = 0x4,
smDateModified = 0x8,
smDateAccess = 0x10,
smMaskDateAll = smDateCreation | smDateModified | smDateAccess,
smMaskAll = smMaskDateAll | smSize | smAttributes
} |
| enum | OpenFlags {
ofNone = 0x0,
ofRead = 0x1,
ofWrite = 0x2,
ofAppend = 0x4,
ofStat = 0x8,
ofReadWrite = ofRead | ofWrite
} |
| enum | ShareFlags { shNone = 0x0,
shRead = 0x1,
shWrite = 0x2,
shMaskAny = shRead | shWrite
} |
Public Member Functions |
| | File (const String &fileName) |
| | File (const String &fileName, uint32 openFlags, ShareFlags shareFlags=File::shMaskAny) |
| | File () |
| virtual | ~File () |
| FilePeer * | getPeer () |
| | gets the file peer returns FilePeer* the file peer
|
| virtual void | setName (const String &fileName) |
| | sets the name of the File and creates the peer if it does not exists yet
|
| String | getName () const |
| String | getOwner () |
| | gets the owner of the file returns String the owner of the file
|
| void | resetStats () |
| | reset infos like the fileAttributes, DateTime stamps
|
| void | updateStat (File::StatMask statMask=File::smMaskAll) |
| | updates the informations about the file from the file system
|
| bool | isDirectory () |
| | tells if the file is a directory file on the file system returns true if it is a directory
|
| bool | isExecutable () |
| | tells if the file has a read only attribute on the file system returns true if it is read only
|
| bool | isReadOnly () |
| | tells if the file has a read only attribute on the file system returns true if it is read only
|
| bool | isSystem () |
| | tells if the file has a system attribute on the file system returns true if it is a system file
|
| bool | isHidden () |
| | tells if the file has a hidden attribute on the file system returns true if it is a hidden file
|
| bool | isArchive () |
| | tells if the file has an archive attribute on the file system returns true if it is archived
|
| bool | isDevice () |
| | tells if the file has a device attribute on the file system returns true if it is a device
|
| bool | isNormal () |
| | tells if the file has a normal attribute on the file system returns true if it is a normal file
|
| bool | isReadable () |
| | tells if a file can be opened for reading returns bool true if can be opened for reading
|
| bool | isWriteable () |
| | tells if a file can be opened for writing returns bool true if can be opened for reading
|
| VCF::uint64 | getSize () |
| | gets the size of the file in bytes
|
| FileAttributes | getFileAttributes () |
| | gets the file attributes of the file
|
| void | setFileAttributes (const File::FileAttributes fileAttributes) |
| | set the fileAttributes of the file
|
| DateTime | getDateCreation () |
| | gets the date of creation of the file
|
| DateTime | getDateModified () |
| | gets the modification Date of the file
|
| DateTime | getDateAccess () |
| | gets the date of the last access to the file
|
| void | setDateModified (const DateTime &date) |
| | set the modification Date of the file given in UTC time
|
| void | updateTime () |
| | updates the file's modified time to the time when call is made the time is internally converted in UTC time before being assigned to the file
|
| bool | exists () const |
| | tells if a filename actually exists in the filesystem
|
| void | open () |
| | opens the file using the current file name assigned to it
|
| void | openWithFileName (const String &fileName) |
| | opens a new file, closes the old one if previously opened
|
| void | openWithRights (const String &fileName, uint32 openFlags=File::ofRead, ShareFlags shareFlags=File::shMaskAny) |
| | opens a file with read/write access Closes the old one if previously opened
|
| void | close () |
| | closes the file if open it can be called even if it was not opened
|
| void | create (const String &newFileName, uint32 openFlags=File::ofRead) |
| | creates a new file, as opposed to open, which simply opens an existing one.
|
| void | remove () |
| | deletes the file from the file system
|
| void | move (const String &newFileName) |
| | renames/moves a file
|
| void | copyTo (const String &fileNameToCopyTo) |
| | copies the file into another one
|
| FileInputStream * | getInputStream () |
| | This returns a new instance of an InputStream that's attached to this file.
|
| FileOutputStream * | getOutputStream () |
| | This returns a new instance of an OutputStream that's attached to this file.
|
| void | internal_setStatMask (const StatMask &val) |
| | functions for modifying the file member values.
|
| void | internal_addToStatMask (const uint32 &val) |
| void | internal_removeFromStatMask (const uint32 &val) |
| void | internal_setFileName (const String &val) |
| void | internal_setFileAttributes (const uint32 &val) |
Static Public Member Functions |
| static bool | exists (const String &fileName) |
| | tells if a filename actually exists in the filesystem
|
Protected Attributes |
| FilePeer * | filePeer_ |
| StatMask | validStat_ |
| uint32 | openAccess_ |
| String | fileName_ |
| String | owner_ |
| uint32 | fileAttributes_ |
class represents a single file or directory.