diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-02-14 16:22:39 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-02-14 16:22:39 +0800 |
commit | 294ec25fda6e3785c54970d274b860b1ca837955 (patch) | |
tree | 26e5d1987ffdfde7bbacb87fdfb7b96bbef998e9 /cpp/src/IceGrid/Client.cpp | |
parent | Merge branch 'bug2435' (diff) | |
download | ice-294ec25fda6e3785c54970d274b860b1ca837955.tar.bz2 ice-294ec25fda6e3785c54970d274b860b1ca837955.tar.xz ice-294ec25fda6e3785c54970d274b860b1ca837955.zip |
merged bug2615
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r-- | cpp/src/IceGrid/Client.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 3bbc3d03c19..3a20680cdd3 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -11,6 +11,7 @@ #include <IceUtil/Options.h> #include <IceUtil/CtrlCHandler.h> #include <IceUtil/Thread.h> +#include <IceUtil/StringUtil.h> #include <Ice/Ice.h> #include <Ice/SliceChecksums.h> #include <IceGrid/Parser.h> @@ -99,7 +100,6 @@ public: Ice::CommunicatorPtr communicator() const { return _communicator; } const char* appName() const { return _appName; } - string trim(const string&); string getPassword(const string&); private: @@ -380,7 +380,7 @@ Client::run(int argc, char* argv[]) { cout << "user id: " << flush; getline(cin, id); - id = trim(id); + id = IceUtilInternal::trim(id); } if(password.empty()) @@ -486,7 +486,7 @@ Client::run(int argc, char* argv[]) { cout << "user id: " << flush; getline(cin, id); - id = trim(id); + id = IceUtilInternal::trim(id); } if(password.empty()) @@ -615,18 +615,6 @@ Client::run(int argc, char* argv[]) } string -Client::trim(const string& s) -{ - static const string delims = "\t\r\n "; - string::size_type last = s.find_last_not_of(delims); - if(last != string::npos) - { - return s.substr(s.find_first_not_of(delims), last+1); - } - return s; -} - -string Client::getPassword(const string& prompt) { cout << prompt << flush; @@ -648,5 +636,5 @@ Client::getPassword(const string& prompt) } #endif cout << endl; - return trim(password); + return IceUtilInternal::trim(password); } |