summaryrefslogtreecommitdiff
path: root/util/stringutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/stringutils.h')
-rw-r--r--util/stringutils.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/util/stringutils.h b/util/stringutils.h
index 6b79c33..60571e6 100644
--- a/util/stringutils.h
+++ b/util/stringutils.h
@@ -20,24 +20,26 @@
namespace mongo {
+ // see also mongoutils/str.h - perhaps move these there?
+
void splitStringDelim( const string& str , vector<string>* res , char delim );
void joinStringDelim( const vector<string>& strs , string* res , char delim );
- inline string tolowerString( const string& input ){
+ inline string tolowerString( const string& input ) {
string::size_type sz = input.size();
-
+
boost::scoped_array<char> line(new char[sz+1]);
char * copy = line.get();
-
- for ( string::size_type i=0; i<sz; i++ ){
+
+ for ( string::size_type i=0; i<sz; i++ ) {
char c = input[i];
copy[i] = (char)tolower( (int)c );
}
copy[sz] = 0;
return string(copy);
}
-
+
} // namespace mongo
#endif // UTIL_STRING_UTILS_HEADER