Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
ParserView Class Reference

ParserView handles and manipulates parser views. More...

Public Member Functions

void setSecret (string)
 Sets the secret. More...
 
string getSecret ()
 Returns the secret. More...
 
bool addCommand (string, string, bool, CommandSet::EViewCommandAction)
 Adds the specified command to the view. More...
 
bool removeCommand (string, string, CommandSet::EViewCommandAction)
 Removes the specified command from the view. More...
 
int getModeCount ()
 Returns the number of modes. More...
 
string getModeAt (int)
 Returns the mode at the specified index. More...
 
int getIncludeCommandForModeCount (string)
 Returns the number of include commands for the specified mode. More...
 
pair< string, bool > getIncludeCommandForModeAt (string, int)
 Returns the include command in the specified mode at the specified index. More...
 
pair< string, bool > getIncludeCommandForMode (string, string)
 Returns the include command in the specified mode with the specified command. More...
 
void incrementUserCount ()
 Increments the number of users. More...
 
void decrementUserCount ()
 Decrements the number of users. More...
 
int getUserCount ()
 Returns the number of users. More...
 
bool isCommandAdded (string)
 Returns true if the specified command is already added to this view, otherwise false. More...
 

Detailed Description

ParserView handles and manipulates parser views.

Member Function Documentation

◆ addCommand()

bool ParserView::addCommand ( string  ,
string  ,
bool  ,
CommandSet::EViewCommandAction   
)

Adds the specified command to the view.

Parameters
mode,themode to add the command to. Valid modes: user, enable, global.
command,thecommand of interest.
bAll,trueto include all, false to not include all.
action,theview command action. Actions: eViewCommandInclude = 0, eViewCommandExclude = 1, eViewCommandIncludeExclusive = 2
Returns
bool, true if successful, otherwise false.

◆ decrementUserCount()

void ParserView::decrementUserCount ( )

Decrements the number of users.

◆ getIncludeCommandForMode()

pair< string, bool > ParserView::getIncludeCommandForMode ( string  ,
string   
)

Returns the include command in the specified mode with the specified command.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
command,thecommand of interest.
Returns
pair<string, bool>, the include command and a boolean value that is true if included in all, otherwise false.

◆ getIncludeCommandForModeAt()

pair< string, bool > ParserView::getIncludeCommandForModeAt ( string  ,
int   
)

Returns the include command in the specified mode at the specified index.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
index,theindex of the include command of interest.
Returns
pair<string, bool>, the include command and a boolean value that is true if included in all, otherwise false.

◆ getIncludeCommandForModeCount()

int ParserView::getIncludeCommandForModeCount ( string  )

Returns the number of include commands for the specified mode.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
Returns
int, the number of include commands for the specified mode.

◆ getModeAt()

string ParserView::getModeAt ( int  )

Returns the mode at the specified index.

Parameters
index,theindex of the mode of interest.
Returns
string, mode at the specified index.

◆ getModeCount()

int ParserView::getModeCount ( )

Returns the number of modes.

Returns
int, the number of modes.

◆ getSecret()

string ParserView::getSecret ( )

Returns the secret.

Returns
string, the secret.

◆ getUserCount()

int ParserView::getUserCount ( )

Returns the number of users.

Returns
int, the number of users.

◆ incrementUserCount()

void ParserView::incrementUserCount ( )

Increments the number of users.

◆ isCommandAdded()

bool ParserView::isCommandAdded ( string  )

Returns true if the specified command is already added to this view, otherwise false.

Parameters
commandStr,thecommand string to use.
Returns
bool, true if the specified command is already added to this view, otherwise false.

◆ removeCommand()

bool ParserView::removeCommand ( string  ,
string  ,
CommandSet::EViewCommandAction   
)

Removes the specified command from the view.

Parameters
mode,themode to remove the command from. Valid modes: user, enable, global.
command,thecommand of interest.
action,theview command action. Actions: eViewCommandInclude = 0, eViewCommandExclude = 1, eViewCommandIncludeExclusive = 2
Returns
bool, true if successful, otherwise false.

◆ setSecret()

void ParserView::setSecret ( string  )

Sets the secret.

Parameters
secretStr,thesecret.

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