Open CASCADE Technology  7.1.0.beta
Data Structures | Public Member Functions

ViewerTest_CmdParser Class Reference

Command parser. More...

#include <ViewerTest_CmdParser.hxx>

Public Member Functions

 ViewerTest_CmdParser ()
 Initializes default option. More...
 
void AddDescription (const std::string &theDescription)
 Sets description for command. More...
 
void AddOption (const std::string &theOptionNames, const std::string &theOptionDescription="")
 Adds option to available option list. Several names may be provided if separated with '|'. More...
 
void Help ()
 Prints help message based on provided command and options descriptions. More...
 
void Parse (Standard_Integer theArgsNb, const char **theArgVec)
 Parses argument list; assignes local arguments to each option. More...
 
Standard_Boolean HasOption (const std::string &theOptionName, Standard_Integer theMandatoryArgsNb=0, Standard_Boolean isFatal=Standard_False)
 Checks if option was set with given minimal argument number. Prints error message if isFatal flag was set. More...
 
std::string Arg (const std::string &theOptionName, Standard_Integer theArgumentIndex)
 Accesses local argument of option 'theOptionName' with index 'theArgumentIndex'. More...
 
Graphic3d_Vec3 ArgVec3f (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
Graphic3d_Vec3d ArgVec3d (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
gp_Vec ArgVec (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
gp_Pnt ArgPnt (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
Standard_Real ArgDouble (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
Standard_ShortReal ArgFloat (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
Standard_Integer ArgInt (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 
Standard_Boolean ArgBool (const std::string &theOptionName, const Standard_Integer theArgumentIndex=0)
 

Detailed Description

Command parser.

Constructor & Destructor Documentation

ViewerTest_CmdParser::ViewerTest_CmdParser ( )

Initializes default option.

Member Function Documentation

void ViewerTest_CmdParser::AddDescription ( const std::string &  theDescription)
inline

Sets description for command.

void ViewerTest_CmdParser::AddOption ( const std::string &  theOptionNames,
const std::string &  theOptionDescription = "" 
)

Adds option to available option list. Several names may be provided if separated with '|'.

std::string ViewerTest_CmdParser::Arg ( const std::string &  theOptionName,
Standard_Integer  theArgumentIndex 
)

Accesses local argument of option 'theOptionName' with index 'theArgumentIndex'.

Standard_Boolean ViewerTest_CmdParser::ArgBool ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Standard_Real ViewerTest_CmdParser::ArgDouble ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Standard_ShortReal ViewerTest_CmdParser::ArgFloat ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Standard_Integer ViewerTest_CmdParser::ArgInt ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
gp_Pnt ViewerTest_CmdParser::ArgPnt ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
gp_Vec ViewerTest_CmdParser::ArgVec ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Graphic3d_Vec3d ViewerTest_CmdParser::ArgVec3d ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Graphic3d_Vec3 ViewerTest_CmdParser::ArgVec3f ( const std::string &  theOptionName,
const Standard_Integer  theArgumentIndex = 0 
)
Standard_Boolean ViewerTest_CmdParser::HasOption ( const std::string &  theOptionName,
Standard_Integer  theMandatoryArgsNb = 0,
Standard_Boolean  isFatal = Standard_False 
)

Checks if option was set with given minimal argument number. Prints error message if isFatal flag was set.

void ViewerTest_CmdParser::Help ( )

Prints help message based on provided command and options descriptions.

void ViewerTest_CmdParser::Parse ( Standard_Integer  theArgsNb,
const char **  theArgVec 
)

Parses argument list; assignes local arguments to each option.


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