diff options
| author | Adam <Adam@anope.org> | 2011-04-29 21:12:49 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-05-16 04:10:15 -0400 |
| commit | b999c6ca53d6b1dfd54688d21718293858f6bcc7 (patch) | |
| tree | 1090a9d538010eb4026daac7d4b1dbd131635044 /include | |
| parent | 583954d3a1db658281a9afb7b7dd6773726c8c11 (diff) | |
Expand more on m_alias and changed some std::string usage in sockets.cpp to use Anope::string
Diffstat (limited to 'include')
| -rw-r--r-- | include/anope.h | 11 | ||||
| -rw-r--r-- | include/commands.h | 5 | ||||
| -rw-r--r-- | include/sockets.h | 4 |
3 files changed, 18 insertions, 2 deletions
diff --git a/include/anope.h b/include/anope.h index b23b68481..0e25bbb93 100644 --- a/include/anope.h +++ b/include/anope.h @@ -174,6 +174,17 @@ namespace Anope inline void erase(size_type pos = 0, size_type n = std::string::npos) { this->_string.erase(pos, n); } /** + * Trim leading and trailing white spaces from the string. + */ + inline void trim() + { + while (!this->_string.empty() && isspace(this->_string[0])) + this->_string.erase(this->_string.begin()); + while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1])) + this->_string.erase(this->_string.length() - 1); + } + + /** * Clears the string. */ inline void clear() { this->_string.clear(); } diff --git a/include/commands.h b/include/commands.h index 89735211c..e966e9e39 100644 --- a/include/commands.h +++ b/include/commands.h @@ -110,6 +110,11 @@ class CoreExport Command : public Flags<CommandFlag>, public Base void SetDesc(const Anope::string &d); public: + /** Get the command description + * @return The commands description + */ + const Anope::string &GetDesc() const; + /** Execute this command. * @param source The source * @param params Command parameters diff --git a/include/sockets.h b/include/sockets.h index 68be2c9b7..bc0c831bf 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -234,9 +234,9 @@ class CoreExport BufferedSocket : public Socket { protected: /* Things to be written to the socket */ - std::string WriteBuffer; + Anope::string WriteBuffer; /* Part of a message sent from the server, but not totally received */ - std::string extrabuf; + Anope::string extrabuf; /* How much data was received from this socket */ size_t RecvLen; |
