diff options
author | Adam <Adam@anope.org> | 2012-11-28 22:52:52 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-28 22:54:26 -0500 |
commit | 26a048e5c41b33cca78acaa0aa0b00396612bee4 (patch) | |
tree | 960b0feb249ca46a0145790031e4b5eee2d2ae11 /include | |
parent | ccd41e7efe776d57e755dd69f927ae3ba3d8c85a (diff) |
Rewrite/simplify some of m_httpd
Diffstat (limited to 'include')
-rw-r--r-- | include/anope.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/anope.h b/include/anope.h index 2dda6cf76..0ba950d9b 100644 --- a/include/anope.h +++ b/include/anope.h @@ -48,9 +48,10 @@ namespace Anope string(char chr) : _string() { _string = chr; } string(size_type n, char chr) : _string(n, chr) { } string(const char *_str) : _string(_str) { } + string(const char *_str, size_type n) : _string(_str, n) { } string(const std::string &_str) : _string(_str) { } string(const ci::string &_str) : _string(_str.c_str()) { } - string(const string &_str, size_type pos = 0, size_type n = npos) : _string(_str._string, pos, n) { } + string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { } template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { } /** @@ -152,12 +153,13 @@ namespace Anope /** * Trim leading and trailing white spaces from the string. */ - inline void trim() + inline string& 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); + return *this; } /** |