StuBS
Command Struct Reference

#include <fs/tool/command.h>

Public Types

typedef std::function< bool(const std::vector< std::string > &)> callback
 

Public Member Functions

 Command (const std::vector< std::string > &&name, const std::vector< Parameter > &&args, const std::string &&description, const callback action)
 
 Command (const std::vector< std::string > &&name, const std::string &&description, const callback action)
 

Static Public Member Functions

static bool execute (std::string action, const std::vector< std::string > &param)
 
static bool execute (const std::vector< std::string > &parts)
 
static bool execute (const std::string &line)
 
static void complete (const char *input, std::vector< std::string > &completions)
 
static void help ()
 

Public Attributes

const std::vector< std::string > name
 
const std::vector< Parameterargs
 
const std::string description
 
const callback action
 

Member Typedef Documentation

◆ callback

typedef std::function<bool (const std::vector<std::string> &)> Command::callback

Constructor & Destructor Documentation

◆ Command() [1/2]

Command::Command ( const std::vector< std::string > &&  name,
const std::vector< Parameter > &&  args,
const std::string &&  description,
const callback  action 
)
inline

◆ Command() [2/2]

Command::Command ( const std::vector< std::string > &&  name,
const std::string &&  description,
const callback  action 
)
inline

Member Function Documentation

◆ execute() [1/3]

bool Command::execute ( std::string  action,
const std::vector< std::string > &  param 
)
static

◆ execute() [2/3]

bool Command::execute ( const std::vector< std::string > &  parts)
static

◆ execute() [3/3]

bool Command::execute ( const std::string &  line)
static

◆ complete()

void Command::complete ( const char *  input,
std::vector< std::string > &  completions 
)
static

◆ help()

void Command::help ( )
static

Member Data Documentation

◆ name

const std::vector<std::string> Command::name

◆ args

const std::vector<Parameter> Command::args

◆ description

const std::string Command::description

◆ action

const callback Command::action

The documentation for this struct was generated from the following files: