C++ API Reference
MStringResource Class Reference

Localizable string resources. More...

#include <MStringResource.h>

Public Member Functions

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

Static Public Member Functions

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

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.

Constructor & Destructor Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MStringResource ( )

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]idResource id of the string to retrieve.
[in]statusMS::kSuccess if lookup succeeded, otherwise MS::kFailure
Returns
The string if it can be found, the empty string otherwise.
Examples:
AbcBullet/AbcBullet.cpp, AbcImport/AbcImportStrings.cpp, animImportExport/animFileUtils.cpp, animImportExport/animImportExport.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, closestPointOnCurve/closestPointOnCurveCmd.cpp, dx11Shader/dx11ShaderStrings.cpp, glslShader/GLSLShaderStrings.cpp, gpuCache/CacheWriterAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCachePluginMain.cpp, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheUtil.h, hwApiTextureTest/hwApiTextureTestStrings.cpp, MetadataSample/createMetadataCmd.cpp, MetadataSample/exportMetadataCmd.cpp, MetadataSample/importMetadataCmd.cpp, MetadataSample/metadataBase.cpp, MetadataXML/associationsSerializerXML.cpp, MetadataXML/channelSerializerXML.cpp, MetadataXML/streamSerializerXML.cpp, MetadataXML/structureSerializerXML.cpp, nodeInfoCmd/nodeInfoCmd.cpp, sceneAssembly/adskRepresentationCmd.cpp, sceneAssembly/adskRepresentations.cpp, sceneAssembly/adskSceneMetadataCmd.cpp, sceneAssembly/assemblyReference.cpp, and sceneAssembly/sceneAssemblyPluginMain.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]idResource id associated with the string to register.
Returns
MS::kSuccess if registration succeeded, otherwise MS::kFailure
Examples:
AbcImport/AbcImportStrings.cpp, animImportExport/animImportExport.cpp, closestPointOnCurve/closestPointOnCurvePlugin.cpp, dx11Shader/dx11ShaderStrings.cpp, glslShader/GLSLShaderStrings.cpp, gpuCache/gpuCachePluginMain.cpp, hwApiTextureTest/hwApiTextureTestStrings.cpp, nodeInfoCmd/nodeInfoCmd.cpp, and sceneAssembly/sceneAssemblyPluginMain.cpp.

The documentation for this class was generated from the following files: