From b40ba0cf91603b695f1f2380cbd39966a458f22f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 27 Sep 2009 19:58:24 +0200 Subject: Use Unicode-aware String class instead of std::string --- src/Daemon/Backends/NetworkLogger.h | 2 +- src/Daemon/RequestHandlers/CommandRequestHandler.cpp | 2 +- src/Daemon/Requests/LogRequest.cpp | 2 +- src/Daemon/Requests/LogRequest.h | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/Backends/NetworkLogger.h b/src/Daemon/Backends/NetworkLogger.h index 8c93036..2ee9fcf 100644 --- a/src/Daemon/Backends/NetworkLogger.h +++ b/src/Daemon/Backends/NetworkLogger.h @@ -36,7 +36,7 @@ class NetworkLogger : public Core::Logger { protected: virtual void logMessage(Core::Logger::MessageCategory category, Core::Logger::MessageLevel level, boost::posix_time::ptime messageTimestamp, const std::string &message, const std::string &source) { - boost::shared_ptr request(new Requests::LogRequest(application, category, level, messageTimestamp, message, source)); + boost::shared_ptr request(new Requests::LogRequest(application, category, level, messageTimestamp, message.c_str(), source.c_str())); application->getRequestManager()->sendRequest(connection, request); } diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp index e3d34e5..d0203e8 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp @@ -28,7 +28,7 @@ void CommandRequestHandler::handleRequest(boost::shared_ptrisAuthenticated()) throw(Core::Exception(Core::Exception::PERMISSION)); - std::string command = packet->get("command"); + Core::String command = packet->get("command"); if(command == "reboot") getApplication()->getSystemManager()->reboot(); diff --git a/src/Daemon/Requests/LogRequest.cpp b/src/Daemon/Requests/LogRequest.cpp index 0282649..1f1fdc8 100644 --- a/src/Daemon/Requests/LogRequest.cpp +++ b/src/Daemon/Requests/LogRequest.cpp @@ -32,7 +32,7 @@ void LogRequest::sendRequest() { packet.set("category", category); packet.set("level", level); - packet.set("timestamp", boost::posix_time::to_iso_string(messageTimestamp)); + packet.set("timestamp", boost::posix_time::to_iso_string(messageTimestamp).c_str()); packet.set("message", message); packet.set("source", source); diff --git a/src/Daemon/Requests/LogRequest.h b/src/Daemon/Requests/LogRequest.h index 2d8c91f..8630b45 100644 --- a/src/Daemon/Requests/LogRequest.h +++ b/src/Daemon/Requests/LogRequest.h @@ -34,14 +34,14 @@ class MAD_DAEMON_EXPORT LogRequest : public Common::Request { Core::Logger::MessageCategory category; Core::Logger::MessageLevel level; boost::posix_time::ptime messageTimestamp; - std::string message, source; + Core::String message, source; protected: virtual void sendRequest(); public: - LogRequest(Common::Application *application, Core::Logger::MessageCategory category0, Core::Logger::MessageLevel level0, boost::posix_time::ptime messageTimestamp0, const std::string &message0, - const std::string &source0) + LogRequest(Common::Application *application, Core::Logger::MessageCategory category0, Core::Logger::MessageLevel level0, boost::posix_time::ptime messageTimestamp0, const Core::String &message0, + const Core::String &source0) : Common::Request(application), category(category0), level(level0), messageTimestamp(messageTimestamp0), message(message0), source(source0) {} }; -- cgit v1.2.3