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:

hzEcodeAddRoot(hzString& pathname)hzString& fileCriteria,
hzEcodeAddRoot(hzPair& p)
hzChain&Error(void)
hzEcodeExport(const char* filepath)Export the hzDirSync to a file
hzEcodeImport(const char* filepath)Populate the hzFileset instance from a import file
hzEcodeScan(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_tTotalBytes(void)
uint32_tTotalDirs(void)
uint32_tTotalFiles(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:

hzChainm_ErrorReport errors during scan
hzList<hzPair>m_RootsRoot directories
hzMapS<hzString,hzDirent*>m_dirsIndex of directories by name
hzMapM<hzString,hzDirent*>m_fileIndex of files by name
uint32_tm_nBlocsNo of block devices
uint64_tm_nBytesTotal bytes in all files on all disks
uint32_tm_nCharsNo of char devices
uint32_tm_nLinksNo of links
uint32_tm_nSocksNo of open sockets