![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cFileStatus.h>
Public Member Functions | |
cFileStatus () | |
cFileStatus (const FILECHAR_t *pszFilePath) | |
void | InitFileStatus () |
void | InitFileStatus (const cFileStatusSys &statusSys) |
bool | UpdateLinuxHidden (const FILECHAR_t *pszName) noexcept |
bool | isFileValid () const noexcept |
bool | IsSameChangeFileTime (const cTimeFile &t2) const noexcept |
(accurate to 2 seconds) More... | |
bool | IsSameChangeTime (const cTimeInt &t2) const noexcept |
bool | IsFileEqualTo (const THIS_t &rFileStatus) const noexcept |
bool | IsFileEqualTo (const THIS_t *pFileStatus) const noexcept |
bool | IsAttrMask (FILEATTR_MASK_t dwAttrMask=FILEATTR_ReadOnly) const noexcept |
bool | isAttrDir () const noexcept |
bool | isAttrHidden () const noexcept |
FILE_SIZE_t | GetFileLength () const noexcept |
HRESULT | ReadFileStatus (const FILECHAR_t *pszFilePath, bool bFollowLink=false) |
Static Public Member Functions | |
static bool | IsLinuxHidden (const FILECHAR_t *pszName) noexcept |
static COMPARE_t __stdcall | CompareChangeFileTime (const cTimeFile &t1, const cTimeFile &t2) |
(accurate to 2 seconds) More... | |
static TIMESEC_t __stdcall | MakeFatTime (TIMESEC_t tTime) noexcept |
static COMPARE_t __stdcall | CompareChangeTime (const cTimeInt &t1, const cTimeInt &t2) noexcept |
static HRESULT __stdcall | WriteFileAttributes (const FILECHAR_t *pszFilePath, FILEATTR_MASK_t dwAttributes) |
static HRESULT __stdcall | WriteFileTimes (const FILECHAR_t *pszFilePath, const cTimeFile *pTimeCreate, const cTimeFile *pTimeChange=nullptr) |
static HRESULT __stdcall | WriteFileTimes (const FILECHAR_t *pszFilePath, const cFileStatus &rFileStatus) |
static HRESULT __stdcall | ReadFileStatus2 (const FILECHAR_t *pszFilePath, cFileStatus *pFileStatus=nullptr, bool bFollowLink=false) |
static bool __stdcall | Exists (const FILECHAR_t *pszFilePath) |
Public Attributes | |
cTimeFile | m_timeCreate |
m_ctime = (may not be supported by file system). More... | |
cTimeFile | m_timeChange |
m_mtime = real world time/date of last modification. (FAT32 only accurate to 2 seconds) // All OS support this. More... | |
cTimeFile | m_timeLastAccess |
m_atime = time of last access/Open. (For Caching). (may not be supported by file system) More... | |
FILE_SIZE_t | m_Size |
file size in bytes. size_t. not always accurate for directories. (-1) More... | |
FILEATTR_MASK_t | m_Attributes |
Mask of FILEATTR_TYPE_ attribute bits. FILEATTR_None. More... | |
Attributes for a file (or directory) in a directory. Does NOT store the name. Support of fields varies based on file system. FAT,FAT32,NTFS, etc Similar to ANSI (or POSIX) stat() _stat Similar to MFC cFileStatus
Gray::cFileStatus::cFileStatus | ( | ) |
Gray::cFileStatus::cFileStatus | ( | const FILECHAR_t * | pszFilePath | ) |
|
inlinestatic |
(accurate to 2 seconds)
~2 sec accurate for FAT32
|
inlinestaticnoexcept |
~2 second accurate for FAT32
|
inlinestatic |
boolean true if this file exists? I can read it. Does not mean I can write to it.
|
inlinenoexcept |
get the 64 bit length of the file. -1 = size not available for directories.
void Gray::cFileStatus::InitFileStatus | ( | ) |
void Gray::cFileStatus::InitFileStatus | ( | const cFileStatusSys & | statusSys | ) |
convert from OS native format.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
have this attribute? e.g. FILEATTR_ReadOnly
do these 2 files have the same attributes.
|
inlinenoexcept |
did i get file data ? is this a file vs a device ?
|
inlinestaticnoexcept |
Is this a hidden file on linux (NFS) ?
(accurate to 2 seconds)
~2 sec accurate for FAT32
(accurate to 2 seconds)
|
inline |
|
static |
get info/attributes/status on a single file or dir. Similar to the MFC CFileFind. Are wildcards allowed ??
|
inlinenoexcept |
Is this a linux (NFS) hidden file name ? starts with dot.
|
static |
Set attributes for a NON open file. dwAttributes = FILEATTR_Hidden, FILEATTR_ReadOnly
|
static |
|
static |
Update the created/changed time for a file. (by name) (similar to 'touch' command) May have varying levels of support for OS, FAT, NTFS, NFS, etc
FILEATTR_MASK_t Gray::cFileStatus::m_Attributes |
Mask of FILEATTR_TYPE_ attribute bits. FILEATTR_None.
FILE_SIZE_t Gray::cFileStatus::m_Size |
file size in bytes. size_t. not always accurate for directories. (-1)
cTimeFile Gray::cFileStatus::m_timeChange |
m_mtime = real world time/date of last modification. (FAT32 only accurate to 2 seconds) // All OS support this.
cTimeFile Gray::cFileStatus::m_timeCreate |
m_ctime = (may not be supported by file system).
cTimeFile Gray::cFileStatus::m_timeLastAccess |
m_atime = time of last access/Open. (For Caching). (may not be supported by file system)