YedPoll - Scan_Dir
int Scan_Dir(void *pvObject,SCHAR *pscFilter,SCHAR scFlagType,
The method counts and eventually extracts entries from working directory of pvObject instance.
Entries can be filtered through pscFilter: if NULL, no filter is applied. Format of pscFilter is:
Any filter substring terminated with '\0' is matched with any directory entry: if an entry contains almost one of them, it's put in the set of filtered entries. The filter must be terminated with sequence '\0\0', else method behaviour is unpredictable. Tilde operator ( '˜' ) applies the inverse rule: if an entry does not contain any filter substring, it's put in the set of filtered entries. If the filter substrings are two or more and there is no tilde operator into them, they're processed in OR mode: if a directory entry has one of them, it's put in the set of filtered entries.
scFlagType parameter selects entry types to examine in the working directory:
Scan_Dir examines only subdirectories in working directory ( '.' and '..' included ).
Scan_Dir examines only files in working directory.
Scan_Dir examines both files and subdirectories in working directory.
scFlagStore parameter sets storing mode of filtered entries. It can be:
Filtered entries are stored.
Filtered entries are only counted, but not stored.
If entries are not stored, invoking some other methods of the object, as Get_Dir_Entries and Get_Size_Dir_Entries, will return an error.
The method return the number of filtered entries in current working directory. In case of an error, the method returns:
No working directory is set.
Error in accessing working directory. Is it non-existent? Or protected?
Heap memory unavailable to store directory entries.