diff options
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; |
