class CmdBuilder
{
+ protected:
std::string content;
public:
push(cmd);
}
- CmdBuilder& push_raw(const std::string& str)
+ CmdBuilder& push_raw(const std::string& s)
{
- content.append(str);
+ content.append(s);
return *this;
}
- CmdBuilder& push_raw(const char* str)
+ CmdBuilder& push_raw(const char* s)
{
- content.append(str);
+ content.append(s);
return *this;
}
return *this;
}
- CmdBuilder& push(const std::string& str)
+ template <typename T>
+ CmdBuilder& push_raw_int(T i)
+ {
+ content.append(ConvToStr(i));
+ return *this;
+ }
+
+ template <typename InputIterator>
+ CmdBuilder& push_raw(InputIterator first, InputIterator last)
+ {
+ content.append(first, last);
+ return *this;
+ }
+
+ CmdBuilder& push(const std::string& s)
{
content.push_back(' ');
- content.append(str);
+ content.append(s);
return *this;
}
- CmdBuilder& push(const char* str)
+ CmdBuilder& push(const char* s)
{
content.push_back(' ');
- content.append(str);
+ content.append(s);
return *this;
}
return *this;
}
- CmdBuilder& push_last(const std::string& str)
+ CmdBuilder& push_last(const std::string& s)
{
content.push_back(' ');
content.push_back(':');
- content.append(str);
+ content.append(s);
return *this;
}
return *this;
}
- void push_back(const std::string& str) { push(str); }
+ void push_back(const std::string& s) { push(s); }
const std::string& str() const { return content; }
operator const std::string&() const { return str(); }
Utils->DoOneToAllButSender(*this, omit);
}
- bool Unicast(const std::string& target) const
- {
- return Utils->DoOneToOne(*this, target);
- }
-
- bool Unicast(User* target) const
+ void Unicast(User* target) const
{
- return Unicast(target->server);
+ Utils->DoOneToOne(*this, target->server);
}
};