Defined in file: hzDirectory.h
The hzFileset (file set) class defines a file system subset as a set of one or more 'roots' (directory path + file criteria), and facilitates 'snapshots' of the file system subset. The file system subset can be for any purpose (e.g. the HadronZoo C++ Class library headers and source code). The basic idea is to populate the m_dirs and m_file maps by a recursive scan of each and every root. Then at some later point, the existing m_dirs and m_file content is marked and the scan run again, to identify files that are new or have changed since the last scan.
Constructors/Detructors
| hzFileset* | hzFileset | (void) | |
| void | ~hzFileset | (void) |
Public Methods:
| hzEcode | AddRoot | (hzString& pathname)hzString& fileCriteria, | |
| hzEcode | AddRoot | (hzPair& p) | |
| hzChain& | Error | (void) | |
| hzEcode | Export | (const char* filepath) | Export the hzDirSync to a file |
| hzEcode | Import | (const char* filepath) | Populate the hzFileset instance from a import file |
| hzEcode | Scan | (void) | Run a fileset scan. This populates the maps m_dirs and m_file, by scanning the directories specified in the map m_Roots. Firstly mark all existing files (those in m_dirs and m_files) for delete before a run. Then during the run the new files will be marked as CREATE and existing files either as MODIFY or NOACTION. Arguments: None |
| uint64_t | TotalBytes | (void) | |
| uint32_t | TotalDirs | (void) | |
| uint32_t | TotalFiles | (void) | |
| void | _clear | (void) | Clear the file set. This function returns void and has no arguments. There are no reportable errors. Arguments: None Returns: None |
| hzEcode | _scan_r | (hzDirent*)hzString& curdir, hzString& fileCriteria, | Move thru current directory and read files and sub directories. As this is a private function of the hzFileset class and cannot be called directly by an application, certain assumptions have been permitted. At the point where it is called by hzFileset::Scan() and the parent is null the directory we are actually in is one of the roots of the hzFileset instance. |
Member Variables:
| hzChain | m_Error | Report errors during scan | |
| hzList<hzPair> | m_Roots | Root directories | |
| hzMapS<hzString,hzDirent*> | m_dirs | Index of directories by name | |
| hzMapM<hzString,hzDirent*> | m_file | Index of files by name | |
| uint32_t | m_nBlocs | No of block devices | |
| uint64_t | m_nBytes | Total bytes in all files on all disks | |
| uint32_t | m_nChars | No of char devices | |
| uint32_t | m_nLinks | No of links | |
| uint32_t | m_nSocks | No of open sockets |