Public Member Functions | Static Public Member Functions

MStringResource Class Reference

This reference page is linked to from the following overview topics: 国際化プロセス.


Search for all occurrences

Detailed Description

Localizable string resources.

The MStringResource class implements methods for registering and retrieving string values from externally defined string resources. This allows the plug-in to provide localized string resources.

The lookup is done using MStringResourceId values.

#include <MStringResource.h>

List of all members.

Public Member Functions

  MStringResource ()
  The Class constructor.
  ~MStringResource ()
  The class destructor.

Static Public Member Functions

static const MString  getString (const MStringResourceId &id, MStatus &status)
  Retrieve a string resource using a key value.
static MStatus  registerString (const MStringResourceId &id)
  Register a plugin string resource.

Constructor & Destructor Documentation

The Class constructor.

Not used as all methods are static.

The class destructor.

Not used as all methods are static.


Member Function Documentation

const MString getString ( const MStringResourceId id,
MStatus status 
) [static]

Retrieve a string resource using a key value.

By default, the string returned will be the default string value provided as part of the string ID and registered via MStringResource::registerString. If a localized value has been provided, it will be returned instead. See also MStringResourceId and MFnPlugin::registerUIString.

Parameters:
[in] id Resource id of the string to retrieve.
[in] status MS::kSuccess if lookup succeeded, otherwise MS::kFailure
Returns:
The string if it can be found, the empty string otherwise.
Examples:
animFileUtils.cpp, animImportExport.cpp, closestPointOnCurveCmd.cpp, GLSLShaderNode.cpp, and nodeInfoCmd.cpp.
MStatus registerString ( const MStringResourceId id ) [static]

Register a plugin string resource.

The MStringResourceId passed in provides all the information required to register the string and to initialize it to its default value.

See also MStringResourceId and MFnPlugin::getUIString.

Parameters:
[in] id Resource id associated with the string to register.
Returns:
MS::kSuccess if registration succeeded, otherwise MS::kFailure
Examples:
animImportExport.cpp, AshliPluginMain.cpp, closestPointOnCurvePlugin.cpp, and nodeInfoCmd.cpp.

MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource
MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource MStringResource