summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/StringUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2008-11-05 12:21:24 -0330
committerDwayne Boone <dwayne@zeroc.com>2008-11-05 12:21:24 -0330
commite67bc9d134e2727e1da51729665c672904daf6c0 (patch)
tree784284319746e5e4a807c469c50ed5c8b671193d /cpp/src/IceUtil/StringUtil.cpp
parentMerge branch 'R3_3_branch' (diff)
parentBug 3386 - slice errors with wrong line numbers (diff)
downloadice-e67bc9d134e2727e1da51729665c672904daf6c0.tar.bz2
ice-e67bc9d134e2727e1da51729665c672904daf6c0.tar.xz
ice-e67bc9d134e2727e1da51729665c672904daf6c0.zip
Merge branch 'R3_3_branch'
Diffstat (limited to 'cpp/src/IceUtil/StringUtil.cpp')
-rw-r--r--cpp/src/IceUtil/StringUtil.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp
index 99c4d759724..a963428aa08 100644
--- a/cpp/src/IceUtil/StringUtil.cpp
+++ b/cpp/src/IceUtil/StringUtil.cpp
@@ -324,7 +324,6 @@ IceUtilInternal::splitString(const string& str, const string& delim, vector<stri
quoteChar = str[pos];
++pos;
}
- bool trim = true;
while(pos < length)
{
if(quoteChar != '\0' && str[pos] == '\\' && pos + 1 < length && str[pos + 1] == quoteChar)
@@ -333,7 +332,6 @@ IceUtilInternal::splitString(const string& str, const string& delim, vector<stri
}
else if(quoteChar != '\0' && str[pos] == quoteChar)
{
- trim = false;
++pos;
quoteChar = '\0';
break;
@@ -687,4 +685,40 @@ IceUtilInternal::lastErrorToString()
return errorToString(errno);
}
+string
+IceUtilInternal::toLower(const std::string& s)
+{
+ string result;
+ for(unsigned int i = 0; i < s.length(); ++ i)
+ {
+ result += tolower(static_cast<unsigned char>(s[i]));
+ }
+ return result;
+}
+
+string
+IceUtilInternal::toUpper(const std::string& s)
+{
+ string result;
+ for(unsigned int i = 0; i < s.length(); ++ i)
+ {
+ result += toupper(static_cast<unsigned char>(s[i]));
+ }
+ return result;
+}
+
+string
+IceUtilInternal::removeWhitespace(const std::string& s)
+{
+ string result;
+ for(unsigned int i = 0; i < s.length(); ++ i)
+ {
+ if(!isspace(static_cast<unsigned char>(s[i])))
+ {
+ result += s[i];
+ }
+ }
+ return result;
+}
+
#endif