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/RequestHandlers | |
parent | e1d8490f0654a3da0b900407d80d91d8d0da68c8 (diff) | |
download | mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.tar mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.zip |
Use Unicode-aware String class instead of std::string
Diffstat (limited to 'src/Common/RequestHandlers')
5 files changed, 15 insertions, 15 deletions
diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp index af4bf50..36ae515 100644 --- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp +++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp @@ -37,8 +37,8 @@ void FSInfoRequestHandler::handleRequest(boost::shared_ptr<const Common::XmlData for(std::vector<SystemManager::FSInfo>::const_iterator fs = fsInfo.begin(); fs != fsInfo.end(); ++fs) { XmlData::List::iterator entry = list->addEntry(); - entry->set("name", fs->fsName); - entry->set("mountedOn", fs->mountedOn); + entry->set("name", fs->fsName.c_str()); + entry->set("mountedOn", fs->mountedOn.c_str()); entry->set("totalSize", fs->total); entry->set("usedSize", fs->used); entry->set("availableSize", fs->available); diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.cpp b/src/Common/RequestHandlers/SimpleRequestHandler.cpp index 86edca6..71a8b3a 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandler.cpp @@ -49,7 +49,7 @@ void SimpleRequestHandler::handlePacket(boost::shared_ptr<const XmlData> packet) ret.set("ErrorCode", e.getErrorCode()); ret.set("SubCode", e.getSubCode()); ret.set("SubSubCode", e.getSubSubCode()); - ret.set("Where", e.getWhere()); + ret.set("Where", e.getWhere().c_str()); } sendPacket(ret); diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.h b/src/Common/RequestHandlers/SimpleRequestHandler.h index 85cbd4c..5ccb1f4 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.h +++ b/src/Common/RequestHandlers/SimpleRequestHandler.h @@ -30,13 +30,13 @@ namespace RequestHandlers { class MAD_COMMON_EXPORT SimpleRequestHandler : public RequestHandler { private: - std::string type; + Core::String type; boost::function2<void, boost::shared_ptr<const XmlData>, XmlData*> handler; protected: virtual void handlePacket(boost::shared_ptr<const XmlData> packet); - SimpleRequestHandler(Application *application, const std::string &type0, const boost::function2<void, boost::shared_ptr<const XmlData>, XmlData*> &handler0) + SimpleRequestHandler(Application *application, const Core::String &type0, const boost::function2<void, boost::shared_ptr<const XmlData>, XmlData*> &handler0) : RequestHandler(application), type(type0), handler(handler0) {} }; diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp index a7debc3..a3ed286 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp @@ -50,15 +50,15 @@ void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ ret.set("ErrorCode", e.getErrorCode()); ret.set("SubCode", e.getSubCode()); ret.set("SubSubCode", e.getSubSubCode()); - ret.set("Where", e.getWhere()); + ret.set("Where", e.getWhere().c_str()); } sendPacket(ret); signalFinished(); } -boost::shared_ptr<RequestHandler> SimpleRequestHandlerGroup::createRequestHandler(Application *application, const std::string &type) { - std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> >::iterator handler = handlers.find(type); +boost::shared_ptr<RequestHandler> SimpleRequestHandlerGroup::createRequestHandler(Application *application, const Core::String &type) { + std::map<Core::String, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> >::iterator handler = handlers.find(type); if(handler == handlers.end()) return boost::shared_ptr<RequestHandler>(); diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h index 2022705..53f8516 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.h @@ -32,22 +32,22 @@ class MAD_COMMON_EXPORT SimpleRequestHandlerGroup : public RequestHandlerGroup { private: class MAD_COMMON_EXPORT GroupRequestHandler : public RequestHandler { private: - std::string type; + Core::String type; boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> handler; protected: virtual void handlePacket(boost::shared_ptr<const XmlData> packet); public: - GroupRequestHandler(Application *application, const std::string &type0, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler0) + GroupRequestHandler(Application *application, const Core::String &type0, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler0) : RequestHandler(application), type(type0), handler(handler0) {} }; - std::set<std::string> types; - std::map<std::string, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> > handlers; + std::set<Core::String> types; + std::map<Core::String, boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> > handlers; protected: - void registerHandler(const std::string &type, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler) { + void registerHandler(const Core::String &type, const boost::function3<void, boost::shared_ptr<const XmlData>, XmlData*, Connection*> &handler) { types.insert(type); handlers.insert(std::make_pair(type, handler)); } @@ -55,11 +55,11 @@ class MAD_COMMON_EXPORT SimpleRequestHandlerGroup : public RequestHandlerGroup { SimpleRequestHandlerGroup() {} public: - virtual const std::set<std::string>& getPacketTypes() { + virtual const std::set<Core::String>& getPacketTypes() { return types; } - virtual boost::shared_ptr<RequestHandler> createRequestHandler(Application *application, const std::string &type); + virtual boost::shared_ptr<RequestHandler> createRequestHandler(Application *application, const Core::String &type); }; } |