The FileSelector Object: 3.3 File Selector Instance Data: Matching a File's Token

Up: GEOS SDK TechDocs | Up | Prev: 3.2 The GFSI_fileCriteria Field | Next: 3.4 Matching a File's Creator App
ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH, MSG_GEN_FILE_SELECTOR_SET_TOKEN, MSG_GEN_FILE_SELECTOR_GET_TOKEN

Since every GEOS file has a token associated with it, you can limit directory scans to include only those files with a given token. (Note that directories and volumes are not affected by this limitation.) Alternatively, because the token is made up of two items, the token chars and the token ID, you can arrange a search based on just the token characters (you can not search on only the ID).

Both the match token ID and the match token characters are stored in the File Selector's ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH instance field. This field is of type GeodeToken , the structure of which is shown below:

  typedef struct {
   TokenChars			GT_chars[TOKEN_CHARS_LENGTH];
   ManufacturerID			GT_manufID;
} GeodeToken;

The GT_chars field is four characters as defined in the geode's geode parameters ( .gp ) file. The GT_manufID field is the manufacturer ID number allotted to the particular developer who created the geode.

If the GFSI_fileCriteria attribute FSFC_TOKEN_NO_ID is set, only the token characters will be matched. The ID portion of the token will be ignored by the File Selector (until FSFC_TOKEN_NO_ID is turned off). See The GFSI_fileCriteria Field for more information on GFSI_fileCriteria .

If no token information is set, no filter will be applied based on tokens. To set the token at run-time, send MSG_GEN_FILE_SELECTOR_SET_TOKEN to the File Selector. To retrieve the token match information, send MSG_GEN_FILE_SELECTOR_GET_TOKEN .

MSG_GEN_FILE_SELECTOR_SET_TOKEN

void	MSG_GEN_FILE_SELECTOR_SET_TOKEN(
        dword		tokenChars,
        ManufacturerID		manufacturerID);

This message sets the ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH field to the two passed values. The token set with this message will be used to filter out certain files; directories and volumes are not affected by this filter.

If the File Selector is visible when it receives this message, it will rescan the current directory using the new token information. Otherwise, the File Selector will store the passed token.

Source: Unrestricted.

Destination: Any GenFileSelector object.

Parameters: tokenChars The token characters of the token to match files against. Use the macro SET_TOKEN_CHARS (below) to set this dword value from the four individual characters.

manufacturerID
The token ID of the token to match files against.

Return: Nothing.

Interception: Generally not intercepted.

See Also: MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA , MSG_GEN_FILE_SELECTOR_SET_CREATOR

MSG_GEN_FILE_SELECTOR_GET_TOKEN

void	MSG_GEN_FILE_SELECTOR_GET_TOKEN(
        GetTokenCreatorParams *retValue);

This message returns the current token match information set in the File Selector's ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH field.

Source: Unrestricted.

Destination: Any GenFileSelector object.

Parameters: retValue A pointer to a GetTokenCreatorParams structure, shown below. The structure may be empty when passed.

Return: The GetTokenCreatorParams structure pointed to by retValue will contain the token in ATTR_GEN_FILE_SELECTOR_TOKEN_MATCH .

Structures: The GetTokenCreatorParams structure consists of two elements: a GeodeToken structure containing the File Selector's token characters and manufacturer ID fields, and a reserved word. Its structure is shown below:

typedef struct {
    GeodeToken   GTP_Token;
    word         GTP_Unused;						/* reserved */
} GetTokenCreatorParams;

Interception: Generally not intercepted.

See Also: MSG_GEN_FILE_SELECTOR_SET_FILE_CRITERIA , MSG_GEN_FILE_SELECTOR_GET_CREATOR

SET_TOKEN_CHARS

dword	SET_TOKEN_CHARS(ch1, ch2, ch3, ch4);
        char	ch1, ch2, ch3, ch4;

This macro creates a single dword containing the four given characters. Use this macro to create the tokenChars parameter for MSG_GEN_FILE_SELECTOR_SET_TOKEN and MSG_GEN_FILE_SELECTOR_SET_CREATOR .


Up: GEOS SDK TechDocs | Up | Prev: 3.2 The GFSI_fileCriteria Field | Next: 3.4 Matching a File's Creator App