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

#include <ScriptReturnData.h>

Public Types

typedef object_type data_type
 

Public Member Functions

 ScriptReturnData (const ScriptID requestID)
 
 ScriptReturnData (const ScriptID requestID, ScriptData returnValue)
 
 ScriptReturnData (const ScriptID requestID, const ErrorCode errorCode)
 
 ~ScriptReturnData ()
 
ScriptID GetRequestID () const
 
ScriptData GetReturnValue () const
 
ErrorCode GetErrorCode () const
 
PMString GetErrorString () const
 
void SetErrorString (PMString errorString)
 
 ScriptReturnData (const ScriptReturnData &other)
 
 ScriptReturnData (adobe::move_from< ScriptReturnData > other)
 
ScriptReturnDataoperator= (ScriptReturnData other)
 

Protected Member Functions

void CheckGlobalErrorCode ()
 

Friends

void swap (ScriptReturnData &left, ScriptReturnData &right)
 

Detailed Description

Encapsulates the return data from a scripting request.

See Also
IScriptRequestData

Constructor & Destructor Documentation

ScriptReturnData::ScriptReturnData (const ScriptID requestID)
explicit

Use this constructor to represent a successful kMethodRequest (with no return value), kPutPropertyRequest, or kFindCollectionRequest is the ID of the request

ScriptReturnData::ScriptReturnData (const ScriptID requestID,
ScriptData returnValue 
)

Use this constructor to represent a successful kMethodRequest (with a return value), kGetPropertyRequest, or kGetObjectRequest is the ID of the request is the return value

ScriptReturnData::ScriptReturnData (const ScriptID requestID,
const ErrorCode errorCode 
)

Use this constructor to represent an unsuccessful request by returning the error code is the ID of the request

Parameters
errorCodeis the error code
ScriptReturnData::~ScriptReturnData ()
inline

Destructor

ScriptReturnData::ScriptReturnData (const ScriptReturnDataother)
inline

Copy constructor

ScriptReturnData::ScriptReturnData (adobe::move_from< ScriptReturnDataother)
inline

Movable constructor - assumes ownership of the remote part

Member Function Documentation

void ScriptReturnData::CheckGlobalErrorCode ()
protected

If the global error code is not kSuccess, update the local error code to match and then clear the global error code. This method is called by all constructors.

ErrorCode ScriptReturnData::GetErrorCode () const
inline
Returns
the error code
PMString ScriptReturnData::GetErrorString () const

Retrieve the error string. Looks it up using error string services if none has been set explicitly.

Returns
the error string
ScriptID ScriptReturnData::GetRequestID () const
inline
Returns
the request ID
ScriptData ScriptReturnData::GetReturnValue () const
inline
Returns
the return value
ScriptReturnData& ScriptReturnData::operator= (ScriptReturnData other)
inline

operator assignment on a movable type takes parameter by value and consumes it

void ScriptReturnData::SetErrorString (PMString errorString)
inline

Set an explicit error string

Parameters
errorStringis the error string

Friends And Related Function Documentation

void swap (ScriptReturnDataleft,
ScriptReturnDataright 
)
friend

Defining swap() ensures efficient swapping of ScriptReturnData objects by swapping the remote parts.