cppassist  1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
Public Member Functions | Protected Attributes | List of all members
cppassist::CommandLineCommand Class Reference

Command line command. More...

#include <cppassist/include/cppassist/cmdline/CommandLineCommand.h>

Public Member Functions

 CommandLineCommand (const std::string &name)
 Constructor. More...
 
 ~CommandLineCommand ()
 Destructor. More...
 
const std::string & name () const
 Get command name. More...
 
void setName (const std::string &name)
 Set command name. More...
 
bool activated () const
 Check if command has been activated. More...
 
void setActivated (bool activated)
 Set if command has been activated. More...
 

Protected Attributes

std::string m_name
 Command name (e.g., "list") More...
 
bool m_activated
 true if activated, else false More...
 

Detailed Description

Command line command.

A command decribes a certain function that can be invoked by specifying the command name on the command line.

Example: myapp list

CommandLineCommand commandList("list");

Constructor & Destructor Documentation

◆ CommandLineCommand()

cppassist::CommandLineCommand::CommandLineCommand ( const std::string &  name)

Constructor.

Parameters
[in]nameCommand name (e.g., "list")

◆ ~CommandLineCommand()

cppassist::CommandLineCommand::~CommandLineCommand ( )

Destructor.

Member Function Documentation

◆ name()

const std::string& cppassist::CommandLineCommand::name ( ) const

Get command name.

Returns
Command name (e.g., "list")

◆ setName()

void cppassist::CommandLineCommand::setName ( const std::string &  name)

Set command name.

Parameters
[in]nameCommand name (e.g., "list")

◆ activated()

bool cppassist::CommandLineCommand::activated ( ) const

Check if command has been activated.

Returns
true if activated, else false

◆ setActivated()

void cppassist::CommandLineCommand::setActivated ( bool  activated)

Set if command has been activated.

Parameters
[in]activatedtrue if activated, else false

Member Data Documentation

◆ m_name

std::string cppassist::CommandLineCommand::m_name
protected

Command name (e.g., "list")

◆ m_activated

bool cppassist::CommandLineCommand::m_activated
protected

true if activated, else false


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