diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
commit | b40ba0cf91603b695f1f2380cbd39966a458f22f (patch) | |
tree | 1fec48ddc59eb1392fac38495b230e4b2cbf7528 /src/Common/Backends/NetworkUserBackend.cpp | |
parent | e1d8490f0654a3da0b900407d80d91d8d0da68c8 (diff) | |
download | mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.tar mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.zip |
Use Unicode-aware String class instead of std::string
Diffstat (limited to 'src/Common/Backends/NetworkUserBackend.cpp')
-rw-r--r-- | src/Common/Backends/NetworkUserBackend.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/Common/Backends/NetworkUserBackend.cpp b/src/Common/Backends/NetworkUserBackend.cpp index 1b528ab..87d9b4f 100644 --- a/src/Common/Backends/NetworkUserBackend.cpp +++ b/src/Common/Backends/NetworkUserBackend.cpp @@ -26,14 +26,14 @@ namespace Mad { namespace Common { namespace Backends { -const std::string NetworkUserBackend::name("NetworkUserBackend"); +const Core::String NetworkUserBackend::name("NetworkUserBackend"); void NetworkUserBackend::SimpleUserRequest::sendRequest() { XmlData packet; packet.setType(type); if(!timestamp.is_not_a_date_time()) - packet.set("timestamp", boost::posix_time::to_iso_string(timestamp)); + packet.set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str()); sendPacket(packet); } @@ -44,7 +44,7 @@ void NetworkUserBackend::IdUserRequest::sendRequest() { packet.set(idType, id); if(!timestamp.is_not_a_date_time()) - packet.set("timestamp", boost::posix_time::to_iso_string(timestamp)); + packet.set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str()); sendPacket(packet); } @@ -55,7 +55,7 @@ void NetworkUserBackend::NameUserRequest::sendRequest() { packet.set("name", name); if(!timestamp.is_not_a_date_time()) - packet.set("timestamp", boost::posix_time::to_iso_string(timestamp)); + packet.set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str()); sendPacket(packet); } @@ -138,7 +138,7 @@ boost::shared_ptr<const std::map<unsigned long, UserInfo> > NetworkUserBackend:: if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -148,9 +148,9 @@ boost::shared_ptr<const std::map<unsigned long, UserInfo> > NetworkUserBackend:: boost::shared_ptr<std::map<unsigned long, UserInfo> > userList(new std::map<unsigned long, UserInfo>); for(XmlData::List::const_iterator user = users->begin(); user != users->end(); ++user) { - UserInfo userInfo(user->get<unsigned long>("uid"), user->get<const std::string&>("username")); + UserInfo userInfo(user->get<unsigned long>("uid"), user->get<const Core::String&>("username")); userInfo.setGid(user->get<unsigned long>("gid")); - userInfo.setFullName(user->get<const std::string&>("fullName")); + userInfo.setFullName(user->get<const Core::String&>("fullName")); userList->insert(std::make_pair(userInfo.getUid(), userInfo)); } @@ -174,7 +174,7 @@ boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfo(unsigned long if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -182,10 +182,10 @@ boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfo(unsigned long unsigned long uid2 = result.first->get<unsigned long>("uid"); if(uid2) { - boost::shared_ptr<UserInfo> userInfo(new UserInfo(uid2, result.first->get<const std::string&>("username"))); + boost::shared_ptr<UserInfo> userInfo(new UserInfo(uid2, result.first->get<const Core::String&>("username"))); userInfo->setGid(result.first->get<unsigned long>("gid")); - userInfo->setFullName(result.first->get<const std::string&>("fullName")); + userInfo->setFullName(result.first->get<const Core::String&>("fullName")); return userInfo; } @@ -193,7 +193,7 @@ boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfo(unsigned long return boost::shared_ptr<const UserInfo>(); } -boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfoByName(const std::string &name, boost::posix_time::ptime *timestamp) throw(Core::Exception) { +boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfoByName(const Core::String &name, boost::posix_time::ptime *timestamp) throw(Core::Exception) { application->getThreadManager()->detach(); boost::shared_ptr<NameUserRequest> request(new NameUserRequest(application, "GetUserInfo", name, timestamp)); @@ -206,7 +206,7 @@ boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfoByName(const st if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -214,10 +214,10 @@ boost::shared_ptr<const UserInfo> NetworkUserBackend::getUserInfoByName(const st unsigned long uid = result.first->get<unsigned long>("uid"); if(uid) { - boost::shared_ptr<UserInfo> userInfo(new UserInfo(uid, result.first->get<const std::string&>("username"))); + boost::shared_ptr<UserInfo> userInfo(new UserInfo(uid, result.first->get<const Core::String&>("username"))); userInfo->setGid(result.first->get<unsigned long>("gid")); - userInfo->setFullName(result.first->get<const std::string&>("fullName")); + userInfo->setFullName(result.first->get<const Core::String&>("fullName")); return userInfo; } @@ -238,7 +238,7 @@ boost::shared_ptr<const std::set<unsigned long> > NetworkUserBackend::getUserGro if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -270,7 +270,7 @@ boost::shared_ptr<const std::map<unsigned long, GroupInfo> > NetworkUserBackend: if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -280,7 +280,7 @@ boost::shared_ptr<const std::map<unsigned long, GroupInfo> > NetworkUserBackend: boost::shared_ptr<std::map<unsigned long, GroupInfo> > groupList(new std::map<unsigned long, GroupInfo>); for(XmlData::List::const_iterator group = groups->begin(); group != groups->end(); ++group) { - GroupInfo groupInfo(group->get<unsigned long>("gid"), group->get<const std::string&>("name")); + GroupInfo groupInfo(group->get<unsigned long>("gid"), group->get<const Core::String&>("name")); groupList->insert(std::make_pair(groupInfo.getGid(), groupInfo)); } @@ -303,7 +303,7 @@ boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfo(unsigned lon if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -311,12 +311,12 @@ boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfo(unsigned lon unsigned long gid2 = result.first->get<unsigned long>("gid"); if(gid2) - return boost::shared_ptr<GroupInfo>(new GroupInfo(gid2, result.first->get<const std::string&>("name"))); + return boost::shared_ptr<GroupInfo>(new GroupInfo(gid2, result.first->get<const Core::String&>("name"))); return boost::shared_ptr<const GroupInfo>(); } -boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfoByName(const std::string &name, boost::posix_time::ptime *timestamp) throw(Core::Exception) { +boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfoByName(const Core::String &name, boost::posix_time::ptime *timestamp) throw(Core::Exception) { application->getThreadManager()->detach(); boost::shared_ptr<NameUserRequest> request(new NameUserRequest(application, "GetGroupInfo", name, timestamp)); @@ -329,7 +329,7 @@ boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfoByName(const if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -337,7 +337,7 @@ boost::shared_ptr<const GroupInfo> NetworkUserBackend::getGroupInfoByName(const unsigned long gid = result.first->get<unsigned long>("gid"); if(gid) - return boost::shared_ptr<GroupInfo>(new GroupInfo(gid, result.first->get<const std::string&>("name"))); + return boost::shared_ptr<GroupInfo>(new GroupInfo(gid, result.first->get<const Core::String&>("name"))); return boost::shared_ptr<const GroupInfo>(); } @@ -355,7 +355,7 @@ boost::shared_ptr<const std::set<unsigned long> > NetworkUserBackend::getGroupUs if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -387,7 +387,7 @@ boost::shared_ptr<const std::multimap<unsigned long, unsigned long> > NetworkUse if(timestamp) { try { - *timestamp = boost::posix_time::from_iso_string(result.first->get<const std::string&>("timestamp")); + *timestamp = boost::posix_time::from_iso_string(result.first->get<const Core::String&>("timestamp").extract()); } catch(...) {} } @@ -529,7 +529,7 @@ void NetworkUserBackend::deleteUserFromGroup(unsigned long uid, unsigned long gi } -void NetworkUserBackend::setPassword(unsigned long uid, const std::string &password) throw(Core::Exception) { +void NetworkUserBackend::setPassword(unsigned long uid, const Core::String &password) throw(Core::Exception) { application->getThreadManager()->detach(); boost::shared_ptr<PasswordRequest> request(new PasswordRequest(application, uid, password)); |