![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cFileDir.h>
Public Member Functions | |
| cFileDir (cStringF sDirPath="") | |
| virtual | ~cFileDir () |
| cStringF | get_DirPath () const |
| void | put_DirPath (cStringF sDirPath) |
| ITERATE_t | get_FileCount () const |
| const cFileFindEntry & | GetEnumFile (ITERATE_t i) const |
| cFileFindEntry & | GetEnumFile (ITERATE_t i) |
| cStringF | GetEnumTitleX (ITERATE_t i) const |
| cStringF | GetEnumPath (ITERATE_t i) const |
| cStringF | GetFilePath (const FILECHAR_t *pszTitle) const |
| void | RemoveAll () |
| HRESULT | ReadDir (const FILECHAR_t *pszDirPath=nullptr, const FILECHAR_t *pszWildcardFile=nullptr, ITERATE_t iFilesMax=k_FilesMax, bool bFollowLink=false) |
| HRESULT | ReadDirAnyExt (const FILECHAR_t *pszFilePath, ITERATE_t iFilesMax=k_FilesMax) |
| HRESULT | ReadDirPreferredExt (const FILECHAR_t *pszFilePath, const FILECHAR_t *const *pszExtTable) |
Static Public Member Functions | |
| static HRESULT __stdcall | RemoveDirectory1 (const FILECHAR_t *pszDirName) |
| static HRESULT __stdcall | CreateDirectory1 (const FILECHAR_t *pszDirName) |
| static HRESULT __stdcall | CreateDirectoryX (const FILECHAR_t *pszDirName) |
| static HRESULT __stdcall | CreateDirForFileX (const FILECHAR_t *pszFilePath) |
| static HRESULT __stdcall | MovePathToTrash (const FILECHAR_t *pszPath, bool bDir) |
| static HRESULT __stdcall | DirFileOp (FILEOP_TYPE eOp, const FILECHAR_t *pszDirSrc, const FILECHAR_t *pszDirDest, DWORD nFileFlags, cLogProcessor *pLog, IStreamProgressCallback *pProgress) |
| static HRESULT __stdcall | MoveDirFiles (const FILECHAR_t *pszDirSrc, const FILECHAR_t *pszDirDest, cLogProcessor *pLog=nullptr, IStreamProgressCallback *pProgress=nullptr) |
| static HRESULT __stdcall | CopyDirFiles (const FILECHAR_t *pszDirSrc, const FILECHAR_t *pszDirDest, cLogProcessor *pLog=nullptr, IStreamProgressCallback *pProgress=nullptr) |
| static HRESULT __stdcall | DeleteDirFiles (const FILECHAR_t *pszDirName, const FILECHAR_t *pszWildcardFile=nullptr, DWORD nFileFlags=0) |
| static HRESULT __stdcall | DeletePathX (const FILECHAR_t *pszPath, DWORD nFileFlags=0) |
Public Attributes | |
| cArrayStruct< cFileFindEntry > | m_aFiles |
| Array of the files we found matching the ReadDir criteria. More... | |
Static Public Attributes | |
| static const int | k_FilesMax = 64 * 1024 |
| static const LOGCHAR_t | k_szCantMoveFile [] = "Can't Move File " |
| if MoveDirFiles failed for this. More... | |
Protected Member Functions | |
| virtual HRESULT | AddFileDirEntry (cFileFindEntry &FileEntry) |
Protected Attributes | |
| cStringF | m_sDirPath |
| Does NOT include the wild card. More... | |
Friends | |
| class | cFileDirTests |
A file folder or directory. read/cached as a single action. Stores a list of the files as a single action.
|
inlineexplicit |
|
inlinevirtual |
|
inlineprotectedvirtual |
Just add the file to a list. Overload this to do extra filtering.
|
inlinestatic |
Copy this directory and all its files.
|
static |
HRESULT_WIN32_C(ERROR_ALREADY_EXISTS) is OK ? use CreateDirectory1 name because might be "#define CreateDirectory CreateDirectoryA" in _WIN32 Does NOT create missing parent folders.
|
static |
This is like CreateDirectory1() except will create intermediate/parent directories if needed.
|
static |
CreateDirectoryX() for a file. will create intermediate/parent directories if needed.
|
inlinestatic |
Delete this directory AND all its files. similar to cFileDirDlg::DeleteDirFiles( FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI ) e.g. cFileDir::DeleteDirFiles( pszDirPath ); = delete directory and all its sub stuff. e.g. cFileDir::DeleteDirFiles( pszDirPath, "*.h" ); = delete contents of directory and all its wild carded children. leaves directory.
|
static |
Delete this file or directory. If it's a directory then delete recursively. No wildcards.
|
static |
Copy, Delete or Move a directory AND all files in the directory (pszDirSrc) to pszDirDest. with recursive descent.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Move this directory and all its files.
|
static |
Move file/directory to the trash bin/folder. For use with FOF_ALLOWUNDO and FILEOP_DELETE like WIN32 SHFileOperation(FOF_ALLOWUNDO);
|
inline |
| HRESULT Gray::cFileDir::ReadDir | ( | const FILECHAR_t * | pszDirPath = nullptr, |
| const FILECHAR_t * | pszWildcardFile = nullptr, |
||
| ITERATE_t | iFilesMax = k_FilesMax, |
||
| bool | bFollowLink = false |
||
| ) |
calls the virtual AddFileDirEntry()
| HRESULT Gray::cFileDir::ReadDirAnyExt | ( | const FILECHAR_t * | pszFilePath, |
| ITERATE_t | iFilesMax = k_FilesMax |
||
| ) |
Find this file name but with any extension.
| HRESULT Gray::cFileDir::ReadDirPreferredExt | ( | const FILECHAR_t * | pszFilePath, |
| const FILECHAR_t *const * | pszExtTable | ||
| ) |
Find just a single file with the preferred extension from a list. Ignore any existing extension
|
inline |
Dispose of my data.
|
static |
|
friend |
|
static |
|
static |
if MoveDirFiles failed for this.
MoveDirFiles failed for this.
| cArrayStruct<cFileFindEntry> Gray::cFileDir::m_aFiles |
Array of the files we found matching the ReadDir criteria.
|
protected |
Does NOT include the wild card.