Skip to content

Commit

Permalink
removed framework dependency; resolved #15
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-crowhurst committed Jul 14, 2015
1 parent 0b1a153 commit be5b9f0
Show file tree
Hide file tree
Showing 121 changed files with 2,590 additions and 380 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "dependency/catch"]
path = dependency/catch
url = https://github.com/corvusoft/catch-dependency
[submodule "dependency/framework"]
path = dependency/framework
url = https://github.com/corvusoft/framework
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ include( "${CMAKE_SOURCE_DIR}/cmake/build_configuration.cmake" )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules" )

find_package( asio REQUIRED )
find_package( framework REQUIRED )

if ( BUILD_SSL )
find_package( openssl REQUIRED )
endif ( )

include_directories( SYSTEM ${framework_INCLUDE} ${asio_INCLUDE} )
include_directories( SYSTEM ${asio_INCLUDE} )

#
# Build
Expand All @@ -38,12 +37,11 @@ include( "${CMAKE_SOURCE_DIR}/cmake/build_manifest.cmake" )
include_directories( ${INCLUDE_DIR} )

add_library( ${PROJECT_NAME} SHARED ${BUILD_MANIFEST} )
add_dependencies( ${PROJECT_NAME} corvusoft-framework )

if ( BUILD_SSL )
target_link_libraries( ${PROJECT_NAME} framework ${ssl_LIBRARY} ${crypto_LIBRARY} )
target_link_libraries( ${PROJECT_NAME} ${ssl_LIBRARY} ${crypto_LIBRARY} )
else ( )
target_link_libraries( ${PROJECT_NAME} framework )
target_link_libraries( ${PROJECT_NAME} )
endif ( )

if ( BUILD_EXAMPLES )
Expand Down
5 changes: 4 additions & 1 deletion cmake/build_artifacts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ set( BUILD_ARTIFACTS
${SOURCE_DIR}/resource.hpp
${SOURCE_DIR}/request.hpp
${SOURCE_DIR}/response.hpp
${SOURCE_DIR}/byte.hpp
${SOURCE_DIR}/uri.hpp
${SOURCE_DIR}/string.hpp
${SOURCE_DIR}/logger.hpp
${SOURCE_DIR}/service.hpp
${SOURCE_DIR}/session.hpp
${SOURCE_DIR}/logger.hpp
${SOURCE_DIR}/session_manager.hpp
)
5 changes: 5 additions & 0 deletions cmake/build_manifest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set( BUILD_MANIFEST
${SOURCE_DIR}/detail/settings_impl.cpp
${SOURCE_DIR}/ssl_settings.cpp
${SOURCE_DIR}/detail/ssl_settings_impl.cpp
${SOURCE_DIR}/uri.cpp
${SOURCE_DIR}/detail/uri_impl.cpp
${SOURCE_DIR}/detail/map_impl.cpp
${SOURCE_DIR}/string.cpp
${SOURCE_DIR}/detail/string_impl.cpp
${SOURCE_DIR}/resource.cpp
${SOURCE_DIR}/detail/resource_impl.cpp
${SOURCE_DIR}/request.cpp
Expand Down
33 changes: 0 additions & 33 deletions cmake/modules/Findframework.cmake

This file was deleted.

1 change: 0 additions & 1 deletion dependency/framework
Submodule framework deleted from 0d192b
2 changes: 0 additions & 2 deletions example/compression/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <memory>
#include <cstdlib>
#include <restbed>
#include <framework>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wextra"
Expand All @@ -22,7 +21,6 @@

using namespace std;
using namespace restbed;
using namespace framework;

void deflate_method_handler( const shared_ptr< Session >& session )
{
Expand Down
2 changes: 0 additions & 2 deletions example/http_service/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
#include <memory>
#include <cstdlib>
#include <restbed>
#include <framework>

using namespace std;
using namespace restbed;
using namespace framework;

void post_method_handler( const shared_ptr< Session >& session )
{
Expand Down
2 changes: 0 additions & 2 deletions example/https_service/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
#include <memory>
#include <cstdlib>
#include <restbed>
#include <framework>

using namespace std;
using namespace restbed;
using namespace framework;

void get_method_handler( const shared_ptr< Session >& session )
{
Expand Down
2 changes: 0 additions & 2 deletions example/publishing_resources/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
#include <memory>
#include <cstdlib>
#include <restbed>
#include <framework>

using namespace std;
using namespace restbed;
using namespace framework;

void post_method_handler( const shared_ptr< Session >& session )
{
Expand Down
2 changes: 0 additions & 2 deletions example/service_ready_handler/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
#include <chrono>
#include <cstdlib>
#include <restbed>
#include <framework>

using namespace std;
using namespace restbed;
using namespace framework;

void get_method_handler( const shared_ptr< Session >& session )
{
Expand Down
2 changes: 0 additions & 2 deletions example/transfer_encoding_request/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
#include <cstdlib>
#include <iostream>
#include <restbed>
#include <framework>

using namespace std;
using namespace restbed;
using namespace framework;

void post_method_handler( const shared_ptr< Session >& );
void read_chunk( const shared_ptr< Session >&, const Bytes& );
Expand Down
30 changes: 30 additions & 0 deletions source/corvusoft/restbed/byte.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2013, 2014, 2015 Corvusoft
*/

#ifndef _RESTBED_BYTE_H
#define _RESTBED_BYTE_H 1

//System Includes
#include <vector>
#include <cstdint>

//Project Includes

//External Includes

//System Namespaces
using std::vector;

//Project Namespaces

//External Namespaces

namespace restbed
{
typedef uint8_t Byte;

typedef std::vector< Byte > Bytes;
}

#endif /* _RESTBED_BYTE_H */
64 changes: 64 additions & 0 deletions source/corvusoft/restbed/detail/map_impl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2013, 2014, 2015 Corvusoft
*/

//System Includes
#include <utility>
#include <algorithm>

//Project Includes
#include "corvusoft/restbed/string.hpp"
#include "corvusoft/restbed/detail/map_impl.hpp"

//External Includes

//System Namespaces
using std::map;
using std::pair;
using std::string;
using std::find_if;
using std::multimap;

//Project Namespaces

//External Namespaces

namespace restbed
{
namespace detail
{
MapImpl::iterator MapImpl::find_ignoring_case( const string& key, map< string, string >& container )
{
auto identifier = String::lowercase( key );

auto iterator = find_if( container.begin( ), container.end( ), [ &identifier ]( const pair< string, string >& value )
{
return ( identifier == String::lowercase( value.first ) );
} );

return iterator;
}

MapImpl::const_iterator MapImpl::find_ignoring_case( const string& key, const map< string, string >& container )
{
return find_ignoring_case( key, const_cast< map< string, string >& >( container ) );
}

MapImpl::iterator MapImpl::find_ignoring_case( const string& key, multimap< string, string >& container )
{
auto identifier = String::lowercase( key );

auto iterator = find_if( container.begin( ), container.end( ), [ &identifier ]( const pair< string, string >& value )
{
return ( identifier == String::lowercase( value.first ) );
} );

return iterator;
}

MapImpl::const_iterator MapImpl::find_ignoring_case( const string& key, const multimap< string, string >& container )
{
return find_ignoring_case( key, const_cast< multimap< string, string >& >( container ) );
}
}
}
102 changes: 102 additions & 0 deletions source/corvusoft/restbed/detail/map_impl.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Copyright (c) 2013, 2014, 2015 Corvusoft
*/

#ifndef _RESTBED_DETAIL_MAP_IMPL_H
#define _RESTBED_DETAIL_MAP_IMPL_H 1

//System Includes
#include <map>
#include <string>

//Project Includes

//External Includes

//System Namespaces

//Project Namespaces

//External Namespaces

namespace restbed
{
//Forward Declarations

namespace detail
{
//Forward Declarations

class MapImpl
{
public:
//Friends

//Definitions
typedef std::map< std::string, std::string >::iterator iterator;

typedef std::map< std::string, std::string >::const_iterator const_iterator;

//Constructors

//Functionality
static iterator find_ignoring_case( const std::string& key, std::map< std::string, std::string >& container );

static const_iterator find_ignoring_case( const std::string& key, const std::map< std::string, std::string >& container );

static iterator find_ignoring_case( const std::string& key, std::multimap< std::string, std::string >& container );

static const_iterator find_ignoring_case( const std::string& key, const std::multimap< std::string, std::string >& container );

//Getters

//Setters

//Operators

//Properties

protected:
//Friends

//Definitions

//Constructors

//Functionality

//Getters

//Setters

//Operators

//Properties

private:
//Friends

//Definitions

//Constructors
MapImpl( void ) = delete;

MapImpl( const MapImpl& original ) = delete;

virtual ~MapImpl( void ) = delete;

//Functionality

//Getters

//Setters

//Operators
MapImpl& operator =( const MapImpl& value ) = delete;

//Properties
};
}
}

#endif /* _RESTBED_DETAIL_MAP_IMPL_H */
Loading

0 comments on commit be5b9f0

Please sign in to comment.