From 1e2c649a3e8788e4758bbb195b770a2f271eaf43 Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 27 Sep 2015 20:28:10 +0200 Subject: [PATCH] Fixed build --- src/metadata/Utils.hpp | 3 +- src/service/LmsAPIServerService.cpp | 64 ----------------------------- src/service/LmsAPIServerService.hpp | 50 ---------------------- 3 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 src/service/LmsAPIServerService.cpp delete mode 100644 src/service/LmsAPIServerService.hpp diff --git a/src/metadata/Utils.hpp b/src/metadata/Utils.hpp index 4cd6e15a..786e1a2b 100644 --- a/src/metadata/Utils.hpp +++ b/src/metadata/Utils.hpp @@ -36,7 +36,8 @@ template static inline bool readAs(const std::string& str, T& data) { std::istringstream iss ( str ); - return iss >> data; + iss >> data; + return !iss.fail(); } diff --git a/src/service/LmsAPIServerService.cpp b/src/service/LmsAPIServerService.cpp deleted file mode 100644 index a5985b79..00000000 --- a/src/service/LmsAPIServerService.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2013 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#include - -#include "config/ConfigReader.hpp" -#include "logger/Logger.hpp" - -#include "LmsAPIServerService.hpp" - -namespace Service { - -LmsAPIService::LmsAPIService(Wt::Dbo::SqlConnectionPool& connectionPool) -: _server( - boost::asio::ip::tcp::endpoint( - boost::asio::ip::address::from_string(ConfigReader::instance().getString("remote.listen-endpoint.addr")), - ConfigReader::instance().getULong("remote.listen-endpoint.port")), - ConfigReader::instance().getString("remote.ssl-crypto.cert"), - ConfigReader::instance().getString("remote.ssl-crypto.key"), - ConfigReader::instance().getString("remote.ssl-crypto.dh"), - connectionPool) -{ -} - -void -LmsAPIService::start(void) -{ - LMS_LOG(MOD_SERVICE, SEV_DEBUG) << "LmsAPIService::start, starting..."; - _server.start(); - LMS_LOG(MOD_SERVICE, SEV_DEBUG) << "LmsAPIService::start, started!"; -} - - -void -LmsAPIService::stop(void) -{ - LMS_LOG(MOD_SERVICE, SEV_DEBUG) << "LmsAPIService::stop, stopping..."; - _server.stop(); - LMS_LOG(MOD_SERVICE, SEV_DEBUG) << "LmsAPIService::stop, stopped!"; -} - -void -LmsAPIService::restart(void) -{ - LMS_LOG(MOD_SERVICE, SEV_DEBUG) << "LmsAPIService::restart, not implemented!"; -} - -} // namespace Service diff --git a/src/service/LmsAPIServerService.hpp b/src/service/LmsAPIServerService.hpp deleted file mode 100644 index 099f597f..00000000 --- a/src/service/LmsAPIServerService.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2013 Emeric Poupon - * - * This file is part of LMS. - * - * LMS is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * LMS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with LMS. If not, see . - */ - -#ifndef REMOTE_SERVER_SERVICE_HPP -#define REMOTE_SERVER_SERVICE_HPP - -#include - -#include "config/config.h" - -#include "Service.hpp" - -#include "lms-api/server/Server.hpp" - -namespace Service { - -class LmsAPIService : public Service -{ - public: - - LmsAPIService(Wt::Dbo::SqlConnectionPool& connectionPool); - - void start(void); - void stop(void); - void restart(void); - - private: - - LmsAPI::Server::Server _server; -}; - -} // namespace Service - -#endif