#endif // DEBUG
}
-Command::Command(const string& target, const string& command):
- target(target), command(command) {
+Command::Command(const string& _target, const string& _command) {
#ifdef DEBUG
cerr << __FILE__ << ": target = " << target << " | "
<< "command = " << command << endl;
#endif // DEBUG
+ set_target(_target);
+ set_command(_command);
}
void Command::build(void) {
build();
}
-const std::string& Command::get_target(void) {
+const std::string& Command::get_target(void) const {
return target;
}
build();
}
-const std::string& Command::get_command(void) {
+const std::string& Command::get_command(void) const {
return command;
}
build();
}
-const Command::Arguments& Command::get_args(void) {
+const Command::Arguments& Command::get_args(void) const {
return args;
}
} else {
command.target = "";
}
- if (command.args.size() > 1) {
+ if (command.args.size() > 0) {
command.command = command.args[0];
command.args.erase(command.args.begin());
} else {