_pyCommand Class Reference

Class operating on a command string looking like ResultValue = Object.Method( Arg1, Arg2,...).

#include <SMESH_2smeshpy.hxx>

Inheritance diagram for _pyCommand:

Inheritance graph

Public Member Functions

 _pyCommand ()
 _pyCommand (const TCollection_AsciiString &theString, int theNb)
TCollection_AsciiString & GetString ()
int GetOrderNb () const
void SetOrderNb (int theNb)
int Length ()
void Clear ()
bool IsEmpty () const
const TCollection_AsciiString & GetResultValue ()
 Return substring of python command looking like ResultValue = Obj.Meth().
const TCollection_AsciiString & GetObject ()
 Return substring of python command looking like ResVal = Object.Meth().
const TCollection_AsciiString & GetMethod ()
 Return substring of python command looking like ResVal = Obj.Method().
const TCollection_AsciiString & GetArg (int index)
 Return substring of python command looking like ResVal = Obj.Meth(Arg1,...).
int GetNbArgs ()
void SetResultValue (const TCollection_AsciiString &theResult)
void SetObject (const TCollection_AsciiString &theObject)
void SetMethod (const TCollection_AsciiString &theMethod)
void SetArg (int index, const TCollection_AsciiString &theArg)
 Set agrument.
void RemoveArgs ()
 Empty arg list.
void AddDependantCmd (Handle(_pyCommand) cmd)
bool SetDependentCmdsAfter () const
 Set dependent commands after this one.
bool AddAccessorMethod (_pyID theObjectID, const char *theAcsMethod)

Static Public Member Functions

static bool SkipSpaces (const TCollection_AsciiString &theSring, int &thePos)
 Look for position where not space char is.
static TCollection_AsciiString GetWord (const TCollection_AsciiString &theSring, int &theStartPos, const bool theForward, const bool dotIsWord=false)
 Looks for a word in the string and returns word's beginning.

Private Types

enum  {
  UNKNOWN = -1, EMPTY = 0, RESULT_IND, OBJECT_IND,
  METHOD_IND, ARG1_IND
}

Private Member Functions

int GetBegPos (int thePartIndex)
 Return starting position of a part of python command.
void SetBegPos (int thePartIndex, int thePosition)
 Store starting position of a part of python command.
void SetPart (int thePartIndex, const TCollection_AsciiString &theNewPart, TCollection_AsciiString &theOldPart)
 Modify a part of the command.
void FindAllArgs ()

Private Attributes

int myOrderNb
 position within the script
TCollection_AsciiString myString
 command text
TCollection_AsciiString myRes
TCollection_AsciiString myObj
TCollection_AsciiString myMeth
 found parts of command
TColStd_SequenceOfAsciiString myArgs
 found arguments
TColStd_SequenceOfInteger myBegPos
 where myRes, myObj, ... begin
std::list< Handle(_pyCommand) > myDependentCmds
 commands that sould follow me in the script

Member Enumeration Documentation

anonymous enum [private]
 

Enumerator:
UNKNOWN 
EMPTY 
RESULT_IND 
OBJECT_IND 
METHOD_IND 
ARG1_IND 


Constructor & Destructor Documentation

_pyCommand._pyCommand  ) 
 

_pyCommand._pyCommand const TCollection_AsciiString &  theString,
int  theNb
 


Member Function Documentation

int _pyCommand::GetBegPos int  thePartIndex  )  [private]
 

Parameters:
thePartIndex - The index of command part
Return values:
int - Part position

void _pyCommand::SetBegPos int  thePartIndex,
int  thePosition
[private]
 

Parameters:
thePartIndex - The index of command part
thePosition - Part position

void _pyCommand::SetPart int  thePartIndex,
const TCollection_AsciiString &  thePart,
TCollection_AsciiString &  theOldPart
[private]
 

Parameters:
thePartIndex - The index of the part
thePart - The new part string
theOldPart - The old part

void _pyCommand.FindAllArgs  )  [private]
 

TCollection_AsciiString& _pyCommand.GetString  ) 
 

int _pyCommand.GetOrderNb  )  const
 

void _pyCommand.SetOrderNb int  theNb  ) 
 

int _pyCommand.Length  ) 
 

void _pyCommand.Clear  ) 
 

bool _pyCommand.IsEmpty  )  const
 

const TCollection_AsciiString & _pyCommand::GetResultValue  ) 
 

Return values:
const TCollection_AsciiString & - ResultValue substring

const TCollection_AsciiString & _pyCommand::GetObject  ) 
 

Return values:
const TCollection_AsciiString & - Object substring

const TCollection_AsciiString & _pyCommand::GetMethod  ) 
 

Return values:
const TCollection_AsciiString & - Method substring

const TCollection_AsciiString & _pyCommand::GetArg int  index  ) 
 

Return values:
const TCollection_AsciiString & - Arg<index> substring

int _pyCommand.GetNbArgs  ) 
 

void _pyCommand.SetResultValue const TCollection_AsciiString &  theResult  ) 
 

void _pyCommand.SetObject const TCollection_AsciiString &  theObject  ) 
 

void _pyCommand.SetMethod const TCollection_AsciiString &  theMethod  ) 
 

void _pyCommand::SetArg int  index,
const TCollection_AsciiString &  theArg
 

Parameters:
index - The argument index, it counts from 1
theArg - The argument string

void _pyCommand::RemoveArgs  ) 
 

bool _pyCommand::SkipSpaces const TCollection_AsciiString &  theString,
int thePos
[static]
 

Parameters:
theString - The string
thePos - The position to search from and which returns result
Return values:
bool - false if there are only space after thePos in theString

TCollection_AsciiString _pyCommand::GetWord const TCollection_AsciiString &  theString,
int theStartPos,
const bool  theForward,
const bool  dotIsWord = false
[static]
 

Parameters:
theString - The input string
theStartPos - The position to start the search, returning word's beginning
theForward - The search direction
Return values:
TCollection_AsciiString - The found word

void _pyCommand.AddDependantCmd Handle(_pyCommand cmd  ) 
 

bool _pyCommand::SetDependentCmdsAfter  )  const
 

bool _pyCommand.AddAccessorMethod _pyID  theObjectID,
const char *  theAcsMethod
 


Field Documentation

int _pyCommand.myOrderNb [private]
 

TCollection_AsciiString _pyCommand.myString [private]
 

TCollection_AsciiString _pyCommand.myRes [private]
 

TCollection_AsciiString _pyCommand.myObj [private]
 

TCollection_AsciiString _pyCommand.myMeth [private]
 

TColStd_SequenceOfAsciiString _pyCommand.myArgs [private]
 

TColStd_SequenceOfInteger _pyCommand.myBegPos [private]
 

std::list< Handle(_pyCommand) > _pyCommand.myDependentCmds [private]