MString Class Reference
 
 
 

#include <MString.h>


Class Description

Manipulate strings.

The MString class implements a string class, and is used to pass all string arguments to Maya API methods.

The MString class supports localized strings. Use of the MString class to store and manipulate strings largely insulates the code from locale-dependent processing. Code that uses the class and its methods will in most cases operate seamlessly in both multibyte and single-byte environments. Knowledge of the underlying string storage mechanism or encoding is not required to use the class, and assumptions about this should not be made by the calling code.

Unless otherwise indicated, MString methods accepting or returning string contents via character buffers (char *) use the convention that the string contents are in the locale's native multibyte encoding. Methods which explicitly support other common encodings and representations such as UTF-8 and wchar_t are also provided. Code that manipulates string contents should use the multibyte-safe methods provided by the class. Refer to documentation on individual MString methods for more information.

Examples:

AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, AbcExport/AttributesWriter.cpp, AbcExport/MayaCameraWriter.cpp, AbcExport/MayaLocatorWriter.cpp, AbcExport/MayaMeshWriter.cpp, AbcExport/MayaNurbsCurveWriter.cpp, AbcExport/MayaNurbsSurfaceWriter.cpp, AbcExport/MayaPointPrimitiveWriter.cpp, AbcExport/MayaTransformWriter.cpp, AbcExport/MayaUtility.cpp, AbcExport/MayaUtility.h, AbcImport/AbcImport.cpp, AbcImport/AbcImportStrings.cpp, AbcImport/AbcImportStrings.h, AbcImport/AlembicImportFileTranslator.cpp, AbcImport/AlembicImportFileTranslator.h, AbcImport/AlembicNode.cpp, AbcImport/AlembicNode.h, AbcImport/CameraHelper.cpp, AbcImport/CreateSceneHelper.cpp, AbcImport/CreateSceneHelper.h, AbcImport/LocatorHelper.cpp, AbcImport/main.cpp, AbcImport/MeshHelper.cpp, AbcImport/NodeIteratorVisitorHelper.cpp, AbcImport/NodeIteratorVisitorHelper.h, AbcImport/NurbsCurveHelper.cpp, AbcImport/NurbsSurfaceHelper.cpp, AbcImport/util.cpp, AbcImport/util.h, animExportUtil/animExportUtil.cpp, animExportUtil/animExportUtil.h, animExportUtil/animFileExport.cpp, animExportUtil/animFileExport.h, animImportExport/animFileUtils.cpp, animImportExport/animFileUtils.h, animImportExport/animImportExport.cpp, animImportExport/animImportExport.h, animInfoCmd/animInfoCmd.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshData.cpp, apiMeshShape/apiMeshData.h, apiMeshShape/apiMeshGeometryOverride.cpp, apiMeshShape/apiMeshGeometryOverride.h, apiMeshShape/apiMeshShape.cpp, apiMeshShape/apiMeshSubSceneOverride.cpp, AshliShader/AshliPluginMain.cpp, AshliShader/fxManagerCmd.cpp, AshliShader/glExtensions.cpp, AshliShader/GLSLShaderNode.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomAnimLayers.h, atomImportExport/atomCachedPlugs.cpp, atomImportExport/atomCachedPlugs.h, atomImportExport/atomFileUtils.cpp, atomImportExport/atomFileUtils.h, atomImportExport/atomImportExport.cpp, atomImportExport/atomImportExport.h, atomImportExport/atomNodeNameReplacer.cpp, atomImportExport/atomNodeNameReplacer.h, backfillShader/backfillShader.cpp, blindComplexDataCmd/blindComplexDataCmd.cpp, blindDataShader/blindDataPluginMain.cpp, blindDoubleDataCmd/blindDoubleDataCmd.cpp, blindShortDataCmd/blindShortDataCmd.cpp, brickShader/brickShader.cpp, cameraSetSubclass/testExCameraSetCmd.cpp, cameraSetSubclass/testExCameraSetCmd.h, cellShader/cellShader.cpp, cgfxAttrDef.cpp, cgfxAttrDef.h, cgfxEffectDef.cpp, cgfxEffectDef.h, cgfxFindImage.cpp, cgfxFindImage.h, cgfxPassStateSetter.cpp, cgfxProfile.cpp, cgfxProfile.h, cgfxShaderCmd.cpp, cgfxShaderCmd.h, cgfxShaderNode.cpp, cgfxShaderNode.h, cgfxTextureCache.cpp, cgfxTextureCache.h, checkerShader/checkerShader.cpp, cleanPerFaceAssignment/cleanPerFaceAssignmentCmd.cpp, clearcoat.cpp, closestPointCmd/closestPointCmd.cpp, closestPointOnCurve/closestPointOnCurveCmd.cpp, closestPointOnCurve/closestPointOnCurveCmd.h, closestPointOnNurbsSurfaceCmd/closestPointOnNurbsSurfaceCmd.cpp, clothPaintAttrCmd/clothPaintAttrCmd.cpp, componentScaleManip/componentScaleManip.cpp, compositingShader/compositingShader.cpp, conditionTest/conditionTest.cpp, contrastShader/contrastShader.cpp, convertBumpCmd/convertBumpCmd.cpp, convertEdgesToFacesCmd/convertEdgesToFacesCmd.cpp, convertVerticesToEdgesCmd/convertVerticesToEdgesCmd.cpp, convertVerticesToFacesCmd/convertVerticesToFacesCmd.cpp, createClipCmd/createClipCmd.cpp, customAttrManip/customAttrManip.cpp, customImagePlane/customImagePlane.cpp, customTextureShader/customTextureShader.cpp, customTextureShader/customTextureShader.h, customTextureShader/customTextureShaderMainMaya.cpp, customTextureShader/customTextureShaderOverride.cpp, customTextureShader/customTextureShaderOverride.h, cvColorShader/cvColorShader.cpp, cvPosCmd/cvPosCmd.cpp, D3DViewportRenderer/D3DGeometryItem.cpp, D3DViewportRenderer/D3DResourceManager.cpp, D3DViewportRenderer/D3DResourceManager.h, D3DViewportRenderer/D3DTextureItem.cpp, D3DViewportRenderer/D3DViewportRenderer.cpp, dagMessageCmd/dagMessageCmd.cpp, dagPoseInfoCmd/dagPoseInfoCmd.cpp, ddsFloatReader.cpp, deletedMsgCmd/deletedMsgCmd.cpp, depthShader/depthShader.cpp, displacementShader/displacementShader.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11Shader.h, dx11Shader/dx11ShaderCmd.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, dx11Shader/dx11ShaderCompileHelper.h, dx11Shader/dx11ShaderOverride.cpp, dx11Shader/dx11ShaderOverride.h, dx11Shader/dx11ShaderPluginMain.cpp, dx11Shader/dx11ShaderStrings.cpp, dx11Shader/dx11ShaderStrings.h, dx11Shader/dx11ShaderUniformParamBuilder.cpp, dx11Shader/dx11ShaderUniformParamBuilder.h, DX11ViewportRenderer/DX11GeometryItem.cpp, DX11ViewportRenderer/DX11ResourceManager.cpp, DX11ViewportRenderer/DX11ResourceManager.h, DX11ViewportRenderer/DX11TextureItem.cpp, DX11ViewportRenderer/DX11ViewportRenderer.cpp, dynExprField/dynExprField.cpp, eventTest/eventTest.cpp, exampleCameraSetView/exampleCameraSetView.cpp, exampleCameraSetView/exampleCameraSetView.h, exampleRampAttribute/exampleMRampAttribute.cpp, exportJointClusterDataCmd/exportJointClusterDataCmd.cpp, exportSkinClusterDataCmd/exportSkinClusterDataCmd.cpp, externalDropCallback/externalDropCallback.cpp, fileIOMsgCmd/fileIOMsgCmd.cpp, fileTexture/fileTexture.cpp, filteredAsciiFile/filteredAsciiFile.cpp, findFileTexturesCmd/findFileTexturesCmd.cpp, findTexturesPerPolygonCmd/findTexturesPerPolygonCmd.cpp, flameShader/flameShader.cpp, fluidInfoCmd/fluidInfoCmd.cpp, footPrintManip/footPrintManip.cpp, footPrintNode/footPrintNode.cpp, fxManagerCmd.h, gammaShader/gammaShader.cpp, geometryCacheConverter/geometryCacheBlockBase.cpp, geometryCacheConverter/geometryCacheBlockBase.h, geometryCacheConverter/geometryCacheBlockDVAData.cpp, geometryCacheConverter/geometryCacheBlockDVAData.h, geometryCacheConverter/geometryCacheBlockFVAData.cpp, geometryCacheConverter/geometryCacheBlockFVAData.h, geometryCacheConverter/geometryCacheBlockIntData.cpp, geometryCacheConverter/geometryCacheBlockIntData.h, geometryCacheConverter/geometryCacheBlockStringData.cpp, geometryCacheConverter/geometryCacheBlockStringData.h, geometryCacheConverter/geometryCacheConverter.cpp, geometryCacheConverter/geometryCacheFile.cpp, geometryCacheConverter/geometryCacheFile.h, geometryReplicator/geometryReplicator.cpp, geomShader/geomShader.cpp, getAttrAffectsCmd/getAttrAffectsCmd.cpp, GLSLShaderNode.h, gpuCache/CacheReader.cpp, gpuCache/CacheReader.h, gpuCache/CacheReaderAlembic.cpp, gpuCache/CacheReaderAlembic.h, gpuCache/CacheWriter.cpp, gpuCache/CacheWriter.h, gpuCache/CacheWriterAlembic.cpp, gpuCache/CacheWriterAlembic.h, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheConfig.cpp, gpuCache/gpuCacheConfig.h, gpuCache/gpuCacheDrawOverride.cpp, gpuCache/gpuCacheGeometry.cpp, gpuCache/gpuCacheGeometry.h, gpuCache/gpuCacheGeometryOverride.cpp, gpuCache/gpuCacheGeometryOverride.h, gpuCache/gpuCacheMaterial.cpp, gpuCache/gpuCacheMaterial.h, gpuCache/gpuCacheMaterialBakers.cpp, gpuCache/gpuCacheMaterialNodes.cpp, gpuCache/gpuCacheMaterialNodes.h, gpuCache/gpuCachePluginMain.cpp, gpuCache/gpuCacheSample.cpp, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheShapeNode.h, gpuCache/gpuCacheSubSceneOverride.cpp, gpuCache/gpuCacheUtil.h, gpuCache/gpuCacheVramQuery.cpp, gpuCache/gpuCacheVramQuery.h, helix2Cmd/helix2Cmd.cpp, helixCmd/helixCmd.cpp, helixQtCmd.cpp, helixQtCmd.h, helixTool/helixTool.cpp, hlslShader/hlslPluginMain.cpp, hlslShader/hlslShader.cpp, hlslShader/hlslShader.h, hwAnisotropicShader_NV20/hwAnisotropicShader_NV20.cpp, hwAnisotropicShader_NV20/hwAnisotropicShader_NV20.h, hwAnisotropicShader_NV20/MTexture.cpp, hwAnisotropicShader_NV20/MTexture.h, hwAnisotropicShader_NV20/MTextureCache.cpp, hwAnisotropicShader_NV20/MTextureCache.h, hwAnisotropicShader_NV20/NodeMonitor.cpp, hwAnisotropicShader_NV20/NodeMonitor.h, hwAnisotropicShader_NV20/ShadingConnection.cpp, hwAnisotropicShader_NV20/ShadingConnection.h, hwApiTextureTest/hwApiTextureTest.cpp, hwApiTextureTest/hwApiTextureTestStrings.cpp, hwApiTextureTest/hwApiTextureTestStrings.h, hwApiTextureTest/hwRendererHelper.cpp, hwApiTextureTest/hwRendererHelperDX.cpp, hwColorPerVertexShader/hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.h, hwDecalBumpShader_NV20/MTexture.cpp, hwDecalBumpShader_NV20/MTexture.h, hwDecalBumpShader_NV20/MTextureCache.cpp, hwDecalBumpShader_NV20/MTextureCache.h, hwDecalBumpShader_NV20/NodeMonitor.cpp, hwDecalBumpShader_NV20/NodeMonitor.h, hwDecalBumpShader_NV20/ShadingConnection.cpp, hwDecalBumpShader_NV20/ShadingConnection.h, hwManagedTextureShader/hwManagedTextureShader.cpp, hwPhongShader/hwPhongShader.cpp, hwPhongShader/hwPhongShaderBehavior.cpp, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.cpp, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.h, hwReflectBumpShader_NV20/MTexture.cpp, hwReflectBumpShader_NV20/MTexture.h, hwReflectBumpShader_NV20/MTextureCache.cpp, hwReflectBumpShader_NV20/MTextureCache.h, hwReflectBumpShader_NV20/NodeMonitor.cpp, hwReflectBumpShader_NV20/NodeMonitor.h, hwReflectBumpShader_NV20/ShadingConnection.cpp, hwReflectBumpShader_NV20/ShadingConnection.h, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.cpp, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.h, hwRefractReflectShader_NV20/MTexture.cpp, hwRefractReflectShader_NV20/MTexture.h, hwRefractReflectShader_NV20/MTextureCache.cpp, hwRefractReflectShader_NV20/MTextureCache.h, hwRefractReflectShader_NV20/NodeMonitor.cpp, hwRefractReflectShader_NV20/NodeMonitor.h, hwRefractReflectShader_NV20/ShadingConnection.cpp, hwRefractReflectShader_NV20/ShadingConnection.h, hwRenderPostEffect/hwRenderPostEffect.cpp, hwToonShader_NV20/hwToonShader_NV20.cpp, hwToonShader_NV20/hwToonShader_NV20.h, hwToonShader_NV20/MTexture.cpp, hwToonShader_NV20/MTexture.h, hwToonShader_NV20/MTextureCache.cpp, hwToonShader_NV20/MTextureCache.h, hwToonShader_NV20/NodeMonitor.cpp, hwToonShader_NV20/NodeMonitor.h, hwToonShader_NV20/ShadingConnection.cpp, hwToonShader_NV20/ShadingConnection.h, hwUnlitShader/hwUnlitShader.cpp, hwUnlitShader/hwUnlitShader.h, hwUnlitShader/MTexture.cpp, hwUnlitShader/MTexture.h, hwUnlitShader/MTextureCache.cpp, hwUnlitShader/MTextureCache.h, hwUnlitShader/NodeMonitor.cpp, hwUnlitShader/NodeMonitor.h, hwUnlitShader/ShadingConnection.cpp, hwUnlitShader/ShadingConnection.h, iffInfoCmd/iffInfoCmd.cpp, iffInfoCmd/iffreader.cpp, iffInfoCmd/iffreader.h, iffPixelCmd/iffPixelCmd.cpp, iffPixelCmd/iffreader.cpp, iffPixelCmd/iffreader.h, iffPpmCmd/iffPpmCmd.cpp, iffPpmCmd/iffreader.cpp, iffPpmCmd/iffreader.h, instancerListCmd/instancerListCmd.cpp, interpShader/interpShader.cpp, intersectCmd/intersectCmd.cpp, intersectOnNurbsSurfaceCmd/intersectOnNurbsSurfaceCmd.cpp, jlcVcrDevice/jlcVcrDevice.cpp, lambertShader/lambertShader.cpp, lambertShader/lambertShaderOverride.cpp, lambertShader/lambertShaderOverride.h, latticeNoise/latticeNoiseCmd.cpp, lavaShader/lavaShader.cpp, lensDistortionCallback/lensDistortionCallback.cpp, lensDistortionCallback/lensDistortionCallback.h, lepTranslator/lepTranslator.cpp, lightShader/lightShader.cpp, lineManip/lineManip.cpp, lineManipContainer/lineManipContainer.cpp, listRichSelectionCmd/listRichSelectionCmd.cpp, lockEvent/lockEvent.cpp, manipOverride/customTriadManip.cpp, manipOverride/manipOverride.cpp, maTranslator/maTranslator.cpp, meshOpCmd/polyModifierCmd.cpp, meshOpCmd/polyModifierCmd.h, meshReorder/meshRemapCmd.cpp, meshReorder/meshRemapTool.h, meshReorder/meshReorderCmd.cpp, meshReorder/meshReorderTool.h, MetadataSample/createMetadataCmd.cpp, MetadataSample/createMetadataCmd.h, MetadataSample/exportMetadataCmd.cpp, MetadataSample/importMetadataCmd.cpp, MetadataSample/importMetadataCmd.h, MetadataSample/metadataBase.cpp, MetadataXML/associationsSerializerXML.cpp, MetadataXML/channelSerializerXML.cpp, MetadataXML/streamSerializerXML.cpp, MetadataXML/structureSerializerXML.cpp, mixtureShader/mixtureShader.cpp, motionTraceCmd/motionTraceCmd.cpp, moveManip/moveManip.cpp, moveNumericTool/moveNumericTool.cpp, moveTool/moveTool.cpp, narrowPolyViewer/narrowPolyViewer.cpp, narrowPolyViewer/narrowPolyViewer.h, nodeCreatedCBCmd/nodeCreatedCBCmd.cpp, nodeCreatedCBCmd/nodeCreatedCBCmd.h, nodeIconCmd/nodeIconCmd.cpp, nodeInfoCmd/nodeInfoCmd.cpp, noiseShader/noiseShader.cpp, objExport/objExport.cpp, offsetNode/offsetNode.cpp, OpenEXR.cpp, OpenGLViewportRenderer/OpenGLViewportRenderer.cpp, OpenGLViewportRenderer/OpenGLViewportRenderer.h, particlePathsCmd/particlePathsCmd.cpp, particleSystemInfoCmd/particleSystemInfoCmd.cpp, peltOverlapCmd/peltOverlapCmd.cpp, pfxInfoCmd/pfxInfoCmd.cpp, phongShader/phongShader.cpp, phongShader/phongShaderOverride.cpp, phongShader/phongShaderOverride.h, pickCmd/pickCmd.cpp, pluginMain.cpp, pnTriangles/pnTrianglesNode.cpp, pointOnMeshInfo/pointOnMeshCmd.cpp, pointOnMeshInfo/pointOnMeshCmd.h, polyPrimitiveCmd/polyPrimitiveCmd.cpp, polyRawExporter/polyExporter.cpp, polyRawExporter/polyExporter.h, polyRawExporter/polyRawExporter.cpp, polyRawExporter/polyRawExporter.h, polyRawExporter/polyRawWriter.cpp, polyRawExporter/polyRawWriter.h, polyRawExporter/polyWriter.cpp, polyRawExporter/polyWriter.h, polyX3DExporter/polyExporter.cpp, polyX3DExporter/polyExporter.h, polyX3DExporter/polyWriter.cpp, polyX3DExporter/polyWriter.h, polyX3DExporter/polyX3DExporter.cpp, polyX3DExporter/polyX3DExporter.h, polyX3DExporter/polyX3DWriter.cpp, polyX3DExporter/polyX3DWriter.h, progressWindowCmd/progressWindowCmd.cpp, qtForms.cpp, qtForms.h, referenceQueryCmd/referenceQueryCmd.cpp, renderAccessNode/renderAccessNode.cpp, rockingTransform/rockingTransformMain.cpp, rotateManip/rotateManip.cpp, sampleCmd/sampleCmd.cpp, sampleParticles/sampleParticles.cpp, saveSwatchesCmd.cpp, saveSwatchesCmd.h, scanDagCmd/scanDagCmd.cpp, scanDagSyntax/scanDagSyntax.cpp, sceneAssembly/adskPrepareRenderGlobals.cpp, sceneAssembly/adskPrepareRenderGlobals.h, sceneAssembly/adskRepresentationCmd.cpp, sceneAssembly/adskRepresentationCmd.h, sceneAssembly/adskRepresentationFactory.h, sceneAssembly/adskRepresentations.cpp, sceneAssembly/adskRepresentations.h, sceneAssembly/assemblyDefinition.cpp, sceneAssembly/assemblyDefinition.h, sceneAssembly/assemblyReference.cpp, sceneAssembly/assemblyReference.h, sceneAssembly/assemblyReferenceInitialRep.cpp, sceneAssembly/assemblyReferenceInitialRep.h, sceneAssembly/sceneAssemblyPluginMain.cpp, selectClosestPointLocator/selectClosestPointLocator.cpp, shadowMatteShader/shadowMatteShader.cpp, ShapeMonitor/ShapeMonitor.cpp, ShapeMonitor/ShapeMonitor.h, shellNode/shellNode.cpp, shiftNode/shiftNode.cpp, simpleImageFile/simpleImageFile.cpp, simpleSolverNode/simpleSolverNode.cpp, skinClusterWeights/skinClusterWeights.cpp, slopeShader/slopeShader.cpp, slopeShader/slopeShaderBehavior.cpp, solidCheckerShader/solidCheckerShader.cpp, spiralAnimCurveCmd/spiralAnimCurveCmd.cpp, splitUVCmd/polyModifierCmd.cpp, splitUVCmd/polyModifierCmd.h, splitUVCmd/splitUVFtyAction.cpp, squareScaleManip/squareScaleManip.cpp, squareScaleManip/squareScaleManip.h, squareScaleManipContext/squareScaleManipContext.cpp, stringFormatNode/stringFormatNode.cpp, surfaceBumpManip/surfaceBumpManip.cpp, swissArmyManip/swissArmyManip.cpp, testCameraSetCmd/testCameraSetCmd.cpp, testNobjectNode/testNobjectNode.cpp, testNpassiveNode/testNpassiveNode.cpp, testNsolverNode/testNsolverNode.cpp, testNucleusNode/testNucleusNode.cpp, threadingLockTests/threadingLockTests.cpp, threadTestCmd/threadTestCmd.cpp, threadTestWithLocksCmd/threadTestWithLocksCmd.cpp, tiffFloatReader.cpp, udpDevice/udpDevice.cpp, uiDrawManager/uiDrawManager.cpp, undoRedoMsgCmd/undoRedoMsgCmd.cpp, userMsgCmd/userMsgCmd.cpp, viewCallbackTest/viewCallbackTest.cpp, viewCaptureCmd/viewCaptureCmd.cpp, viewDX11DeviceAccess/viewDX11DeviceAccess.cpp, viewImageBlitOverride/viewImageBlitOverride.cpp, viewImageBlitOverride/viewImageBlitOverride.h, viewObjectFilter/viewObjectFilter.cpp, viewRenderOverride/viewRenderOverride.cpp, viewRenderOverride/viewRenderOverride.h, viewRenderOverride/viewRenderOverrideOperations.cpp, viewRenderOverride/viewRenderOverrideUserOperation.cpp, viewRenderOverrideMRT/viewRenderOverrideMRT.cpp, viewRenderOverrideMRT/viewRenderOverrideMRT.h, viewRenderOverrideShadows/viewRenderOverrideShadows.cpp, viewRenderOverrideShadows/viewRenderOverrideShadows.h, volumeLightCmd/volumeLightCmd.cpp, volumeShader/volumeShader.cpp, whatisCmd/whatisCmd.cpp, xmlAssembly/AssemblyCommand.cpp, xmlAssembly/AssemblyCommand.h, xmlAssembly/AssemblyExporter.cpp, xmlAssembly/AssemblyExporter.h, xmlAssembly/AssemblyImporter.cpp, xmlAssembly/AssemblyImporter.h, xmlAssembly/AssemblyImporterWithDepth.cpp, xmlAssembly/AssemblyImporterWithDepth.h, xmlAssembly/AssemblyLoaderBase.cpp, xmlAssembly/AssemblyLoaderBase.h, xmlAssembly/AssemblyPreloader.cpp, xmlAssembly/AssemblyPreloader.h, xmlAssembly/AssemblySceneLoader.cpp, xmlAssembly/AssemblySceneLoader.h, xmlAssembly/AssemblyTranslator.cpp, xmlAssembly/AssemblyTranslator.h, xmlAssembly/AssetDefinition.cpp, xmlAssembly/AssetDefinition.h, xmlAssembly/AssetGuidManager.cpp, xmlAssembly/AssetGuidManager.h, xmlAssembly/AssetInstance.h, xmlAssembly/AssetLibManager.cpp, xmlAssembly/AssetLibManager.h, xmlAssembly/AssetNode.cpp, xmlAssembly/AssetNode.h, xmlAssembly/BBoxesRep.cpp, xmlAssembly/BBoxesRep.h, xmlAssembly/BoundingBoxRep.cpp, xmlAssembly/BoundingBoxRep.h, xmlAssembly/CacheRep.cpp, xmlAssembly/CacheRep.h, xmlAssembly/ChildrenRep.cpp, xmlAssembly/ChildrenRep.h, xmlAssembly/FileRep.cpp, xmlAssembly/FileRep.h, xmlAssembly/FileSystemManager.cpp, xmlAssembly/FileSystemManager.h, xmlAssembly/FnAssetInstance.cpp, xmlAssembly/FnAssetInstance.h, xmlAssembly/FnAssetInstanceUtil.cpp, xmlAssembly/FnAssetInstanceUtil.h, xmlAssembly/LocatorRep.cpp, xmlAssembly/LocatorRep.h, xmlAssembly/NamespaceGuard.cpp, xmlAssembly/NamespaceGuard.h, xmlAssembly/pluginMain.cpp, xmlAssembly/Representation.cpp, xmlAssembly/Representation.h, xmlAssembly/Utility.cpp, xmlAssembly/Utility.h, xmlAssembly/XMLAssembly.cpp, xmlAssembly/XMLAssembly.h, xmlAssembly/XMLAssetInstance.cpp, xmlAssembly/XMLAssetInstance.h, xmlAssembly/XMLAssetNode.cpp, xmlAssembly/XMLAssetNode.h, xmlAssembly/XMLFileRep.cpp, xmlAssembly/XMLFileRep.h, xmlAssembly/XMLGeneratorCommand.cpp, xmlAssembly/XMLGeneratorCommand.h, xmlAssembly/XMLReader.cpp, xmlAssembly/XMLRepresentation.cpp, xmlAssembly/XMLRepresentation.h, xmlAssembly/XMLWriter.cpp, xmlAssembly/XMLWriter.h, XmlGeometryCache/XmlGeometryCache.cpp, and XmlGeometryCacheDesc/XmlGeometryCacheDesc.cpp.

List of all members.

Public Member Functions

  MString ()
  The Class constructor.
  MString (const char *charString)
  Class constructor.
  MString (const wchar_t *charString)
  Class constructor.
  MString (const char *charString, int charLength)
  Class constructor.
  MString (const wchar_t *charString, int wcharLength)
  Class constructor.
  MString (const MString &other)
  Copy constructor.
  ~MString ()
  The class destructor.
MString operator+= (const MString &other)
  In-place addition with another MString.
MString operator+= (const char *other)
  In-place addition with a C++ string.
MString operator+= (double other)
  In-place addition with a double value.
MString operator+= (int other)
  In-place addition with an int value.
MString operator+= (unsigned int other)
  In-place addition with an unsigned int value.
MString operator+= (float other)
  In-place addition with a float value.
MString operator= (const MString &other)
  Assignment operator.
MString operator= (const char *other)
  Assignment operator.
MString operator= (double value)
  Assignment operator.
bool  operator== (const MString &other) const
  Equality operator.
bool  operator== (const char *other) const
  Equality operator.
bool  operator!= (const MString &other) const
  Inequality operator.
bool  operator!= (const char *other) const
  Inequality operator.
MString  operator+ (const MString &other) const
  Addition with another MString.
MString  operator+ (const char *other) const
  Addition with a C++ string.
MString  operator+ (double value) const
  Addition with a double value.
MStatus  set (const char *charString)
  Set the value of the string in this MString instance.
MStatus  setUTF8 (const char *utf8String)
  Set the value of the string in this MString instance using a null-terminated utf-8 encoded character string.
MStatus  setWChar (const wchar_t *wcharString)
  Set the value of the string in this MString instance using a null-terminated wide character string.
MStatus  set (const char *charString, int charLength)
  Set the value of the string in this MString instance to the value of the character buffer passed.
MStatus  setWChar (const wchar_t *wcharString, int wcharLength)
  Set the value of the string in this MString instance using a wide string and its length.
MStatus  set (double value)
  Set the value of the string in this MString instance.
MStatus  set (double value, int precision)
  Set the value of the string in this MString instance, with the given precision.
const char *  asChar () const
  Return the current string in this MString instance as a C++ char* pointer.
const char *  asChar (int &charLength) const
  Return the current string in this MString instance as a C++ char* pointer.
const char *  asUTF8 () const
  Return the current string in this MString instance as a C++ char* pointer to a null-terminated utf-8 encoded string.
const char *  asUTF8 (int &utf8Length) const
  Return the current string in this MString instance as a C++ char* pointer to a null-terminated utf-8 encoded string.
const wchar_t *  asWChar () const
  Return the current string in this MString instance as pointer to a null terminated wide character (wchar_t) buffer.
const wchar_t *  asWChar (int &numChars) const
  Return the current string in this MString instance as pointer to a null terminated wide character (wchar_t) buffer.
unsigned int  length () const
  Returns the length of the string buffer in this MString instance.
unsigned int  numChars () const
  Returns the number of characters in the MString instance.
void  clear ()
  Clears the contents of this MString instance and sets it value to the empty string.
int  index (char) const
  Returns the position of the first occurance of the character searchChar in the string or -1 if the character is not found.
int  indexW (char) const
  Returns the position of the first occurance of the character searchChar in the string or -1 if the character is not found.
int  indexW (wchar_t) const
  Returns the position of the first occurance of the wide character searchChar in the string or -1 if the character is not found.
int  indexW (const MString &) const
  Returns the position of the first occurance of the searchString in the string or -1 if it is not found.
int  rindex (char) const
  Returns the position of the last occurance of the character searchChar in the string or -1 if the character is not found.
int  rindexW (char) const
  Returns the position of the last occurance of the character searchChar in the string or -1 if the character is not found.
int  rindexW (wchar_t) const
  Returns the position of the last occurance of the wide character searchChar in the string or -1 if the character is not found.
int  rindexW (const MString &) const
  Returns the position of the last occurance of the searchString in the string or -1 if it is not found.
MStatus  split (char, MStringArray &) const
  Split the string up at each occurrence of theChar and place the separate strings into theArray.
MStatus  split (wchar_t, MStringArray &) const
  Split the string up at each occurrence of the given wide character and place the separate strings into theArray.
MString  substring (int start, int end) const
  Return a new MString instance that contains the characters from start to end inclusive.
MString  substringW (int start, int end) const
  Return a new MString instance that contains the characters from start to end inclusive.
MString toUpperCase ()
  Modify the current instance of the string replacing all lower case characters in the corresponding upper case characters.
MString toLowerCase ()
  Modify the current instance of the string replacing all lower case characters in the corresponding upper case characters.
bool  isShort () const
  Returns true if the string represents a valid short, and false otherwise.
short  asShort () const
  Returns the value of the string in this MString instance converted to a short.
bool  isInt () const
  Returns true if the string represents a valid int, and false otherwise.
int  asInt () const
  Returns the value of the string in this MString instance converted to an integer.
bool  isUnsigned () const
  Returns true if the string represents a valid unsigned int, and false otherwise.
unsigned int  asUnsigned () const
  Returns the value of the string in this MString instance converted to an unsigned integer.
bool  isFloat () const
  Returns true if the string represents a valid float, and false otherwise.
float  asFloat () const
  Returns the value of the string in this MString instance converted to a float.
bool  isDouble () const
  Returns true if the string represents a valid double, and false otherwise.
double  asDouble () const
  Returns the value of the string in this MString instance converted to a double.
MString  expandEnvironmentVariablesAndTilde (MStatus *ReturnStatus=NULL) const
  Returns a new string constructed by duplicating the current string with all environment variables expanded (and on UNIX, tilde characaters ("~") are also expanded.
MString  expandFilePath (MStatus *ReturnStatus=NULL) const
  Returns a new string constructed by duplicating the current string with all environment variables expanded (and on UNIX, tilde characaters ("~") are also expanded.
MStatus  format (const MString &fmt, const MStringArray &args)
  Format the string value using a format specifier and an array of positional arguments.
MStatus  format (const MString &fmt, const MString &arg1=MString::argUnused, const MString &arg2=MString::argUnused, const MString &arg3=MString::argUnused, const MString &arg4=MString::argUnused, const MString &arg5=MString::argUnused, const MString &arg6=MString::argUnused, const MString &arg7=MString::argUnused, const MString &arg8=MString::argUnused, const MString &arg9=MString::argUnused, const MString &arg10=MString::argUnused)
  Format the string value using a format specifier and positional arguments.

Friends

OPENMAYA_EXPORT std::ostream &  operator<< (std::ostream &, const MString &)
  NO SCRIPT SUPPORT.
OPENMAYA_EXPORT MString  operator+ (const char *, const MString &)
  NO SCRIPT SUPPORT.

Constructor & Destructor Documentation

MString ( )

The Class constructor.

Initializes the new MString instance to the empty string.

MString ( const char *  charString )

Class constructor.

Create a new instance of an MString and initialize it to the given null-terminated character string.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] charString the initial string value (null-terminated)
MString ( const wchar_t *  wcharString )

Class constructor.

Create a new instance of an MString and initialize it with the null-terminated wide character string.

Parameters:
[in] wcharString the initial string value (null-terminated).
MString ( const char *  charString,
int  charLength 
)

Class constructor.

Create a new instance of an MString and initialize it with the character buffer passed, to the specified length. The length value is the length in bytes of the character buffer passed.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] charString the initial string value.
[in] charLength the initial string length.
MString ( const wchar_t *  wcharString,
int  wcharLength 
)

Class constructor.

Create a new instance of an MString and initialize it to the given wide character string of specified length.

The length value corresponds to the number of wide characters in the initialization string.

Parameters:
[in] wcharString the initial string value.
[in] wcharLength the initial string length (number of characters).
MString ( const MString other )

Copy constructor.

Create a new MString instance and initialize is with the same string as the given one.

Parameters:
[in] other the MString to copy from.

Member Function Documentation

MString & operator+= ( const MString other )

In-place addition with another MString.

The MString on the right is appended to the MString on the left and the result is placed in the left MString.

Parameters:
[in] other Right operand.
MString & operator+= ( const char *  other )

In-place addition with a C++ string.

The character string on the right is appended to the MString on the left and the result is placed in the MString.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] other Right operand.
MString & operator+= ( double  other )

In-place addition with a double value.

The double value on the right is converted to string representation and appended to the MString on the left. The result is placed in the MString.

Parameters:
[in] other Right operand.
MString & operator+= ( int  other )

In-place addition with an int value.

The int value on the right is converted to string representation and appended to the MString on the left. The result is placed in the MString.

Parameters:
[in] other Right operand.
MString & operator+= ( unsigned int  other )

In-place addition with an unsigned int value.

The unsigned int value on the right is converted to string representation and appended to the MString on the left. The result is placed in the MString.

Parameters:
[in] other Right operand.
MString & operator+= ( float  other )

In-place addition with a float value.

The float value on the right is converted to string representation and appended to the MString on the left. The result is placed in the MString.

Parameters:
[in] other Right operand.
MString & operator= ( const MString other )

Assignment operator.

Allows assignment between MString instances.

Parameters:
[in] other Value to be assigned.
MString & operator= ( const char *  other )

Assignment operator.

Allows assignment of the contents of a character buffer to this MString.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] other Value to be converted to MString and assigned.
MString & operator= ( double  value )

Assignment operator.

Allows assignment of a number to this MString.

Parameters:
[in] value Value to be converted to MString and assigned.
bool operator== ( const MString other ) const

Equality operator.

Allows two MStrings to be compared to see if they contain identical strings.

Parameters:
[in] other Right operand.
bool operator== ( const char *  other ) const

Equality operator.

Allows an MString and the contents of a character buffer to be compared to see if they contain identical strings.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] other Right operand.
bool operator!= ( const MString other ) const

Inequality operator.

Allows two MStrings to be compared to see if they differ.

Parameters:
[in] other Right operand.
bool operator!= ( const char *  other ) const

Inequality operator.

Allows an MString to be compared with the contents of a character buffer to see if the two strings differ.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] other Right operand.
MString operator+ ( const MString other ) const

Addition with another MString.

The MString on the right is appended to the MString on the left and the result is returned in a new MString. Neither of the operands is modified.

Parameters:
[in] other Right operand.
MString operator+ ( const char *  other ) const

Addition with a C++ string.

The character string on the right is appended to the MString on the left and the result is returned in a new MString. Neither of the operands is modified.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] other Right operand.
MString operator+ ( double  value ) const

Addition with a double value.

The double value on the right is converted to string representation and appended to the MString on the left. The result is returned in a new MString. The MString on the left is not modified.

Parameters:
[in] value Right operand.
MStatus set ( const char *  charString )
MStatus setUTF8 ( const char *  utf8String )

Set the value of the string in this MString instance using a null-terminated utf-8 encoded character string.

Note: conversion errors may occur if the multibyte encoding of the current locale cannot represent the utf-8 characters in the assignment string.

Parameters:
[in] utf8String null-terminated utf-8 character string buffer.
Returns:
MS::kSuccess for success, otherwise MS::kFailure
MStatus setWChar ( const wchar_t *  wcharString )

Set the value of the string in this MString instance using a null-terminated wide character string.

Parameters:
[in] wcharString null-terminated wide character string buffer.
Returns:
MS::kSuccess for success, otherwise MS::kFailure
MStatus set ( const char *  charString,
int  charLength 
)

Set the value of the string in this MString instance to the value of the character buffer passed.

The length value is the length in bytes of the character buffer.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] charString new string value.
[in] charLength new string length.
Returns:
MS::kSuccess for success, otherwise MS::kFailure
MStatus setWChar ( const wchar_t *  wcharString,
int  wcharLength 
)

Set the value of the string in this MString instance using a wide string and its length.

The length value corresponds to the number of wide characters in the input string.

Parameters:
[in] wcharString New wide character string value.
[in] wcharLength New string length (number of wide characters)
Returns:
MS::kSuccess for success, otherwise MS::kFailure
MStatus set ( double  value )

Set the value of the string in this MString instance.

The numeric value will be converted to a character string.

Parameters:
[in] value new number.
Returns:
MS::kSuccess for success, otherwise MS::kFailure
MStatus set ( double  value,
int  precision 
)

Set the value of the string in this MString instance, with the given precision.

The numeric value will be converted to a character string.

Parameters:
[in] value new number.
[in] precision the precision (number of decimal places).
Returns:
MS::kSuccess for success, otherwise MS::kFailure
const char * asChar ( ) const

Return the current string in this MString instance as a C++ char* pointer.

The string will be returned as a null-terminated buffer of type char.

In a localized environment, the string will contain a buffer of multibyte characters in the locale's native encoding.

The length of this representation of the string can be obtained by calling the alternate version of this method that returns the string length, or by calling MString::length().

NOTE: The string should be duplicated if it will be re-used.

Returns:
The char* pointer to the string in this MString instance.
Examples:
AbcExport/AbcExport.cpp, AbcExport/AbcWriteJob.cpp, AbcExport/AttributesWriter.cpp, AbcExport/MayaCameraWriter.cpp, AbcExport/MayaLocatorWriter.cpp, AbcExport/MayaMeshWriter.cpp, AbcExport/MayaNurbsSurfaceWriter.cpp, AbcExport/MayaPointPrimitiveWriter.cpp, AbcExport/MayaTransformWriter.cpp, AbcExport/MayaUtility.h, AbcImport/CreateSceneHelper.cpp, AbcImport/util.cpp, affectsNode/affectsNode.cpp, animExportUtil/animExportUtil.cpp, animImportExport/animFileUtils.cpp, animImportExport/animImportExport.cpp, animInfoCmd/animInfoCmd.cpp, apiMeshShape/apiMeshGeometryOverride.cpp, AshliShader/GLSLShaderNode.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, atomImportExport/atomNodeNameReplacer.cpp, cgfxAttrDef.cpp, cgfxEffectDef.cpp, cgfxFindImage.cpp, cgfxShaderCmd.cpp, cgfxShaderNode.cpp, cgfxTextureCache.cpp, D3DViewportRenderer/D3DResourceManager.cpp, D3DViewportRenderer/D3DTextureItem.cpp, dagPoseInfoCmd/dagPoseInfoCmd.cpp, ddsFloatReader.cpp, depthShader/depthShader.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, dx11Shader/dx11ShaderOverride.cpp, DX11ViewportRenderer/DX11ResourceManager.cpp, DX11ViewportRenderer/DX11TextureItem.cpp, exportJointClusterDataCmd/exportJointClusterDataCmd.cpp, exportSkinClusterDataCmd/exportSkinClusterDataCmd.cpp, findTexturesPerPolygonCmd/findTexturesPerPolygonCmd.cpp, footPrintNode/footPrintNode.cpp, geometryCacheConverter/geometryCacheFile.cpp, gpuCache/CacheReader.cpp, gpuCache/CacheReaderAlembic.cpp, gpuCache/CacheWriter.cpp, gpuCache/CacheWriterAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheDrawOverride.cpp, gpuCache/gpuCacheMaterial.h, gpuCache/gpuCacheSample.h, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheSubSceneOverride.cpp, gpuCache/gpuCacheVramQuery.cpp, helloCmd/helloCmd.cpp, hlslShader/hlslShader.cpp, hwAnisotropicShader_NV20/MTextureCache.cpp, hwDecalBumpShader_NV20/MTextureCache.cpp, hwPhongShader/hwPhongShader.cpp, hwPhongShader/hwPhongShaderBehavior.cpp, hwReflectBumpShader_NV20/MTextureCache.cpp, hwRefractReflectShader_NV20/MTextureCache.cpp, hwToonShader_NV20/MTextureCache.cpp, hwUnlitShader/MTextureCache.cpp, iffInfoCmd/iffreader.cpp, iffPixelCmd/iffreader.cpp, iffPpmCmd/iffreader.cpp, instancerListCmd/instancerListCmd.cpp, lepTranslator/lepTranslator.cpp, listLightLinksCmd/listLightLinksCmd.cpp, maTranslator/maTranslator.cpp, MetadataSample/importMetadataCmd.cpp, MetadataSample/metadataBase.cpp, MetadataXML/associationsSerializerXML.cpp, MetadataXML/channelSerializerXML.cpp, MetadataXML/streamSerializerXML.cpp, MetadataXML/structureSerializerXML.cpp, objExport/objExport.cpp, OpenEXR.cpp, OpenGLViewportRenderer/OpenGLViewportRenderer.cpp, particleSystemInfoCmd/particleSystemInfoCmd.cpp, pickCmd/pickCmd.cpp, pluginMain.cpp, polyRawExporter/polyExporter.cpp, polyX3DExporter/polyExporter.cpp, renderViewRenderCmd/renderViewRenderCmd.cpp, renderViewRenderRegionCmd/renderViewRenderRegionCmd.cpp, sampleCmd/sampleCmd.cpp, saveSwatchesCmd.cpp, sceneAssembly/adskRepresentationCmd.cpp, sceneAssembly/assemblyDefinition.cpp, tiffFloatReader.cpp, viewCallbackTest/viewCallbackTest.cpp, viewCaptureCmd/viewCaptureCmd.cpp, viewDX11DeviceAccess/viewDX11DeviceAccess.cpp, viewRenderOverride/viewRenderOverride.cpp, viewRenderOverride/viewRenderOverride.h, viewRenderOverride/viewRenderOverrideOperations.cpp, viewRenderOverride/viewRenderOverrideUserOperation.cpp, viewRenderOverrideShadows/viewRenderOverrideShadows.cpp, whatisCmd/whatisCmd.cpp, xmlAssembly/AssemblyCommand.cpp, xmlAssembly/AssemblyExporter.cpp, xmlAssembly/AssemblyImporter.cpp, xmlAssembly/AssemblyPreloader.cpp, xmlAssembly/AssetDefinition.cpp, xmlAssembly/AssetGuidManager.cpp, xmlAssembly/AssetLibManager.cpp, xmlAssembly/BBoxesRep.cpp, xmlAssembly/FileSystemManager.cpp, xmlAssembly/Utility.cpp, xmlAssembly/XMLWriter.cpp, XmlGeometryCache/XmlGeometryCache.cpp, and XmlGeometryCacheDesc/XmlGeometryCacheDesc.cpp.
const char * asChar ( int &  charLength ) const

Return the current string in this MString instance as a C++ char* pointer.

The string will be returned as a null-terminated buffer of type char.

In a localized environment, the string will contain a buffer of multibyte characters in the locale's native encoding.

The argument passed will be used to return the length of the character buffer returned in bytes (excluding the trailing null).

NOTE: the length value corresponds to the string's character length in bytes, which can differ from the number of characters in the string when running in a localized environment.

NOTE: The string should be duplicated if it will be re-used.

Parameters:
[out] charLength value which will be set to the length of the character buffer returned
Returns:
The char* pointer to the string in this MString instance.
const char * asUTF8 ( ) const

Return the current string in this MString instance as a C++ char* pointer to a null-terminated utf-8 encoded string.

The length of this buffer can be obtained by calling the alternate form of MString::asUTF8 which returns the length value.

NOTE: The string should be duplicated if it will be re-used.

Returns:
The char* pointer to the utf-8 encoded string
Examples:
AbcImport/AlembicNode.cpp.
const char * asUTF8 ( int &  utf8Length ) const

Return the current string in this MString instance as a C++ char* pointer to a null-terminated utf-8 encoded string.

The integer argument passed will be used to return the length of this buffer (in bytes) excluding the trailing null.

NOTE: The string should be duplicated if it will be re-used.

Parameters:
[out] utf8Length Value which will be set to the length of the character buffer returned.
Returns:
The char* pointer to the utf-8 encoded string
const wchar_t * asWChar ( ) const

Return the current string in this MString instance as pointer to a null terminated wide character (wchar_t) buffer.

The number of characters in this buffer will be equivalent to MString::numChars, or can be determined by using the alternate form of MString::awWChar which returns the buffer length.

NOTE: wchar_t types are not portable between platforms and are not recommended for persistent data. A portable multibyte format such as UTF-8 is recommended for file I/O.

NOTE: The string should be duplicated if it will be re-used.

Returns:
The wchar_t* pointer to the string in this MString instance.
Examples:
gpuCache/CacheWriterAlembic.h, and gpuCache/gpuCacheUtil.h.
const wchar_t * asWChar ( int &  wcharLength ) const

Return the current string in this MString instance as pointer to a null terminated wide character (wchar_t) buffer.

The length value returned corresponds to the number of wide characters in the buffer returned (excluding the trailing null).

NOTE: wchar_t types are not portable between platforms and are not recommended for persistent data. A portable multibyte format such as UTF-8 is recommended for file I/O.

NOTE: The string should be duplicated if it will be re-used.

Parameters:
[out] wcharLength number of wide characters in buffer returned
Returns:
The wchar_t* pointer to the string in this MString instance.
unsigned int length ( ) const

Returns the length of the string buffer in this MString instance.

This value corresponds to the length, in bytes, of the charcter buffer returned from the MString::asChar method, excluding the trailing null.

NOTE: When running in a localized (multibyte) environment, the MString::asChar method will return a multibyte buffer, in which the number of characters in the string may not correspond to the number of bytes in the multibyte representation. The use of the MString::numChars method is recommended in place of MString::length for determining the number of individual characters in the string.

Returns:
Unsigned integer value giving the string's character buffer length.
Examples:
AbcExport/AbcExport.cpp, AbcExport/MayaTransformWriter.cpp, AbcImport/AbcImport.cpp, AbcImport/AlembicNode.cpp, AbcImport/CreateSceneHelper.cpp, animImportExport/animFileUtils.cpp, animImportExport/animImportExport.cpp, atomImportExport/atomAnimLayers.cpp, atomImportExport/atomFileUtils.cpp, atomImportExport/atomImportExport.cpp, atomImportExport/atomNodeNameReplacer.cpp, cgfxAttrDef.cpp, cgfxEffectDef.cpp, cgfxFindImage.cpp, cgfxShaderCmd.cpp, cgfxShaderNode.cpp, cgfxTextureCache.cpp, cvPosCmd/cvPosCmd.cpp, D3DViewportRenderer/D3DTextureItem.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, dx11Shader/dx11ShaderUniformParamBuilder.cpp, DX11ViewportRenderer/DX11TextureItem.cpp, externalDropCallback/externalDropCallback.cpp, gpuCache/CacheReader.cpp, gpuCache/CacheReaderAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheGeometryOverride.cpp, gpuCache/gpuCacheMaterial.h, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheSubSceneOverride.cpp, gpuCache/gpuCacheVramQuery.cpp, hlslShader/hlslShader.cpp, hwApiTextureTest/hwApiTextureTest.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.cpp, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.cpp, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.cpp, hwToonShader_NV20/hwToonShader_NV20.cpp, hwUnlitShader/hwUnlitShader.cpp, lepTranslator/lepTranslator.cpp, maTranslator/maTranslator.cpp, MetadataXML/streamSerializerXML.cpp, nodeCreatedCBCmd/nodeCreatedCBCmd.cpp, objExport/objExport.cpp, pluginMain.cpp, sceneAssembly/assemblyReference.cpp, stringFormatNode/stringFormatNode.cpp, viewImageBlitOverride/viewImageBlitOverride.cpp, xmlAssembly/AssemblyCommand.cpp, xmlAssembly/AssemblyExporter.cpp, xmlAssembly/AssemblyLoaderBase.cpp, xmlAssembly/AssetDefinition.cpp, xmlAssembly/AssetGuidManager.cpp, xmlAssembly/CacheRep.cpp, xmlAssembly/ChildrenRep.cpp, xmlAssembly/FileRep.cpp, xmlAssembly/FileSystemManager.cpp, xmlAssembly/FnAssetInstance.cpp, xmlAssembly/LocatorRep.cpp, xmlAssembly/Utility.cpp, xmlAssembly/XMLAssembly.cpp, xmlAssembly/XMLFileRep.cpp, xmlAssembly/XMLGeneratorCommand.cpp, xmlAssembly/XMLWriter.cpp, XmlGeometryCache/XmlGeometryCache.cpp, and XmlGeometryCacheDesc/XmlGeometryCacheDesc.cpp.
unsigned int numChars ( ) const

Returns the number of characters in the MString instance.

NOTE: this value corresponds to the number of actual characters in the string, not its character buffer length. It is suitable for localized environments as it correctly handles multibyte characters.

Returns:
Unsigned integer value giving the number of characters in the string.
Examples:
AbcExport/AbcExport.cpp, AbcImport/AbcImportStrings.cpp, atomImportExport/atomNodeNameReplacer.cpp, gpuCache/gpuCacheUtil.h, sceneAssembly/adskRepresentations.cpp, sceneAssembly/assemblyDefinition.cpp, sceneAssembly/assemblyReference.cpp, and xmlAssembly/XMLAssembly.cpp.
int index ( char  searchChar ) const

Returns the position of the first occurance of the character searchChar in the string or -1 if the character is not found.

The position value returned from index is a byte-based charcter position corresponding to the location in the asChar() form of the string.

NOTE: since this version of index works on the char form of the string it is not reliable within localized (multibyte) environments as the positions returned may not correctly match character boundaries in the multibyte buffer. Use of MString::indexW is recommended instead.

Parameters:
[in] searchChar the character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
Examples:
cgfxFindImage.cpp, cgfxShaderNode.cpp, convertVerticesToEdgesCmd/convertVerticesToEdgesCmd.cpp, and hlslShader/hlslShader.cpp.
int indexW ( char  searchChar ) const

Returns the position of the first occurance of the character searchChar in the string or -1 if the character is not found.

The position value returned from indexW is a character-based position and correctly handles strings in localized (multibyte) environments. Use of MString::indexW over MString::index is recommended.

Parameters:
[in] searchChar the character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
Examples:
AbcImport/AbcImportStrings.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderUniformParamBuilder.cpp, lepTranslator/lepTranslator.cpp, xmlAssembly/FileSystemManager.cpp, and xmlAssembly/XMLGeneratorCommand.cpp.
int indexW ( wchar_t  searchChar ) const

Returns the position of the first occurance of the wide character searchChar in the string or -1 if the character is not found.

The position value returned from indexW is a character-based position and correctly handles strings in localized (multibyte) environments. Use of MString::indexW over MString::index is recommended.

Parameters:
[in] searchChar the wide character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
int indexW ( const MString searchStr ) const

Returns the position of the first occurance of the searchString in the string or -1 if it is not found.

The position value returned from indexW is a character-based position and correctly handles strings in localized (multibyte) environments.

Parameters:
[in] searchStr The string to search for.
Returns:
The starting position of searchString in the string, or -1 if it is not found
int rindex ( char  searchChar ) const

Returns the position of the last occurance of the character searchChar in the string or -1 if the character is not found.

The position value returned from rindex is a byte-based character position corresponding to the location in the asChar() form of the string.

NOTE: since this version of rindex works on the char form of the string it is not reliable within localized (multibyte) environments as the positions returned may not correctly match character boundaries in the multibyte buffer. Use of MString::rindexW is recommended instead.

Parameters:
[in] searchChar the character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
Examples:
cgfxEffectDef.cpp, cgfxFindImage.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, hlslShader/hlslShader.cpp, and xmlAssembly/Utility.cpp.
int rindexW ( char  searchChar ) const

Returns the position of the last occurance of the character searchChar in the string or -1 if the character is not found.

The position value returned from rindexW is a character-based position and correctly handles strings in localized (multibyte) environments. Use of MString::indexW over MString::index is recommended.

Parameters:
[in] searchChar the character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
Examples:
dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, gpuCache/CacheReader.cpp, gpuCache/CacheReaderAlembic.cpp, hwApiTextureTest/hwApiTextureTest.cpp, and xmlAssembly/FileSystemManager.cpp.
int rindexW ( wchar_t  searchChar ) const

Returns the position of the last occurance of the wide character searchChar in the string or -1 if the character is not found.

The position value returned from rindexW is a character-based position and correctly handles strings in localized (multibyte) environments. Use of MString::indexW over MString::index is recommended.

Parameters:
[in] searchChar the character to search for
Returns:
The position of searchChar in the string, or -1 if the searchChar is not found
int rindexW ( const MString searchStr ) const

Returns the position of the last occurance of the searchString in the string or -1 if it is not found.

The position value returned from indexW is a character-based position and correctly handles strings in localized (multibyte) environments.

Parameters:
[in] searchStr the string to search for
Returns:
The position of searchString in the string, or -1 if it is not found
MStatus split ( wchar_t  theWChar,
MStringArray theArray 
) const

Split the string up at each occurrence of the given wide character and place the separate strings into theArray.

The current string instance is not modified.

NOTE: this method accepts a wide character type and is the preferred format for compatibility in localized environments.

Parameters:
[in] theWChar the character on which to split
[out] theArray the MStringArray to populate
Returns:
MS::kSuccess on success, and MS::kFailure on failure
MString substring ( int  start,
int  end 
) const

Return a new MString instance that contains the characters from start to end inclusive.

Start and end are byte-based positions corresponding to the asChar() form of the string.

NOTE: since this version of substring works on the char form of the string it is not compatible with localized (multibyte) environments as the positions specified may not correctly match character boundaries in the multibyte buffer. Use of MString::substringW is recommended instead.

Parameters:
[in] start the index of the first character to copy
[in] end the index of the last character to copy
Returns:
An MString containing the substring.
Examples:
animImportExport/animFileUtils.cpp, atomImportExport/atomFileUtils.cpp, cgfxEffectDef.cpp, cgfxFindImage.cpp, cgfxShaderNode.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, externalDropCallback/externalDropCallback.cpp, geometryCacheConverter/geometryCacheFile.cpp, hlslShader/hlslShader.cpp, hwApiTextureTest/hwApiTextureTest.cpp, pluginMain.cpp, stringFormatNode/stringFormatNode.cpp, xmlAssembly/FileSystemManager.cpp, xmlAssembly/Utility.cpp, and xmlAssembly/XMLGeneratorCommand.cpp.
MString substringW ( int  start,
int  end 
) const

Return a new MString instance that contains the characters from start to end inclusive.

Start and end are character-based positions and correctly deal with multibyte strings in localized environments.

NOTE: use of MString::substringW over MString::substring is recommended

Parameters:
[in] start the index of the first character to copy
[in] end the index of the last character to copy
Returns:
An MString containing the substring.
Examples:
AbcExport/AbcExport.cpp, AbcImport/AbcImportStrings.cpp, atomImportExport/atomNodeNameReplacer.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, gpuCache/CacheReader.cpp, and gpuCache/CacheReaderAlembic.cpp.
MString & toUpperCase ( )

Modify the current instance of the string replacing all lower case characters in the corresponding upper case characters.

Returns:
A reference to the current, modified MString instance
Examples:
xmlAssembly/Utility.cpp.
MString & toLowerCase ( )

Modify the current instance of the string replacing all lower case characters in the corresponding upper case characters.

Returns:
A reference to the current, modified MString instance
Examples:
AbcExport/AbcExport.cpp, AbcExport/AttributesWriter.cpp, cgfxEffectDef.cpp, cgfxShaderNode.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderCompileHelper.cpp, dx11Shader/dx11ShaderUniformParamBuilder.cpp, hwApiTextureTest/hwApiTextureTest.cpp, xmlAssembly/Utility.cpp, and xmlAssembly/XMLWriter.cpp.
bool isShort ( ) const

Returns true if the string represents a valid short, and false otherwise.

Returns:
True or false
short asShort ( ) const

Returns the value of the string in this MString instance converted to a short.

If the string does contain a valid string representation of a short, then the results of this operation are undefined.

Returns:
The value of the current string converted to a short.
bool isInt ( ) const

Returns true if the string represents a valid int, and false otherwise.

Returns:
True or false
int asInt ( ) const

Returns the value of the string in this MString instance converted to an integer.

If the string does contain a valid string representation of an integer, then the results of this operation are undefined.

Returns:
The value of the current string converted to an integer.
bool isUnsigned ( ) const

Returns true if the string represents a valid unsigned int, and false otherwise.

Returns:
True or false
Examples:
AbcExport/MayaUtility.h, and gpuCache/gpuCacheVramQuery.cpp.
unsigned int asUnsigned ( ) const

Returns the value of the string in this MString instance converted to an unsigned integer.

If the string does contain a valid string representation of an unsigned integer, then the results of this operation are undefined.

Returns:
The value of the current string converted to an integer.
Examples:
gpuCache/gpuCacheVramQuery.cpp.
bool isFloat ( ) const

Returns true if the string represents a valid float, and false otherwise.

Returns:
True or false
Examples:
AbcExport/MayaUtility.h.
float asFloat ( ) const

Returns the value of the string in this MString instance converted to a float.

If the string does contain a valid string representation of a float, then the results of this operation are undefined.

Returns:
The value of the current string converted to a float.
bool isDouble ( ) const

Returns true if the string represents a valid double, and false otherwise.

Returns:
True or false
Examples:
animImportExport/animImportExport.cpp, and atomImportExport/atomImportExport.cpp.
double asDouble ( ) const

Returns the value of the string in this MString instance converted to a double.

If the string does contain a valid string representation of a double, then the results of this operation are undefined.

Returns:
The value of the current string converted to a double.
Examples:
xmlAssembly/XMLGeneratorCommand.cpp.
MString expandEnvironmentVariablesAndTilde ( MStatus ReturnStatus = NULL ) const

Returns a new string constructed by duplicating the current string with all environment variables expanded (and on UNIX, tilde characaters ("~") are also expanded.

Environment variables may be of the form $ENV_VAR or ${ENV_VAR}. On Windows, ENV_VAR, ENV_VAR% and %{ENV_VAR}% are also accepted. If no environment variable in the system matches that given, the unexpanded variable is copied verbatim into the result string. On UNIX, any tilde characters ("~") will also be expanded according to the standard UNIX convention. If the user name associated with a tilde is undefined, the tilde and name which follows it are copied verbatim into the result string. Notes (1) when any error occurs, processing continues such that all subsequent environment variable and tilde occurences are processed and the resulting string can be displayed to the user to help diagnose the undefined entities (2) escape sequences using backslash characters are not supported.

Parameters:
[out] ReturnStatus Status code
Returns:
A new string containing the value of the original string with environment variable (and tilde characters on UNIX) which were defined expanded. All undefined environment variables and tildes are copied into the result string unexpanded.
Status Codes:
Examples:
dx11Shader/dx11ShaderCompileHelper.cpp, gpuCache/gpuCacheConfig.cpp, and xmlAssembly/AssetLibManager.cpp.
MString expandFilePath ( MStatus ReturnStatus = NULL ) const

Returns a new string constructed by duplicating the current string with all environment variables expanded (and on UNIX, tilde characaters ("~") are also expanded.

Environment variables may be of the form $ENV_VAR or ${ENV_VAR}. On Windows, ENV_VAR, ENV_VAR% and %{ENV_VAR}% are also accepted. If no environment variable in the system matches that given, the unexpanded variable is copied verbatim into the result string. On UNIX, any tilde characters ("~") will also be expanded according to the standard UNIX convention. If the user name associated with a tilde is undefined, the tilde and name which follows it are copied verbatim into the result string. Notes (1) when any error occurs, processing continues such that all subsequent environment variable and tilde occurences are processed and the resulting string can be displayed to the user to help diagnose the undefined entities (2) escape sequences using backslash characters are not supported.

This does some file-path specific expansion. So if we have an invalid sequence like $A;;$B or $A::$B (on Mac/Linux), it will be collapsed to $A;$B or $A:$B respectively, then expanded.

We also do file-path specific nested environment variable expansion. So if you have $A/foo, and $A = "A;a", this will result in, A/foo;a/foo instead of A;a/foo. If you want A;a/foo, use MString::expandEnvironmentVariablesAndTilde

Parameters:
[out] ReturnStatus Status code
Returns:
A new string containing the value of the original string with environment variable (and tilde characters on UNIX) which were defined expanded. All undefined environment variables and tildes are copied into the result string unexpanded.
Status Codes:
MStatus format ( const MString fmt,
const MStringArray args 
)

Format the string value using a format specifier and an array of positional arguments.

A maximum of 10 arguments may be specified in the array passed. The number of arguments must match exactly the number of arguments expected by the format statement.

All arguments are passed as MStrings (any numeric data for example must already be formatted by the caller into an MString).

Format specifiers determine the relative position and ordering of arguments in the string using specifiers of the form: ^1s ^2s ^3s etc. See also the mel format command.

Parameters:
[in] fmt format string (up to 10 positional argument specifiers)
[in] args array of arguments to be positioned in the format string
Returns:
MS::kSuccess for success, otherwise MS::kFailure
Examples:
AbcExport/AbcExport.cpp, AbcExport/MayaMeshWriter.cpp, AbcImport/AbcImport.cpp, AbcImport/AlembicImportFileTranslator.cpp, AbcImport/CreateSceneHelper.cpp, animImportExport/animFileUtils.cpp, AshliShader/GLSLShaderNode.cpp, atomImportExport/atomFileUtils.cpp, closestPointOnCurve/closestPointOnCurveCmd.cpp, depthShader/depthShader.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderStrings.cpp, gpuCache/CacheWriterAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheGeometryOverride.cpp, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheUtil.h, hwApiTextureTest/hwApiTextureTest.cpp, hwApiTextureTest/hwApiTextureTestStrings.cpp, MetadataSample/createMetadataCmd.cpp, MetadataSample/exportMetadataCmd.cpp, MetadataSample/importMetadataCmd.cpp, MetadataSample/metadataBase.cpp, nodeInfoCmd/nodeInfoCmd.cpp, sceneAssembly/assemblyReference.cpp, sceneAssembly/sceneAssemblyPluginMain.cpp, xmlAssembly/AssemblyCommand.cpp, xmlAssembly/AssemblyLoaderBase.cpp, xmlAssembly/FileRep.cpp, xmlAssembly/pluginMain.cpp, xmlAssembly/Utility.cpp, xmlAssembly/XMLGeneratorCommand.cpp, xmlAssembly/XMLReader.cpp, and xmlAssembly/XMLWriter.cpp.
MStatus format ( const MString fmt,
const MString arg1 = MString::argUnused,
const MString arg2 = MString::argUnused,
const MString arg3 = MString::argUnused,
const MString arg4 = MString::argUnused,
const MString arg5 = MString::argUnused,
const MString arg6 = MString::argUnused,
const MString arg7 = MString::argUnused,
const MString arg8 = MString::argUnused,
const MString arg9 = MString::argUnused,
const MString arg10 = MString::argUnused 
)

Format the string value using a format specifier and positional arguments.

A maximum of 10 argument strings may be passed in the argument list. This routine accepts a variable number of arguments in the argument list. Unused arguments should not be passed. (i.e. if 3 arguments are required by the format statement, exactly 3 arguments should be passed when calling MString::format).

All arguments are passed as MStrings (any numeric data for example must already be converted by the caller to an MString).

Format specifiers determine the relative position and ordering of arguments in the string using specifiers of the form: ^1s ^2s ^3s etc. See also the mel format command for more information.

Parameters:
[in] fmt format string (up to 10 positional arguments)
[in] arg1 argument to be positioned in the format string
[in] arg2 argument to be positioned in the format string
[in] arg3 argument to be positioned in the format string
[in] arg4 argument to be positioned in the format string
[in] arg5 argument to be positioned in the format string
[in] arg6 argument to be positioned in the format string
[in] arg7 argument to be positioned in the format string
[in] arg8 argument to be positioned in the format string
[in] arg9 argument to be positioned in the format string
[in] arg10 argument to be positioned in the format string
Returns:
MS::kSuccess for success, otherwise MS::kFailure

Friends And Related Function Documentation

OPENMAYA_EXPORT std::ostream& operator<< ( std::ostream &  s,
const MString str 
) [friend]

NO SCRIPT SUPPORT.

Parameters:
[in] s the ostream to print to
[in] str the MString whose value is to be printed
Returns:
The ostream reference, s, provided as the first parameter.
OPENMAYA_EXPORT MString operator+ ( const char *  first,
const MString second 
) [friend]

NO SCRIPT SUPPORT.

The MString on the right is appended to the character string on the left and the result is returned in a new MString. Neither of the operands is modified.

NOTE: in multibyte locales, the character buffer encoding is assumed to be the native multibyte encoding of the current locale.

Parameters:
[in] first Left operand.
[in] second Right operand.

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