GEOS SDK TechDocs
|
|
3.6 Masking File Names
|
3.8 Searching Via Callback Routine
ATTR_GEN_FILE_SELECTOR_FILE_ATTR, MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS, MSG_GEN_FILE_SELECTOR_SET_FILE_ATTRS
All files have a number of attributes stored in a record of type
FileAttrs
. (For full information on
FileAttrs
, see the File System chapter.) To filter files based on the FileAttrs
record, set your File Selector's variable data instance field
ATTR_GEN_FILE_SELECTOR_FILE_ATTR
to reflect the attributes that must be on and those that must be off.
ATTR_GEN_FILE_SELECTOR_FILE_ATTR
is a structure of type
GenFileSelectorFileAttrs
, shown below. This structure contains two fields:
GFSFA_match
represents the attributes an acceptable file has on, and
GFSFA_mismatch
represents the attributes an acceptable file has off.
typedef struct {
FileAttrs GFSFA_match;
FileAttrs GFSFA_mismatch;
} GenFileSelectorFileAttrs;
Note: For directories not to be filtered out when FSFC_DIRS isn't set, you must mismatch FA_SYSTEM and FA_HIDDEN. That is, to show only those subdirectories which match your filter criteria, ensure FSFC_DIRS is not set, and set mismatch attributes thus:
ATTR_GEN_FILE_SELECTOR_FILE_ATTR = {
0,
FA_HIDDEN | FA_SYSTEM
}
You may retrieve the current file attributes by sending the message
MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS
to the File Selector object. You may set new file attribute limitations by sending it the message
MSG_GEN_FILE_SELECTOR_SET_FILE_ATTRS
.
void MSG_GEN_FILE_SELECTOR_SET_FILE_ATTRS(
FileAttrs setAttrs,
FileAttrs clearAttrs);
This message sets the
ATTR_GEN_FILE_SELECTOR_FILE_ATTR
vardata instance field of the File Selector. If the File Selector is visible on the screen when it receives this message, it will rescan the directory immediately with the new attributes.
Source: Unrestricted.
Destination: Any GenFileSelector object
Parameters:
setAttrs
A
FileAttrs
record to be set into
GFSFA_match
. Only files with these flags set will pass the filter.
clearAttrs
FileAttrs
record to be set into
GFSFA_mismatch
. Only files with these flags cleared will pass the filter.Return: Nothing.
Interception: Generally not intercepted.
See Also:
MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA
word MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS();
This message returns the ATTR_GEN_FILE_SELECTOR_FILE_ATTR of the File Selector. This attribute contains two byte-sized fields which represent the match and mismatch attributes (see above).
Source: Unrestricted.
Destination: Any GenFileSelector object.
Parameters: None.
Return: A word value: The high byte represents the mismatch attributes, and the low byte represents the match attributes. To extract these two fields from the returned value, use the macros GET_MATCH_FILE_ATTRS and GET_MISMATCH_FILE_ATTRS (below).
Interception: Generally not intercepted.
See Also:
MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA
byte GET_MATCH_FILE_ATTRS(attr);
word attr;
This macro extracts the
GFSFA_match
portion of the word value returned by
MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS
. The extracted value is a record of
FileAttrs
.
byte GET_MISMATCH_FILE_ATTRS(attr);
word attr;
This macro extracts the
GFSFA_mismatch
portion of the word value returned by
MSG_GEN_FILE_SELECTOR_GET_FILE_ATTRS
. The extracted value is a record of
FileAttrs
.
GEOS SDK TechDocs
|
|
3.6 Masking File Names
|
3.8 Searching Via Callback Routine