summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/StringUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2008-10-30 13:58:03 -0230
committerDwayne Boone <dwayne@zeroc.com>2008-10-30 13:58:03 -0230
commit07de2f5bc3a42b00812b1e5677548cbd45f6f203 (patch)
treec555541f713f9412f4a88995e300f22f8d23aba2 /cpp/src/IceUtil/StringUtil.cpp
parentBug 3380 - windows release build broken (diff)
downloadice-07de2f5bc3a42b00812b1e5677548cbd45f6f203.tar.bz2
ice-07de2f5bc3a42b00812b1e5677548cbd45f6f203.tar.xz
ice-07de2f5bc3a42b00812b1e5677548cbd45f6f203.zip
Bug 3519 - fix isalpha, isprint, ... usage
Diffstat (limited to 'cpp/src/IceUtil/StringUtil.cpp')
-rw-r--r--cpp/src/IceUtil/StringUtil.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp
index 99c4d759724..b6eb12390db 100644
--- a/cpp/src/IceUtil/StringUtil.cpp
+++ b/cpp/src/IceUtil/StringUtil.cpp
@@ -687,4 +687,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