Permalink
Browse files

rename library Taco Pie

  • Loading branch information...
Cylix committed Nov 23, 2016
1 parent 5f937a5 commit 8618ccd748134649b48de6551be98da3643e560b
@@ -55,7 +55,7 @@ DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: 'cpp_http_server'
- Regex: 'tacopie'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
@@ -26,4 +26,4 @@ install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- ./install_deps.sh
script: mkdir build && cd build && cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true && make && ./bin/cpp_http_server_tests
script: mkdir build && cd build && cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true && make && ./bin/tacopie_tests
@@ -14,7 +14,7 @@ set(CMAKE_MACOSX_RPATH 1)
###
# project
###
set(PROJECT cpp_http_server)
set(PROJECT tacopie)
project(${PROJECT} CXX)
@@ -30,13 +30,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -W -Wall -Wextra -O3")
set(DEPS_FOLDER ${PROJECT_SOURCE_DIR}/deps/build)
set(GTEST_INCLUDES ${DEPS_FOLDER}/gtest/include)
set(GTEST_LIBS ${DEPS_FOLDER}/gtest/lib)
set(CPP_HTTP_SERVER_INCLUDES ${PROJECT_SOURCE_DIR}/includes)
set(TACOPIE_INCLUDES ${PROJECT_SOURCE_DIR}/includes)
###
# includes
###
include_directories(${CPP_HTTP_SERVER_INCLUDES})
include_directories(${TACOPIE_INCLUDES})
###
@@ -71,9 +71,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_library(${PROJECT} STATIC ${SOURCES})
target_link_libraries(${PROJECT} pthread)
# __CPP_HTTP_SERVER_LOGGING_ENABLED
# __TACOPIE_LOGGING_ENABLED
IF (LOGGING_ENABLED)
set_target_properties(${PROJECT} PROPERTIES COMPILE_DEFINITIONS "__CPP_HTTP_SERVER_LOGGING_ENABLED=${LOGGING_ENABLED}")
set_target_properties(${PROJECT} PROPERTIES COMPILE_DEFINITIONS "__TACOPIE_LOGGING_ENABLED=${LOGGING_ENABLED}")
ENDIF (LOGGING_ENABLED)
@@ -82,7 +82,7 @@ ENDIF (LOGGING_ENABLED)
###
install (DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION lib USE_SOURCE_PERMISSIONS)
install (DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin USE_SOURCE_PERMISSIONS)
install (DIRECTORY ${CPP_HTTP_SERVER_INCLUDES}/ DESTINATION include USE_SOURCE_PERMISSIONS)
install (DIRECTORY ${TACOPIE_INCLUDES}/ DESTINATION include USE_SOURCE_PERMISSIONS)
###
@@ -17,8 +17,8 @@ cd build
cmake .. -DBUILD_TESTS=true -DBUILD_EXAMPLES=true -DLOGGING_ENABLED=1
make
# Run tests and examples
./bin/cpp_http_server_tests
./bin/http_server
./bin/tacopie_tests
./bin/tacopie_example
```
## 5. Code your changes
@@ -47,7 +47,7 @@ You can do as many commits as you want: we will squash them into a single commit
## 8. Before the Pull Request
Before submitting the pull request, ensure that:
* your feature works as expected and is tested
* all tests pass on both your computer and the [Travis](travis-ci.org/Cylix/cpp_http_server)
* all tests pass on both your computer and the [Travis](travis-ci.org/Cylix/tacopie)
* you have used the formatting tool
## 9. Submit your Pull Request on Github
@@ -1,21 +1,21 @@
# cpp_http_server [![Build Status](https://travis-ci.org/Cylix/cpp_http_server.svg?branch=master)](https://travis-ci.org/Cylix/cpp_http_server)
`cpp_http_server` is a C++11 Asynchronous HTTP Server.
# Taco Pie [![Build Status](https://travis-ci.org/Cylix/tacopie.svg?branch=master)](https://travis-ci.org/Cylix/tacopie)
`tacopie` is a TCP Client & Server C++11 library.
**The library is still under development. No release is available yet.**
## Requirement
`cpp_http_server` has **no dependency**. Its only requirement is `C++11`.
`tacopie` has **no dependency**. Its only requirement is `C++11`.
For now, the library is developed only for linux and mac platforms with no support for Windows environment.
## Example
No example is available yet.
## Wiki
A [Wiki](https://github.com/Cylix/cpp_http_server/wiki) is available and provides full documentation for the library as well as [installation explanations](https://github.com/Cylix/cpp_http_server/wiki/Installation).
A [Wiki](https://github.com/Cylix/tacopie/wiki) is available and provides full documentation for the library as well as [installation explanations](https://github.com/Cylix/tacopie/wiki/Installation).
## License
`cpp_http_server` is under [MIT License](LICENSE).
`tacopie` is under [MIT License](LICENSE).
## Contributing
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
Binary file not shown.
@@ -8,20 +8,20 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# includes
###
include_directories(${PROJECT_SOURCE_DIR}/includes
${CPP_HTTP_SERVER_INCLUDES})
${TACOPIE_INCLUDES})
###
# executable
###
add_executable(http_server http_server.cpp)
target_link_libraries(http_server cpp_http_server)
add_executable(tacopie_example tacopie.cpp)
target_link_libraries(tacopie_example tacopie)
IF (LOGGING_ENABLED)
set_target_properties(http_server PROPERTIES COMPILE_DEFINITIONS "__CPP_HTTP_SERVER_LOGGING_ENABLED=${LOGGING_ENABLED}")
set_target_properties(tacopie_example PROPERTIES COMPILE_DEFINITIONS "__TACOPIE_LOGGING_ENABLED=${LOGGING_ENABLED}")
ENDIF (LOGGING_ENABLED)
add_executable(logger logger.cpp)
target_link_libraries(logger cpp_http_server)
target_link_libraries(logger tacopie)
IF (LOGGING_ENABLED)
set_target_properties(logger PROPERTIES COMPILE_DEFINITIONS "__CPP_HTTP_SERVER_LOGGING_ENABLED=${LOGGING_ENABLED}")
set_target_properties(logger PROPERTIES COMPILE_DEFINITIONS "__TACOPIE_LOGGING_ENABLED=${LOGGING_ENABLED}")
ENDIF (LOGGING_ENABLED)
@@ -1,8 +1,8 @@
#include <cpp_http_server/cpp_http_server>
#include <tacopie/tacopie>
#include <iostream>
class my_logger : public cpp_http_server::logger_iface {
class my_logger : public tacopie::logger_iface {
public:
//! ctor & dtor
my_logger(void) = default;
@@ -40,30 +40,30 @@ main(void) {
//! By default, no logging
//! Force logger call, just for the example (you will never have to do that by yourself)
std::cout << "By default: no logging" << std::endl;
__CPP_HTTP_SERVER_LOG(debug, "This is a debug message");
__CPP_HTTP_SERVER_LOG(info, "This is an info message");
__CPP_HTTP_SERVER_LOG(warn, "This is a warn message");
__CPP_HTTP_SERVER_LOG(error, "This is an error message");
__TACOPIE_LOG(debug, "This is a debug message");
__TACOPIE_LOG(info, "This is an info message");
__TACOPIE_LOG(warn, "This is a warn message");
__TACOPIE_LOG(error, "This is an error message");
std::cout << std::endl;
//! Use the default logger, provided with the library
cpp_http_server::active_logger = std::unique_ptr<cpp_http_server::logger>(new cpp_http_server::logger(cpp_http_server::logger::log_level::debug));
tacopie::active_logger = std::unique_ptr<tacopie::logger>(new tacopie::logger(tacopie::logger::log_level::debug));
//! Force logger call, just for the example (you will never have to do that by yourself)
std::cout << "With the library provided logger" << std::endl;
__CPP_HTTP_SERVER_LOG(debug, "This is a debug message");
__CPP_HTTP_SERVER_LOG(info, "This is an info message");
__CPP_HTTP_SERVER_LOG(warn, "This is a warn message");
__CPP_HTTP_SERVER_LOG(error, "This is an error message");
__TACOPIE_LOG(debug, "This is a debug message");
__TACOPIE_LOG(info, "This is an info message");
__TACOPIE_LOG(warn, "This is a warn message");
__TACOPIE_LOG(error, "This is an error message");
std::cout << std::endl;
//! Use your custom logger
cpp_http_server::active_logger = std::unique_ptr<my_logger>(new my_logger);
tacopie::active_logger = std::unique_ptr<my_logger>(new my_logger);
//! Force logger call, just for the example (you will never have to do that by yourself)
std::cout << "With an example of custom logger" << std::endl;
__CPP_HTTP_SERVER_LOG(debug, "This is a debug message");
__CPP_HTTP_SERVER_LOG(info, "This is an info message");
__CPP_HTTP_SERVER_LOG(warn, "This is a warn message");
__CPP_HTTP_SERVER_LOG(error, "This is an error message");
__TACOPIE_LOG(debug, "This is a debug message");
__TACOPIE_LOG(info, "This is an info message");
__TACOPIE_LOG(warn, "This is a warn message");
__TACOPIE_LOG(error, "This is an error message");
std::cout << std::endl;
return 0;
@@ -1,4 +1,4 @@
#include <cpp_http_server/cpp_http_server>
#include <tacopie/tacopie>
#include <signal.h>
@@ -12,9 +12,9 @@ signint_handler(int) {
int
main(void) {
//! enable logging
cpp_http_server::active_logger = std::unique_ptr<cpp_http_server::logger>(new cpp_http_server::logger(cpp_http_server::logger::log_level::debug));
tacopie::active_logger = std::unique_ptr<tacopie::logger>(new tacopie::logger(tacopie::logger::log_level::debug));
cpp_http_server::network::tcp_server s;
tacopie::network::tcp_server s;
s.start("127.0.0.1", 3000);
signal(SIGINT, &signint_handler);

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -4,7 +4,7 @@
#include <stdexcept>
#include <string>
namespace cpp_http_server {
namespace tacopie {
class error : public std::runtime_error {
public:
@@ -27,7 +27,7 @@ class error : public std::runtime_error {
std::uint32_t m_line;
};
} //! cpp_http_server
} //! tacopie
//! macro for convenience
#define __CPP_HTTP_SERVER_THROW(what) throw cpp_http_server::error(what, __FILE__, __LINE__);
#define __TACOPIE_THROW(what) throw tacopie::error(what, __FILE__, __LINE__);
@@ -4,7 +4,7 @@
#include <mutex>
#include <string>
namespace cpp_http_server {
namespace tacopie {
//! logger_iface
//! should be inherited by any class intended to be used for logging
@@ -67,10 +67,10 @@ void warn(const std::string& msg, const std::string& file, std::size_t line);
void error(const std::string& msg, const std::string& file, std::size_t line);
//! convenience macro to log with file and line information
#ifdef __CPP_HTTP_SERVER_LOGGING_ENABLED
#define __CPP_HTTP_SERVER_LOG(level, msg) cpp_http_server::level(msg, __FILE__, __LINE__);
#ifdef __TACOPIE_LOGGING_ENABLED
#define __TACOPIE_LOG(level, msg) tacopie::level(msg, __FILE__, __LINE__);
#else
#define __CPP_HTTP_SERVER_LOG(level, msg)
#endif /* __CPP_HTTP_SERVER_LOGGING_ENABLED */
#define __TACOPIE_LOG(level, msg)
#endif /* __TACOPIE_LOGGING_ENABLED */
} //! cpp_http_server
} //! tacopie
@@ -11,12 +11,12 @@
#include <poll.h>
#include <cpp_http_server/network/tcp_socket.hpp>
#include <cpp_http_server/utils/thread_pool.hpp>
#include <tacopie/network/tcp_socket.hpp>
#include <tacopie/utils/thread_pool.hpp>
#define __CPP_HTTP_SERVER_IO_SERVICE_NB_WORKERS 1
#define __TACOPIE_IO_SERVICE_NB_WORKERS 1
namespace cpp_http_server {
namespace tacopie {
namespace network {
@@ -110,4 +110,4 @@ void set_default_io_service(const std::shared_ptr<io_service>&);
} //! network
} //! cpp_http_server
} //! tacopie
Oops, something went wrong.

0 comments on commit 8618ccd

Please sign in to comment.