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

#include <CmdUtils.h>

Public Member Functions

 SequenceContext (const PMString *name=nil)
 
 ~SequenceContext ()
 
bool16 Success ()
 
ErrorCode State ()
 

Detailed Description

Stack based helper class that encapsulates a command sequence (ICommandSequence); if a sequence already exists this class does nothing (the commands you process join the existing sequence), otherwise a new sequence is created and ended by this class. The changes made by commands processed within the sequence are commited if the global error code is kSuccess when this helper class goes out of scope, otherwise the database is rolled back to its state before the sequence started (see CmdUtils::EndCommandSequence(ICommandSequence *)).

The difference between this class and CmdUtils::SequencePtr is that this class does not create a new sequence if one already exists.

See Also
ICommandSequence
CmdUtils::SequencePtr

Constructor & Destructor Documentation

CmdUtils::SequenceContext::SequenceContext (const PMStringname = nil)

Creates a sequence (ICommandSequence) if there isn't already one.

Parameters
namefor the sequence or nil if the name of the sequence should not be set.
CmdUtils::SequenceContext::~SequenceContext ()

Ends the sequence.

Member Function Documentation

ErrorCode CmdUtils::SequenceContext::State ()

Get the error state

Returns
the global error code
See Also
ErrorUtils::PMGetGlobalErrorCode
bool16 CmdUtils::SequenceContext::Success ()
inline

Returns kTrue if the error state is kSuccess