Jump to content

wpclsQueryInstanceFilter

From EDM2
Revision as of 21:40, 25 May 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpclsQueryInstanceFilter}} This method is called to allow the class object to specify the file title filters for instances of its class. ==Syntax== _wpclsQueryInstanceFilter(somSelf) ==Parameters== ;'''somSelf''' (M_WPFileSystem *) - input :Pointer to the WPFileSystem class object. ;'''psuccess''' (PSZ) - returns :Success indicator. NULL Error occurred. Other A pointer to a string containing file title filters. This string can contain several fi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This method is called to allow the class object to specify the file title filters for instances of its class.

Syntax

_wpclsQueryInstanceFilter(somSelf)

Parameters

somSelf (M_WPFileSystem *) - input
Pointer to the WPFileSystem class object.
psuccess (PSZ) - returns
Success indicator. NULL Error occurred. Other A pointer to a string containing file title filters. This string can contain several file title filters separated by commas. For example: '*.TXT, *.DOC'.

Returns

psuccess (PSZ) - returns
Success indicator. NULL Error occurred. Other A pointer to a string containing file title filters. This string can contain several file title filters separated by commas. For example: '*.TXT, *.DOC'.

Remarks

It is important that the values returned by this class method are restricted to class-specific filters. For example, returning a filter of *.* could effectively make the system unstable.

How to Override

This method should be overridden in order to automatically designate file objects as instances of this class. The value returned by the override method will replace the current title filter string which is used to designate instances. If the parent method is called, it should be called first.

Usage

This method can be called at any time in order to determine which file title filters are used to determine instances of this class.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

M_WPFileSystem     *somSelf;   /*  Pointer to the WPFileSystem class object. */
PSZ                 psuccess;  /*  Success indicator. */

psuccess = _wpclsQueryInstanceFilter(somSelf);

This example shows how to designate files ending in an extension of .GIF as being associated with an instance of a GIFPicture object.

SOM_Scope PSZ   SOMLINK gifpicM_wpclsQueryInstanceFilter(M_GIFPicture *somSelf)
{
    /* M_GIFPictureData *somThis = M_GIFPictureGetData(somSelf); */
    M_GIFPictureMethodDebug('M_GIFPicture','gifpicM_wpclsQueryInstanceFilter');

/*    return (parent_wpclsQueryInstanceFilter(somSelf));   Don't call parent */

      return ( '*.GIF' );
}

Related Methods