}
void Command::build(void) {
- uri = string("/") + target + '/' + command + String::join(args, "/");
+ uri = string("/") + target;
+ if (command.length()) {
+ uri += '/' + command;
+ if (args.size()) {
+ uri += '/' + String::join(args, "/");
+ }
+ }
#ifdef DEBUG
cerr << __FILE__ << ": build() = " << uri << endl;
#endif // DEBUG
build();
}
+void Command::add_arg(const unsigned& arg) {
+#ifdef DEBUG
+ cerr << __FILE__ << ": add_arg(arg = " << arg << ") = "
+ << String().from(arg) << endl;
+#endif // DEBUG
+ args.push_back(String().from(arg));
+ build();
+}
+
istream& operator>>(istream& is, Command& command) {
#ifdef DEBUG
cerr << __FILE__ << ": operator>>()" << endl;