diff options
| author | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
|---|---|---|
| committer | Antonin Kral <a.kral@bobek.cz> | 2011-09-14 17:08:06 +0200 |
| commit | 5d342a758c6095b4d30aba0750b54f13b8916f51 (patch) | |
| tree | 762e9aa84781f5e3b96db2c02d356c29cf0217c0 /util/mongoutils/str.h | |
| parent | cbe2d992e9cd1ea66af9fa91df006106775d3073 (diff) | |
| download | mongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz | |
Imported Upstream version 2.0.0
Diffstat (limited to 'util/mongoutils/str.h')
| -rw-r--r-- | util/mongoutils/str.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/mongoutils/str.h b/util/mongoutils/str.h index ea8f938..57b94fa 100644 --- a/util/mongoutils/str.h +++ b/util/mongoutils/str.h @@ -29,6 +29,8 @@ #include <string> #include <sstream> + +// this violates the README rules for mongoutils: #include "../../bson/util/builder.h" namespace mongoutils { @@ -48,13 +50,11 @@ namespace mongoutils { class stream { public: mongo::StringBuilder ss; - template<class T> stream& operator<<(const T& v) { ss << v; return *this; } - operator std::string () const { return ss.str(); } }; @@ -106,13 +106,13 @@ namespace mongoutils { return strchr(s.c_str(), x) != 0; } - /** @return everything befor the character x, else entire string */ + /** @return everything before the character x, else entire string */ inline string before(const string& s, char x) { const char *p = strchr(s.c_str(), x); return (p != 0) ? s.substr(0, p-s.c_str()) : s; } - /** @return everything befor the string x, else entire string */ + /** @return everything before the string x, else entire string */ inline string before(const string& s, const string& x) { const char *p = strstr(s.c_str(), x.c_str()); return (p != 0) ? s.substr(0, p-s.c_str()) : s; |
