diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/src/IceGrid/FileUserAccountMapperI.cpp | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'cpp/src/IceGrid/FileUserAccountMapperI.cpp')
-rw-r--r-- | cpp/src/IceGrid/FileUserAccountMapperI.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/cpp/src/IceGrid/FileUserAccountMapperI.cpp b/cpp/src/IceGrid/FileUserAccountMapperI.cpp index b57b57af61a..0ab37bed844 100644 --- a/cpp/src/IceGrid/FileUserAccountMapperI.cpp +++ b/cpp/src/IceGrid/FileUserAccountMapperI.cpp @@ -20,55 +20,55 @@ FileUserAccountMapperI::FileUserAccountMapperI(const string& filename) ifstream file(filename.c_str()); if(!file) { - throw "cannot open `" + filename + "' for reading: " + strerror(errno); + throw "cannot open `" + filename + "' for reading: " + strerror(errno); } - + const string delim = " \t\r\n"; while(true) { - string line; - getline(file, line); - if(!file) - { - break; - } + string line; + getline(file, line); + if(!file) + { + break; + } - string::size_type idx = line.find('#'); - if(idx != string::npos) - { - line.erase(idx); - } - - idx = line.find_last_not_of(delim); - if(idx != string::npos && idx + 1 < line.length()) - { - line.erase(idx + 1); - } + string::size_type idx = line.find('#'); + if(idx != string::npos) + { + line.erase(idx); + } + + idx = line.find_last_not_of(delim); + if(idx != string::npos && idx + 1 < line.length()) + { + line.erase(idx + 1); + } - string::size_type beg = line.find_first_not_of(delim); - if(beg == string::npos) - { - continue; - } + string::size_type beg = line.find_first_not_of(delim); + if(beg == string::npos) + { + continue; + } - string::size_type end = line.find_first_of(delim, beg); - if(end == string::npos || end <= beg) - { - continue; - } - string account = line.substr(beg, end - beg); + string::size_type end = line.find_first_of(delim, beg); + if(end == string::npos || end <= beg) + { + continue; + } + string account = line.substr(beg, end - beg); - beg = line.find_first_not_of(delim, end); - if(beg == string::npos) - { - continue; - } - string user = line.substr(beg); - - assert(!user.empty()); - assert(!account.empty()); + beg = line.find_first_not_of(delim, end); + if(beg == string::npos) + { + continue; + } + string user = line.substr(beg); + + assert(!user.empty()); + assert(!account.empty()); - _accounts[user] = account; + _accounts[user] = account; } } @@ -78,7 +78,7 @@ FileUserAccountMapperI::getUserAccount(const string& user, const Ice::Current&) map<string, string>::const_iterator p = _accounts.find(user); if(p == _accounts.end()) { - throw UserAccountNotFoundException(); + throw UserAccountNotFoundException(); } return p->second; } |