From 9280f6125ddabe438e4f6df3ea81b7360d7ff851 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:12:13 +0400 Subject: [PATCH 1/6] Remove network-error library target --- error/src/CMakeLists.txt | 4 ---- error/test/CMakeLists.txt | 1 - 2 files changed, 5 deletions(-) diff --git a/error/src/CMakeLists.txt b/error/src/CMakeLists.txt index 8fe76d568..82d832985 100644 --- a/error/src/CMakeLists.txt +++ b/error/src/CMakeLists.txt @@ -8,10 +8,6 @@ include_directories(${CPP-NETLIB_SOURCE_DIR}/error/src) set(CPP-NETLIB_ERROR_SRCS error.cpp) -if(NOT CPP-NETLIB_BUILD_SINGLE_LIB) - add_library(network-error ${CPP-NETLIB_ERROR_SRCS}) -endif() - # prepend current directory to make paths absolute prependToElements( "${CMAKE_CURRENT_SOURCE_DIR}/" CPP-NETLIB_ERROR_SRCS ) diff --git a/error/test/CMakeLists.txt b/error/test/CMakeLists.txt index 8561ce95e..5dfa388e5 100644 --- a/error/test/CMakeLists.txt +++ b/error/test/CMakeLists.txt @@ -12,7 +12,6 @@ if (CPP-NETLIB_BUILD_TESTS) add_executable(cpp-netlib-error_test error_test.cpp) target_link_libraries(cpp-netlib-error_test ${link_cppnetlib_lib} - network-error ${Boost_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) From ca1ad5a1fef4d216b22c9c4289e08d14db2b4020 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:14:26 +0400 Subject: [PATCH 2/6] Variable CPP-NETLIB_ERROR_SRCS is unused --- error/CMakeLists.txt | 3 --- error/src/CMakeLists.txt | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt index 560d600d9..a43941617 100644 --- a/error/CMakeLists.txt +++ b/error/CMakeLists.txt @@ -9,6 +9,3 @@ if(CPP-NETLIB_BUILD_TESTS) enable_testing() add_subdirectory(test) endif(CPP-NETLIB_BUILD_TESTS) - -# propagate sources to parent directory for one-lib-build -set(CPP-NETLIB_ERROR_SRCS ${CPP-NETLIB_ERROR_SRCS} PARENT_SCOPE) diff --git a/error/src/CMakeLists.txt b/error/src/CMakeLists.txt index 82d832985..b4ca8ee58 100644 --- a/error/src/CMakeLists.txt +++ b/error/src/CMakeLists.txt @@ -4,13 +4,3 @@ # http://www.boost.org/LICENSE_1_0.txt) include_directories(${CPP-NETLIB_SOURCE_DIR}/error/src) - -set(CPP-NETLIB_ERROR_SRCS - error.cpp) - -# prepend current directory to make paths absolute -prependToElements( "${CMAKE_CURRENT_SOURCE_DIR}/" - CPP-NETLIB_ERROR_SRCS ) - -# propagate sources to parent directory for one-lib-build -set(CPP-NETLIB_ERROR_SRCS ${CPP-NETLIB_ERROR_SRCS} PARENT_SCOPE) From b490f43895642082ca963b4308681c20f93ac9ec Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:17:05 +0400 Subject: [PATCH 3/6] File error.cpp is unused --- error/src/error.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 error/src/error.cpp diff --git a/error/src/error.cpp b/error/src/error.cpp deleted file mode 100644 index d4e83560d..000000000 --- a/error/src/error.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2013 by Glyn Matthews -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include - -namespace network { - - class network_category_impl : public std::error_category { - - public: - - network_category_impl() = default; - - virtual ~network_category_impl() noexcept; - - virtual const char *name() const noexcept; - - virtual std::string message(int ev) const; - - }; - - network_category_impl::~network_category_impl() noexcept { - - } - - const char *network_category_impl::name() const noexcept { - static const char name[] = "network_error"; - return name; - } - - std::string network_category_impl::message(int ev) const { - return std::strerror(ev); - } - - const std::error_category &network_category() { - static network_category_impl category; - return category; - } -} // namespace network From f4241bd176c5733f81ebc62d3e4007f1e09b5060 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:20:01 +0400 Subject: [PATCH 4/6] Remove test target and unused error.hpp --- error/src/network/error.hpp | 61 ------------------------------------- error/test/CMakeLists.txt | 13 -------- error/test/error_test.cpp | 13 -------- 3 files changed, 87 deletions(-) delete mode 100644 error/src/network/error.hpp delete mode 100644 error/test/error_test.cpp diff --git a/error/src/network/error.hpp b/error/src/network/error.hpp deleted file mode 100644 index 3050fdaaa..000000000 --- a/error/src/network/error.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2013 by Glyn Matthews -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef NETWORK_ERROR_INC -#define NETWORK_ERROR_INC - -/** - * \defgroup error Generic Error Handling - * - * This module contains a simple function that is used in generic - * error handling inside cpp-netlib. - * - * \file - * \brief Contains a set of error classes and exceptions for - * network connections. - */ - -#include - -namespace network { - /** - * \ingroup error - * \brief Gets the error category for network errors. - * - * e.g. - * - * \code - * throw std::system_error(EPIPE, network::network_category()); - * \endcode - */ - const std::error_category &network_category(); - - /** - * \ingroup error - * \class network_exception network/error.hpp - * \brief An exception thrown in the event of a network error. - */ - class network_exception : public std::system_error { - - public: - - /** - * \brief Constructor. - * \param error_code The system error code. - */ - explicit network_exception(int error_code) - : std::system_error(error_code, network_category()) { - - } - - /** - * \brief Destructor. - */ - virtual ~network_exception() noexcept; - - }; -} // namespace network - -#endif // NETWORK_ERROR_INC diff --git a/error/test/CMakeLists.txt b/error/test/CMakeLists.txt index 5dfa388e5..c4ddf2fba 100644 --- a/error/test/CMakeLists.txt +++ b/error/test/CMakeLists.txt @@ -7,16 +7,3 @@ include_directories(${CPP-NETLIB_SOURCE_DIR}/error/src ${GTEST_INCLUDE_DIRS} ${CPP-NETLIB_SOURCE_DIR} ) - -if (CPP-NETLIB_BUILD_TESTS) - add_executable(cpp-netlib-error_test error_test.cpp) - target_link_libraries(cpp-netlib-error_test - ${link_cppnetlib_lib} - ${Boost_LIBRARIES} - ${GTEST_BOTH_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT}) - set_target_properties(cpp-netlib-error_test PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests) - add_test(cpp-netlib-error_test - ${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-error_test) -endif() diff --git a/error/test/error_test.cpp b/error/test/error_test.cpp deleted file mode 100644 index 1bb84be1e..000000000 --- a/error/test/error_test.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Glyn Matthews 2013. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include - -TEST(error_test, system_error) { - std::system_error error(EPIPE, network::network_category()); - ASSERT_EQ(EPIPE, error.code().value()); -} From c128064846e83b8770ae92b6256f2cfed768349e Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:21:51 +0400 Subject: [PATCH 5/6] Remove unused --- error/CMakeLists.txt | 5 ----- error/test/CMakeLists.txt | 9 --------- 2 files changed, 14 deletions(-) delete mode 100644 error/test/CMakeLists.txt diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt index a43941617..2d86a17e9 100644 --- a/error/CMakeLists.txt +++ b/error/CMakeLists.txt @@ -4,8 +4,3 @@ # http://www.boost.org/LICENSE_1_0.txt) add_subdirectory(src) - -if(CPP-NETLIB_BUILD_TESTS) - enable_testing() - add_subdirectory(test) -endif(CPP-NETLIB_BUILD_TESTS) diff --git a/error/test/CMakeLists.txt b/error/test/CMakeLists.txt deleted file mode 100644 index c4ddf2fba..000000000 --- a/error/test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) Glyn Matthews 2013. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include_directories(${CPP-NETLIB_SOURCE_DIR}/error/src - ${GTEST_INCLUDE_DIRS} - ${CPP-NETLIB_SOURCE_DIR} -) From ee4a9f23ffa2ffa0135c80d407a60654e7c5ffc9 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 30 Jan 2014 14:23:13 +0400 Subject: [PATCH 6/6] Remove empty directory and empty CMakeLists.txt --- CMakeLists.txt | 2 -- error/CMakeLists.txt | 6 ------ error/src/CMakeLists.txt | 6 ------ 3 files changed, 14 deletions(-) delete mode 100644 error/CMakeLists.txt delete mode 100644 error/src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 19977cc89..c951518b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,7 +159,6 @@ endif(DOXYGEN_FOUND) if(CPP-NETLIB_BUILD_SINGLE_LIB) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/config/src - ${CMAKE_CURRENT_SOURCE_DIR}/error/src ${CMAKE_CURRENT_SOURCE_DIR}/concurrency/src ${CMAKE_CURRENT_SOURCE_DIR}/http/src ${CMAKE_CURRENT_SOURCE_DIR}/logging/src @@ -172,7 +171,6 @@ endif() add_subdirectory(uri) add_subdirectory(message) add_subdirectory(logging) -add_subdirectory(error) add_subdirectory(http) add_subdirectory(concurrency) #add_subdirectory(mime) diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt deleted file mode 100644 index 2d86a17e9..000000000 --- a/error/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) Glyn Matthews 2013. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -add_subdirectory(src) diff --git a/error/src/CMakeLists.txt b/error/src/CMakeLists.txt deleted file mode 100644 index b4ca8ee58..000000000 --- a/error/src/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) Glyn Matthews 2013. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -include_directories(${CPP-NETLIB_SOURCE_DIR}/error/src)