ArkScript
A small, lisp-inspired, functional scripting language
Ark::internal::Debugger::Command Struct Reference
Collaboration diagram for Ark::internal::Debugger::Command:
[legend]

Public Types

using Action_t = std::function<bool(const std::string&, const CommandArgs&)>
 
using Args_t = std::vector<std::pair<std::string, std::string>>
 

Public Member Functions

 Command (std::string name, std::string desc, Action_t &&do_this)
 
 Command (const std::initializer_list< std::string > list_of_names, std::string desc, Action_t &&do_this)
 
 Command (StartsWith start, std::vector< std::pair< std::string, std::string > > arguments, std::string desc, Action_t &&do_this)
 
std::optional< Args_tgetArgs (const std::string &line, std::ostream &os) const
 
std::optional< std::size_t > argAsCount (const std::string &line, std::size_t idx, std::ostream &os) const
 

Public Attributes

bool is_exact
 
std::vector< std::string > names
 
Args_t args
 
std::string description
 
Action_t action
 

Detailed Description

Definition at line 134 of file Debugger.hpp.

Member Typedef Documentation

◆ Action_t

using Ark::internal::Debugger::Command::Action_t = std::function<bool(const std::string&, const CommandArgs&)>

Definition at line 136 of file Debugger.hpp.

◆ Args_t

using Ark::internal::Debugger::Command::Args_t = std::vector<std::pair<std::string, std::string>>

Definition at line 137 of file Debugger.hpp.

Constructor & Destructor Documentation

◆ Command() [1/3]

Ark::internal::Debugger::Command::Command ( std::string name,
std::string desc,
Action_t && do_this )
inline

Definition at line 145 of file Debugger.hpp.

◆ Command() [2/3]

Ark::internal::Debugger::Command::Command ( const std::initializer_list< std::string > list_of_names,
std::string desc,
Action_t && do_this )
inline

Definition at line 149 of file Debugger.hpp.

◆ Command() [3/3]

Ark::internal::Debugger::Command::Command ( StartsWith start,
std::vector< std::pair< std::string, std::string > > arguments,
std::string desc,
Action_t && do_this )
inline

Definition at line 153 of file Debugger.hpp.

References Ark::internal::Debugger::StartsWith::prefix.

Member Function Documentation

◆ argAsCount()

std::optional< std::size_t > Ark::internal::Debugger::Command::argAsCount ( const std::string & line,
std::size_t idx,
std::ostream & os ) const
nodiscard

Definition at line 167 of file Debugger.cpp.

Referenced by Ark::internal::Debugger::initCommands().

◆ getArgs()

std::optional< Debugger::Command::Args_t > Ark::internal::Debugger::Command::getArgs ( const std::string & line,
std::ostream & os ) const
nodiscard

Definition at line 146 of file Debugger.cpp.

References args, and Ark::Utils::splitString().

Member Data Documentation

◆ action

Action_t Ark::internal::Debugger::Command::action

Definition at line 143 of file Debugger.hpp.

Referenced by Ark::internal::Debugger::prompt().

◆ args

Args_t Ark::internal::Debugger::Command::args

Definition at line 141 of file Debugger.hpp.

Referenced by getArgs().

◆ description

std::string Ark::internal::Debugger::Command::description

Definition at line 142 of file Debugger.hpp.

◆ is_exact

bool Ark::internal::Debugger::Command::is_exact

Definition at line 139 of file Debugger.hpp.

◆ names

std::vector<std::string> Ark::internal::Debugger::Command::names

Definition at line 140 of file Debugger.hpp.


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