summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/anope.h11
-rw-r--r--include/commands.h5
-rw-r--r--include/sockets.h4
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;