class MStreamUtils

Jump to documentation

Stream functionality. (OpenMaya) (OpenMaya.py)

public members:

static std::ostream& stdErrorStream ()
static std::ostream& stdOutStream ()
static MStatus writeChar ( std::ostream& out, const char value, bool binary = false )
static MStatus writeCharBuffer ( std::ostream& out, const char* value, bool binary = false )
static MStatus writeInt ( std::ostream& out, const int value, bool binary = false )
static MStatus writeFloat ( std::ostream& out, const float value, bool binary = false )
static MStatus writeDouble ( std::ostream& out, const double value, bool binary = false )
static MStatus readChar ( std::istream& in, char& value, bool binary = false )
static MStatus readCharBuffer ( std::istream& in, char*& value, unsigned int length, bool binary = false )
static MStatus readInt ( std::istream& in, int& value, bool binary = false )
static MStatus readFloat ( std::istream& in, float& value, bool binary = false )
static MStatus readDouble ( std::istream& in, double& value, bool binary = false )

Documentation

Methods for getting streams and writing to them.
Description

This class provides some standard stream functionality for developers working in C++ or script. Write methods are provided for writing to ASCII or binary. Read methods are only binary.

Functions

std::ostream& MStreamUtils:: stdErrorStream ()
Description

This method returns the cerr ostream.

std::ostream& MStreamUtils:: stdOutStream ()
Description

This method returns the cout ostream.

MStatus MStreamUtils:: writeChar ( std::ostream& out, const char value, bool binary )
Description

This method is used to write out a "char" value to an ostream.

Arguments

  • out the output ostream
  • value value to write out
  • binary If true, the byte(s) of value are written out. If false, the string representation is written out.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess write worked
  • MS::kFailure stream failed to write value

MStatus MStreamUtils:: writeCharBuffer ( std::ostream& out, const char* value, bool binary )
Description

This method is used to write out a "const char*" value to an ostream.

Arguments

  • out the output ostream
  • value value to write out
  • binary If true, the byte(s) of the value string are written out. If false, the string representation is written out.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess write worked
  • MS::kFailure value is NULL or stream failed to write value

MStatus MStreamUtils:: writeInt ( std::ostream& out, const int value, bool binary )
Description

This method is used to write out a "int" value to an ostream.

Arguments

  • out the output ostream
  • value value to write out
  • binary If true, the byte(s) of value are written out. If false, the string representation is written out.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess write worked
  • MS::kFailure stream failed to write value

MStatus MStreamUtils:: writeFloat ( std::ostream& out, const float value, bool binary )
Description

This method is used to write out a "float" value to an ostream.

Arguments

  • out the output ostream
  • value value to write out
  • binary If true, the byte(s) of value are written out. If false, the string representation is written out.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess write worked
  • MS::kFailure stream failed to write value

MStatus MStreamUtils:: writeDouble ( std::ostream& out, const double value, bool binary )
Description

This method is used to write out a "double" value to an ostream.

Arguments

  • out the output ostream
  • value value to write out
  • binary If true, the byte(s) of value are written out. If false, the string representation is written out.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess write worked
  • MS::kFailure stream failed to write value

MStatus MStreamUtils:: readChar ( std::istream& in, char& value, bool binary )
Description

This method is used to read a "char" binary value from an istream.

Arguments

  • out the input istream
  • value where the input is stored

Return Value

  • Status Code

Status Codes

  • MS::kSuccess read worked
  • MS::kFailure stream failed to read value

MStatus MStreamUtils:: readCharBuffer ( std::istream& in, char*& value, unsigned int length, bool binary )
Description

This method is used to read a "char*" binary value from an istream.

Arguments

  • out the input istream
  • value where the input is stored

Return Value

  • Status Code

Status Codes

  • MS::kSuccess read worked
  • MS::kFailure value is NULL or stream failed to read value

MStatus MStreamUtils:: readInt ( std::istream& in, int& value, bool binary )
Description

This method is used to read a "int" binary value from an istream.

Arguments

  • out the input istream
  • value where the input is stored

Return Value

  • Status Code

Status Codes

  • MS::kSuccess read worked
  • MS::kFailure stream failed to read value

MStatus MStreamUtils:: readFloat ( std::istream& in, float& value, bool binary )
Description

This method is used to read a "float" binary value from an istream.

Arguments

  • out the input istream
  • value where the input is stored

Return Value

  • Status Code

Status Codes

  • MS::kSuccess read worked
  • MS::kFailure stream failed to read value

MStatus MStreamUtils:: readDouble ( std::istream& in, double& value, bool binary )
Description

This method is used to read a "double" binary value from an istream.

Arguments

  • out the input istream
  • value where the input is stored

Return Value

  • Status Code

Status Codes

  • MS::kSuccess read worked
  • MS::kFailure stream failed to read value

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright