diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
commit | 582fc32574a3b158c81e49cb00e6ae59205e66ba (patch) | |
tree | ac64a3243e0d2121709f685695247052858115c8 /util/stringutils.h | |
parent | 2761bffa96595ac1698d86bbc2e95ebb0d4d6e93 (diff) | |
download | mongodb-582fc32574a3b158c81e49cb00e6ae59205e66ba.tar.gz |
Imported Upstream version 1.8.0
Diffstat (limited to 'util/stringutils.h')
-rw-r--r-- | util/stringutils.h | 12 |
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 |