InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CResourceShell Class Reference

#include <CResourceShell.h>

Inheritance diagram for CResourceShell:
MResourceShellWResourceShell

Public Types

typedef bool16(* EnumResource )(IPMStream *s, void *enumData)
 

Static Public Member Functions

static SysHandle GetResource (const RsrcSpec &spec)
 
static int16 CountResourcesLI (const PMLocaleId &locale, RsrcType resType)
 
static int16 CountResourcesLI (const RsrcSpec &spec)
 
static SysHandle GetResourceLI (const RsrcSpec &spec)
 
static void EnumerateResourcesLI (const PMLocaleId &locale, const PluginID &pluginID, RsrcType resType, EnumResource func, void *enumData, bool16 resourceAlreadyOpened=kFalse)
 
static void EnumerateResources (const PluginID &pluginID, RsrcType resType, EnumResource func, void *enumData)
 

Detailed Description

This is a utility class for reading resources. Many of the methods are LocaleIndex resource aware. This means if you ask for some resource, this code will first look to see if there is a matching LocaleIndex resource, and if there is it will look up the localized index of the resource and return that to you, instead of blindly reading the resource you asked for. If you don't want this auto-localization behavior, don't use the methods that end with "LI"

Member Typedef Documentation

typedef bool16(* CResourceShell::EnumResource)(IPMStream *s, void *enumData)

typedef for the function signature required to do resource enumeration.

Member Function Documentation

static int16 CResourceShell::CountResourcesLI (const PMLocaleIdlocale,
RsrcType resType 
)
static

Counts how many resources there are of the given type in the currently open resource file.

Parameters
localewhich locale we're reading resources for. This code will look for a LocaleIndex resource to determine the real localized resource to read for this locale.
resTypewhich resource kind to read
Returns
count of resources of the desired type for the specified locale in the currently open resource file.
static int16 CResourceShell::CountResourcesLI (const RsrcSpecspec)
static

Counts how many resources there are of the given type in the currently open resource file.

Parameters
specwhich resource to read.
See Also
RsrcSpec
Returns
count of resources matching the RsrcSpec in the currently open resource file.
static void CResourceShell::EnumerateResources (const PluginIDpluginID,
RsrcType resType,
EnumResource func,
void * enumData 
)
static

Enumerate all the resources of a type. Stops iteration if EnumResource returns false. This function does NOT use LocaleIndex resources.

Parameters
pluginIDwhich plugin to enumerating resources for.
resTypewhich resource type to enumerating.
funcwhich function to call for each resource being enumerated.
enumDataprivate data which will be passed back to the enum function.
static void CResourceShell::EnumerateResourcesLI (const PMLocaleIdlocale,
const PluginIDpluginID,
RsrcType resType,
EnumResource func,
void * enumData,
bool16 resourceAlreadyOpened = kFalse 
)
static

Enumerate all the resources of a type. Stops iteration if EnumResource returns false. This function does find the appropriate localized resource using LocaleIndex resources if any.

Parameters
localewhich locale to enumerating resources for.
pluginIDwhich plugin to enumerating resources for.
resTypewhich resource type to enumerating.
funcwhich function to call for each resource being enumerated.
enumDataprivate data which will be passed back to the enum function.
resourceAlreadyOpenedis the resource already opened or should this code do it?
static SysHandle CResourceShell::GetResource (const RsrcSpecspec)
static

Simply reads the desired resource into a handle. Does NOT use the LocaleIndex resource to get an appropriate localized resource.

Parameters
specwhich resource to read.
See Also
RsrcSpec
Returns
handle containing the resource data
static SysHandle CResourceShell::GetResourceLI (const RsrcSpecspec)
static

Reads the requested resource into a handle. Does use the LocaleIndex resource to get an appropriate localized resource.

Parameters
specwhich resource to read.
See Also
RsrcSpec
Returns
handle containing the resource data