Main Page
Namespaces
Classes
Files
File List
File Members
libswarmio
include
swarmio
tool
Command.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <map>
5
#include <replxx.hxx>
6
7
namespace
swarmio::tool
8
{
15
class
Command
final
16
{
17
private
:
18
23
std::string
_verb
;
24
29
std::string
_path
;
30
35
std::map<std::string, std::string>
_parameters
;
36
42
Command
(
const
std::string& verb)
43
{
44
_verb = verb;
45
}
46
47
public
:
48
55
static
Command
Parse
(std::string
command
);
56
64
static
void
HighlighterCallback
(
const
std::string&
input
, replxx::Replxx::colors_t& colors,
void
* unused);
65
72
bool
Is
(
const
char
* pattern)
const
;
73
79
bool
HasPath
()
const
80
{
81
return
!_path.empty();
82
}
83
89
bool
HasParameters
()
const
90
{
91
return
!_parameters.empty();
92
}
93
99
const
std::string&
GetVerb
()
const
100
{
101
return
_verb
;
102
}
103
109
const
std::string&
GetPath
()
const
110
{
111
return
_path
;
112
}
113
119
const
std::map<std::string, std::string>&
GetParameters
()
const
120
{
121
return
_parameters
;
122
}
123
};
124
125
}
swarmio::tool
Definition:
Command.h:7
swarmio::tool::Command::HighlighterCallback
static void HighlighterCallback(const std::string &input, replxx::Replxx::colors_t &colors, void *unused)
Highlighter callback for commands.
Definition:
Command.cpp:8
swarmio::tool::Command::HasPath
bool HasPath() const
Does the command have a path specified?
Definition:
Command.h:79
swarmio::tool::Command::_verb
std::string _verb
Verb.
Definition:
Command.h:23
swarmio::tool::Command::Parse
static Command Parse(std::string command)
Parse a string as a command.
Definition:
Command.cpp:108
swarmio::tool::Command::Command
Command(const std::string &verb)
Construct a new Command object.
Definition:
Command.h:42
command
ROSLIB_DECL std::string command(const std::string &cmd)
logparser.input
input
Definition:
logparser.py:71
swarmio::tool::Command::GetParameters
const std::map< std::string, std::string > & GetParameters() const
Get the map of parameters.
Definition:
Command.h:119
swarmio::tool::Command::GetPath
const std::string & GetPath() const
Get the path.
Definition:
Command.h:109
swarmio::tool::Command
Parser for commands of the default form.
Definition:
Command.h:15
swarmio::tool::Command::GetVerb
const std::string & GetVerb() const
Get the verb.
Definition:
Command.h:99
swarmio::tool::Command::_path
std::string _path
Path.
Definition:
Command.h:29
swarmio::tool::Command::HasParameters
bool HasParameters() const
Does the command have parameters?
Definition:
Command.h:89
swarmio::tool::Command::Is
bool Is(const char *pattern) const
Do a case insensitive regex match on the verb.
Definition:
Command.cpp:229
swarmio::tool::Command::_parameters
std::map< std::string, std::string > _parameters
Parameters.
Definition:
Command.h:35
swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:47