diff --git a/CMakeLists.txt b/CMakeLists.txt index c092cb8..f3b7e8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 3.0) -project(csoap) +project(webcc) -option(CSOAP_ENABLE_SOAP "Enable SOAP support (need PugiXml)?" ON) -option(CSOAP_ENABLE_UT "Enable unit test?" OFF) +option(WEBCC_ENABLE_SOAP "Enable SOAP support (need PugiXml)?" ON) +option(WEBCC_ENABLE_UT "Enable unit test?" ON) +option(WEBCC_ENABLE_DEMO "Enable demo programs?" ON) -if(CSOAP_ENABLE_SOAP) - add_definitions(-DCSOAP_ENABLE_SOAP) +if(WEBCC_ENABLE_SOAP) + add_definitions(-DWEBCC_ENABLE_SOAP) endif() -if(CSOAP_ENABLE_UT) +if(WEBCC_ENABLE_UT) enable_testing() endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b058edb..8f8d541 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,13 @@ -if(CSOAP_ENABLE_UT) +if(WEBCC_ENABLE_UT) add_subdirectory(gtest) - add_subdirectory(csoap_unittest) + add_subdirectory(webcc_unittest) endif() add_subdirectory(pugixml) -add_subdirectory(csoap) +add_subdirectory(webcc) -add_subdirectory(demo/soap/calc_client) -add_subdirectory(demo/soap/calc_server) +if(WEBCC_ENABLE_DEMO) + add_subdirectory(demo/soap/calc_client) + add_subdirectory(demo/soap/calc_server) +endif() \ No newline at end of file diff --git a/src/csoap/CMakeLists.txt b/src/csoap/CMakeLists.txt deleted file mode 100644 index e75e180..0000000 --- a/src/csoap/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -if(UNIX) - add_definitions(-D_GLIBCXX_USE_WCHAR_T -std=c++11) -endif() - -option(CSOAP_DEBUG_OUTPUT "Enable debug output?" OFF) - -if(CSOAP_DEBUG_OUTPUT) - add_definitions(-DCSOAP_DEBUG_OUTPUT) -endif() - -# Don't use any deprecated definitions (e.g., io_service). -add_definitions(-DBOOST_ASIO_NO_DEPRECATED) - -file(GLOB SRCS *.cc *.h) - -add_library(csoap ${SRCS}) diff --git a/src/demo/soap/calc_client/CMakeLists.txt b/src/demo/soap/calc_client/CMakeLists.txt index 613a409..9f4289b 100644 --- a/src/demo/soap/calc_client/CMakeLists.txt +++ b/src/demo/soap/calc_client/CMakeLists.txt @@ -2,4 +2,4 @@ file(GLOB SRCS *.cc *.h) add_executable(soap_calc_client ${SRCS}) -target_link_libraries(soap_calc_client csoap pugixml) +target_link_libraries(soap_calc_client webcc pugixml) diff --git a/src/demo/soap/calc_client/calc_client.cc b/src/demo/soap/calc_client/calc_client.cc index 735739f..886b745 100644 --- a/src/demo/soap/calc_client/calc_client.cc +++ b/src/demo/soap/calc_client/calc_client.cc @@ -22,7 +22,7 @@ bool CalcClient::Divide(double x, double y, double* result) { return Calc("divide", "numerator", "denominator", x, y, result); } -// Set to 0 to test our own calculator server created with csoap. +// Set to 0 to test our own calculator server created with webcc. #define ACCESS_PARASOFT 0 void CalcClient::Init() { @@ -48,19 +48,19 @@ bool CalcClient::Calc(const std::string& operation, double y, double* result) { // Prepare parameters. - std::vector parameters{ + std::vector parameters{ { x_name, x }, { y_name, y } }; // Make the call. std::string result_str; - csoap::Error error = Call(operation, std::move(parameters), &result_str); + webcc::Error error = Call(operation, std::move(parameters), &result_str); // Error handling if any. - if (error != csoap::kNoError) { + if (error != webcc::kNoError) { std::cerr << "Error: " << error; - std::cerr << ", " << csoap::GetErrorMessage(error) << std::endl; + std::cerr << ", " << webcc::GetErrorMessage(error) << std::endl; return false; } diff --git a/src/demo/soap/calc_client/calc_client.h b/src/demo/soap/calc_client/calc_client.h index 8a8283f..a8cb6ac 100644 --- a/src/demo/soap/calc_client/calc_client.h +++ b/src/demo/soap/calc_client/calc_client.h @@ -2,9 +2,9 @@ #define CALC_CLIENT_H_ #include -#include "csoap/soap_client.h" +#include "webcc/soap_client.h" -class CalcClient : public csoap::SoapClient { +class CalcClient : public webcc::SoapClient { public: CalcClient(); diff --git a/src/demo/soap/calc_server/CMakeLists.txt b/src/demo/soap/calc_server/CMakeLists.txt index a8bf025..b0e0feb 100644 --- a/src/demo/soap/calc_server/CMakeLists.txt +++ b/src/demo/soap/calc_server/CMakeLists.txt @@ -2,4 +2,4 @@ file(GLOB SRCS *.cc *.h) add_executable(soap_calc_server ${SRCS}) -target_link_libraries(soap_calc_server csoap pugixml) +target_link_libraries(soap_calc_server webcc pugixml) diff --git a/src/demo/soap/calc_server/calc_service.cc b/src/demo/soap/calc_server/calc_service.cc index 2fa9b64..5d0930c 100644 --- a/src/demo/soap/calc_server/calc_service.cc +++ b/src/demo/soap/calc_server/calc_service.cc @@ -2,11 +2,11 @@ #include "boost/lexical_cast.hpp" -#include "csoap/soap_request.h" -#include "csoap/soap_response.h" +#include "webcc/soap_request.h" +#include "webcc/soap_response.h" -bool CalcService::Handle(const csoap::SoapRequest& soap_request, - csoap::SoapResponse* soap_response) { +bool CalcService::Handle(const webcc::SoapRequest& soap_request, + webcc::SoapResponse* soap_response) { try { if (soap_request.operation() == "add") { double x = boost::lexical_cast(soap_request.GetParameter("x")); @@ -14,7 +14,7 @@ bool CalcService::Handle(const csoap::SoapRequest& soap_request, double result = x + y; - soap_response->set_soapenv_ns(csoap::kSoapEnvNamespace); + soap_response->set_soapenv_ns(webcc::kSoapEnvNamespace); soap_response->set_service_ns({ "cal", "http://www.example.com/calculator/" diff --git a/src/demo/soap/calc_server/calc_service.h b/src/demo/soap/calc_server/calc_service.h index 0d5f0f4..4fcf0bf 100644 --- a/src/demo/soap/calc_server/calc_service.h +++ b/src/demo/soap/calc_server/calc_service.h @@ -1,15 +1,15 @@ #ifndef CALC_SERVICE_H_ #define CALC_SERVICE_H_ -#include "csoap/soap_service.h" +#include "webcc/soap_service.h" -class CalcService : public csoap::SoapService { +class CalcService : public webcc::SoapService { public: CalcService() = default; ~CalcService() override = default; - bool Handle(const csoap::SoapRequest& soap_request, - csoap::SoapResponse* soap_response) override; + bool Handle(const webcc::SoapRequest& soap_request, + webcc::SoapResponse* soap_response) override; }; #endif // CALC_SERVICE_H_ diff --git a/src/demo/soap/calc_server/main.cc b/src/demo/soap/calc_server/main.cc index 9042a90..e1ac657 100644 --- a/src/demo/soap/calc_server/main.cc +++ b/src/demo/soap/calc_server/main.cc @@ -1,5 +1,5 @@ #include -#include "csoap/soap_server.h" +#include "webcc/soap_server.h" #include "calc_service.h" static void Help(const char* argv0) { @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) { std::size_t workers = 2; try { - csoap::SoapServer server(port, workers); + webcc::SoapServer server(port, workers); server.RegisterService(std::make_shared(), "/calculator"); diff --git a/src/webcc/CMakeLists.txt b/src/webcc/CMakeLists.txt new file mode 100644 index 0000000..3cc237e --- /dev/null +++ b/src/webcc/CMakeLists.txt @@ -0,0 +1,12 @@ +option(WEBCC_DEBUG_OUTPUT "Enable debug output?" OFF) + +if(WEBCC_DEBUG_OUTPUT) + add_definitions(-DWEBCC_DEBUG_OUTPUT) +endif() + +# Don't use any deprecated definitions (e.g., io_service). +add_definitions(-DBOOST_ASIO_NO_DEPRECATED) + +file(GLOB SRCS *.cc *.h) + +add_library(webcc ${SRCS}) diff --git a/src/csoap/common.cc b/src/webcc/common.cc similarity index 97% rename from src/csoap/common.cc rename to src/webcc/common.cc index 5cc0578..d0014c3 100644 --- a/src/csoap/common.cc +++ b/src/webcc/common.cc @@ -1,6 +1,6 @@ -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { // NOTE: // Field names are case-insensitive. @@ -103,4 +103,4 @@ Parameter& Parameter::operator=(Parameter&& rhs) { return *this; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/common.h b/src/webcc/common.h similarity index 97% rename from src/csoap/common.h rename to src/webcc/common.h index a87e7f8..cee918a 100644 --- a/src/csoap/common.h +++ b/src/webcc/common.h @@ -1,12 +1,12 @@ -#ifndef CSOAP_COMMON_H_ -#define CSOAP_COMMON_H_ +#ifndef WEBCC_COMMON_H_ +#define WEBCC_COMMON_H_ // Common definitions. #include #include -namespace csoap { +namespace webcc { //////////////////////////////////////////////////////////////////////////////// @@ -155,6 +155,6 @@ private: std::string value_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_COMMON_H_ +#endif // WEBCC_COMMON_H_ diff --git a/src/csoap/http_client.cc b/src/webcc/http_client.cc similarity index 91% rename from src/csoap/http_client.cc rename to src/webcc/http_client.cc index 7f67538..49886eb 100644 --- a/src/csoap/http_client.cc +++ b/src/webcc/http_client.cc @@ -1,6 +1,6 @@ -#include "csoap/http_client.h" +#include "webcc/http_client.h" -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif @@ -13,11 +13,11 @@ #include "boost/asio/write.hpp" #endif -#include "csoap/http_response_parser.h" -#include "csoap/http_request.h" -#include "csoap/http_response.h" +#include "webcc/http_response_parser.h" +#include "webcc/http_request.h" +#include "webcc/http_response.h" -namespace csoap { +namespace webcc { //////////////////////////////////////////////////////////////////////////////// @@ -82,7 +82,7 @@ Error HttpClient::SendRequest(const HttpRequest& request, // Send HTTP request. -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "# REQUEST" << std::endl << request << std::endl; #endif @@ -92,7 +92,7 @@ Error HttpClient::SendRequest(const HttpRequest& request, return kSocketWriteError; } -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "# RESPONSE" << std::endl; #endif @@ -114,7 +114,7 @@ Error HttpClient::SendRequest(const HttpRequest& request, } } -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT // NOTE: the content XML might not be well formated. std::cout.write(buffer_.data(), length); #endif @@ -129,7 +129,7 @@ Error HttpClient::SendRequest(const HttpRequest& request, } } -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << std::endl; std::cout << "# RESPONSE (PARSED)" << std::endl; std::cout << *response << std::endl; @@ -138,4 +138,4 @@ Error HttpClient::SendRequest(const HttpRequest& request, return kNoError; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_client.h b/src/webcc/http_client.h similarity index 77% rename from src/csoap/http_client.h rename to src/webcc/http_client.h index d8a973e..4821318 100644 --- a/src/csoap/http_client.h +++ b/src/webcc/http_client.h @@ -1,13 +1,13 @@ -#ifndef CSOAP_HTTP_CLIENT_H_ -#define CSOAP_HTTP_CLIENT_H_ +#ifndef WEBCC_HTTP_CLIENT_H_ +#define WEBCC_HTTP_CLIENT_H_ #include #include "boost/asio/io_context.hpp" -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { class HttpRequest; class HttpResponse; @@ -31,6 +31,6 @@ private: int timeout_seconds_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_CLIENT_H_ +#endif // WEBCC_HTTP_CLIENT_H_ diff --git a/src/csoap/http_message.cc b/src/webcc/http_message.cc similarity index 76% rename from src/csoap/http_message.cc rename to src/webcc/http_message.cc index f01ec4f..97240cb 100644 --- a/src/csoap/http_message.cc +++ b/src/webcc/http_message.cc @@ -1,6 +1,6 @@ -#include "csoap/http_message.h" +#include "webcc/http_message.h" -namespace csoap { +namespace webcc { void HttpMessage::SetHeader(const std::string& name, const std::string& value) { for (HttpHeader& h : headers_) { @@ -13,4 +13,4 @@ void HttpMessage::SetHeader(const std::string& name, const std::string& value) { headers_.push_back({ name, value }); } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_message.h b/src/webcc/http_message.h similarity index 91% rename from src/csoap/http_message.h rename to src/webcc/http_message.h index 81defc5..1b2ee7e 100644 --- a/src/csoap/http_message.h +++ b/src/webcc/http_message.h @@ -1,11 +1,11 @@ -#ifndef CSOAP_HTTP_MESSAGE_H_ -#define CSOAP_HTTP_MESSAGE_H_ +#ifndef WEBCC_HTTP_MESSAGE_H_ +#define WEBCC_HTTP_MESSAGE_H_ #include #include -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { class HttpHeader { public: @@ -81,6 +81,6 @@ protected: std::string content_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_MESSAGE_H_ +#endif // WEBCC_HTTP_MESSAGE_H_ diff --git a/src/csoap/http_parser.cc b/src/webcc/http_parser.cc similarity index 95% rename from src/csoap/http_parser.cc rename to src/webcc/http_parser.cc index 752f9de..53268e9 100644 --- a/src/csoap/http_parser.cc +++ b/src/webcc/http_parser.cc @@ -1,11 +1,11 @@ -#include "csoap/http_parser.h" +#include "webcc/http_parser.h" #include "boost/algorithm/string.hpp" #include "boost/lexical_cast.hpp" -#include "csoap/http_message.h" +#include "webcc/http_message.h" -namespace csoap { +namespace webcc { HttpParser::HttpParser(HttpMessage* message) : message_(message) @@ -107,4 +107,4 @@ void HttpParser::ParseContentLength(const std::string& line) { } } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_parser.h b/src/webcc/http_parser.h similarity index 80% rename from src/csoap/http_parser.h rename to src/webcc/http_parser.h index ba6a5c0..c50529d 100644 --- a/src/csoap/http_parser.h +++ b/src/webcc/http_parser.h @@ -1,10 +1,10 @@ -#ifndef CSOAP_HTTP_PARSER_H_ -#define CSOAP_HTTP_PARSER_H_ +#ifndef WEBCC_HTTP_PARSER_H_ +#define WEBCC_HTTP_PARSER_H_ #include -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { class HttpMessage; @@ -40,6 +40,6 @@ protected: bool finished_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_PARSER_H_ +#endif // WEBCC_HTTP_PARSER_H_ diff --git a/src/csoap/http_request.cc b/src/webcc/http_request.cc similarity index 95% rename from src/csoap/http_request.cc rename to src/webcc/http_request.cc index e6d160a..005c9af 100644 --- a/src/csoap/http_request.cc +++ b/src/webcc/http_request.cc @@ -1,8 +1,8 @@ -#include "csoap/http_request.h" +#include "webcc/http_request.h" #include "boost/algorithm/string.hpp" -namespace csoap { +namespace webcc { std::ostream& operator<<(std::ostream& os, const HttpRequest& request) { os << request.start_line(); @@ -68,4 +68,4 @@ std::vector HttpRequest::ToBuffers() const { return buffers; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_request.h b/src/webcc/http_request.h similarity index 91% rename from src/csoap/http_request.h rename to src/webcc/http_request.h index 30499c1..22025e7 100644 --- a/src/csoap/http_request.h +++ b/src/webcc/http_request.h @@ -1,11 +1,11 @@ -#ifndef CSOAP_HTTP_REQUEST_H_ -#define CSOAP_HTTP_REQUEST_H_ +#ifndef WEBCC_HTTP_REQUEST_H_ +#define WEBCC_HTTP_REQUEST_H_ #include #include "boost/asio/buffer.hpp" // for const_buffer -#include "csoap/http_message.h" +#include "webcc/http_message.h" -namespace csoap { +namespace webcc { class HttpRequest; @@ -73,6 +73,6 @@ private: std::string port_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_REQUEST_H_ +#endif // WEBCC_HTTP_REQUEST_H_ diff --git a/src/csoap/http_request_handler.cc b/src/webcc/http_request_handler.cc similarity index 79% rename from src/csoap/http_request_handler.cc rename to src/webcc/http_request_handler.cc index 2704e0c..5c61114 100644 --- a/src/csoap/http_request_handler.cc +++ b/src/webcc/http_request_handler.cc @@ -1,16 +1,16 @@ -#include "csoap/http_request_handler.h" +#include "webcc/http_request_handler.h" #include -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif -#include "csoap/common.h" -#include "csoap/http_request.h" -#include "csoap/http_response.h" +#include "webcc/common.h" +#include "webcc/http_request.h" +#include "webcc/http_response.h" -namespace csoap { +namespace webcc { void HttpRequestHandler::Enqueue(HttpSessionPtr session) { queue_.Push(session); @@ -20,25 +20,25 @@ void HttpRequestHandler::Start(std::size_t count) { assert(count > 0 && workers_.size() == 0); for (std::size_t i = 0; i < count; ++i) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT boost::thread* worker = #endif workers_.create_thread(std::bind(&HttpRequestHandler::WorkerRoutine, this)); -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "Worker is running (thread: " << worker->get_id() << ")\n"; #endif } } void HttpRequestHandler::Stop() { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "Stopping workers...\n"; #endif // Close pending sessions. for (HttpSessionPtr conn = queue_.Pop(); conn; conn = queue_.Pop()) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "Closing pending session...\n"; #endif conn->Stop(); @@ -49,13 +49,13 @@ void HttpRequestHandler::Stop() { workers_.join_all(); -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "All workers have been stopped.\n"; #endif } void HttpRequestHandler::WorkerRoutine() { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT boost::thread::id thread_id = boost::this_thread::get_id(); #endif @@ -63,7 +63,7 @@ void HttpRequestHandler::WorkerRoutine() { HttpSessionPtr session = queue_.PopOrWait(); if (!session) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "Worker is going to stop (thread: " << thread_id << ")\n"; #endif // For stopping next worker. @@ -77,4 +77,4 @@ void HttpRequestHandler::WorkerRoutine() { } } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_request_handler.h b/src/webcc/http_request_handler.h similarity index 77% rename from src/csoap/http_request_handler.h rename to src/webcc/http_request_handler.h index 362f4c5..720dcae 100644 --- a/src/csoap/http_request_handler.h +++ b/src/webcc/http_request_handler.h @@ -1,16 +1,16 @@ -#ifndef CSOAP_HTTP_REQUEST_HANDLER_H_ -#define CSOAP_HTTP_REQUEST_HANDLER_H_ +#ifndef WEBCC_HTTP_REQUEST_HANDLER_H_ +#define WEBCC_HTTP_REQUEST_HANDLER_H_ #include #include #include "boost/thread/thread.hpp" -#include "csoap/http_session.h" -#include "csoap/queue.h" -#include "csoap/soap_service.h" +#include "webcc/http_session.h" +#include "webcc/queue.h" +#include "webcc/soap_service.h" -namespace csoap { +namespace webcc { class HttpRequest; class HttpResponse; @@ -46,6 +46,6 @@ private: boost::thread_group workers_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_REQUEST_HANDLER_H_ +#endif // WEBCC_HTTP_REQUEST_HANDLER_H_ diff --git a/src/csoap/http_request_parser.cc b/src/webcc/http_request_parser.cc similarity index 70% rename from src/csoap/http_request_parser.cc rename to src/webcc/http_request_parser.cc index 1ad00c8..02e6525 100644 --- a/src/csoap/http_request_parser.cc +++ b/src/webcc/http_request_parser.cc @@ -1,11 +1,11 @@ -#include "csoap/http_request_parser.h" +#include "webcc/http_request_parser.h" #include #include "boost/algorithm/string.hpp" -#include "csoap/http_request.h" +#include "webcc/http_request.h" -namespace csoap { +namespace webcc { HttpRequestParser::HttpRequestParser(HttpRequest* request) : HttpParser(request), request_(request) { @@ -13,7 +13,7 @@ HttpRequestParser::HttpRequestParser(HttpRequest* request) Error HttpRequestParser::ParseStartLine(const std::string& line) { std::vector strs; - boost::split(strs, line, boost::is_any_of(" ")); + boost::split(strs, line, boost::is_any_of(" "), boost::token_compress_on); if (strs.size() != 3) { return kHttpStartLineError; @@ -27,4 +27,4 @@ Error HttpRequestParser::ParseStartLine(const std::string& line) { return kNoError; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_request_parser.h b/src/webcc/http_request_parser.h similarity index 56% rename from src/csoap/http_request_parser.h rename to src/webcc/http_request_parser.h index 53a7b62..ce34a88 100644 --- a/src/csoap/http_request_parser.h +++ b/src/webcc/http_request_parser.h @@ -1,9 +1,9 @@ -#ifndef CSOAP_HTTP_REQUEST_PARSER_H_ -#define CSOAP_HTTP_REQUEST_PARSER_H_ +#ifndef WEBCC_HTTP_REQUEST_PARSER_H_ +#define WEBCC_HTTP_REQUEST_PARSER_H_ -#include "csoap/http_parser.h" +#include "webcc/http_parser.h" -namespace csoap { +namespace webcc { class HttpRequest; @@ -18,6 +18,6 @@ private: HttpRequest* request_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_REQUEST_PARSER_H_ +#endif // WEBCC_HTTP_REQUEST_PARSER_H_ diff --git a/src/csoap/http_response.cc b/src/webcc/http_response.cc similarity index 96% rename from src/csoap/http_response.cc rename to src/webcc/http_response.cc index 38b1d5c..98d596c 100644 --- a/src/csoap/http_response.cc +++ b/src/webcc/http_response.cc @@ -1,9 +1,9 @@ -#include "csoap/http_response.h" +#include "webcc/http_response.h" -#include "csoap/common.h" -#include "csoap/xml.h" +#include "webcc/common.h" +#include "webcc/xml.h" -namespace csoap { +namespace webcc { std::ostream& operator<<(std::ostream& os, const HttpResponse& response) { os << response.start_line(); @@ -118,4 +118,4 @@ HttpResponse HttpResponse::Fault(HttpStatus::Enum status) { return response; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_response.h b/src/webcc/http_response.h similarity index 84% rename from src/csoap/http_response.h rename to src/webcc/http_response.h index 29b0364..ba3f221 100644 --- a/src/csoap/http_response.h +++ b/src/webcc/http_response.h @@ -1,11 +1,11 @@ -#ifndef CSOAP_HTTP_RESPONSE_H_ -#define CSOAP_HTTP_RESPONSE_H_ +#ifndef WEBCC_HTTP_RESPONSE_H_ +#define WEBCC_HTTP_RESPONSE_H_ #include #include "boost/asio/buffer.hpp" // for const_buffer -#include "csoap/http_message.h" +#include "webcc/http_message.h" -namespace csoap { +namespace webcc { class HttpResponse; @@ -38,6 +38,6 @@ private: int status_ = HttpStatus::kOK; // TODO: HttpStatus }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_RESPONSE_H_ +#endif // WEBCC_HTTP_RESPONSE_H_ diff --git a/src/csoap/http_response_parser.cc b/src/webcc/http_response_parser.cc similarity index 88% rename from src/csoap/http_response_parser.cc rename to src/webcc/http_response_parser.cc index 85bccb0..b3c7419 100644 --- a/src/csoap/http_response_parser.cc +++ b/src/webcc/http_response_parser.cc @@ -1,8 +1,8 @@ -#include "csoap/http_response_parser.h" +#include "webcc/http_response_parser.h" #include "boost/lexical_cast.hpp" -#include "csoap/http_response.h" +#include "webcc/http_response.h" -namespace csoap { +namespace webcc { HttpResponseParser::HttpResponseParser(HttpResponse* response) : HttpParser(response) @@ -46,4 +46,4 @@ Error HttpResponseParser::ParseStartLine(const std::string& line) { return kNoError; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_response_parser.h b/src/webcc/http_response_parser.h similarity index 63% rename from src/csoap/http_response_parser.h rename to src/webcc/http_response_parser.h index c6e6f51..4824c83 100644 --- a/src/csoap/http_response_parser.h +++ b/src/webcc/http_response_parser.h @@ -1,9 +1,9 @@ -#ifndef CSOAP_HTTP_RESPONSE_PARSER_H_ -#define CSOAP_HTTP_RESPONSE_PARSER_H_ +#ifndef WEBCC_HTTP_RESPONSE_PARSER_H_ +#define WEBCC_HTTP_RESPONSE_PARSER_H_ -#include "csoap/http_parser.h" +#include "webcc/http_parser.h" -namespace csoap { +namespace webcc { class HttpResponse; @@ -20,6 +20,6 @@ private: HttpResponse* response_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_RESPONSE_PARSER_H_ +#endif // WEBCC_HTTP_RESPONSE_PARSER_H_ diff --git a/src/csoap/http_server.cc b/src/webcc/http_server.cc similarity index 92% rename from src/csoap/http_server.cc rename to src/webcc/http_server.cc index 6997cac..226de10 100644 --- a/src/csoap/http_server.cc +++ b/src/webcc/http_server.cc @@ -1,18 +1,18 @@ -#include "csoap/http_server.h" +#include "webcc/http_server.h" #include -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif -#include "csoap/http_request_handler.h" -#include "csoap/soap_service.h" -#include "csoap/utility.h" +#include "webcc/http_request_handler.h" +#include "webcc/soap_service.h" +#include "webcc/utility.h" using tcp = boost::asio::ip::tcp; -namespace csoap { +namespace webcc { HttpServer::HttpServer(unsigned short port, std::size_t workers) : signals_(io_context_) @@ -49,7 +49,7 @@ HttpServer::~HttpServer() { void HttpServer::Run() { assert(request_handler_ != NULL); -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT boost::thread::id thread_id = boost::this_thread::get_id(); std::cout << "Server main thread: " << thread_id << std::endl; #endif @@ -95,4 +95,4 @@ void HttpServer::DoAwaitStop() { }); } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_server.h b/src/webcc/http_server.h similarity index 88% rename from src/csoap/http_server.h rename to src/webcc/http_server.h index 1cac77a..490ceb9 100644 --- a/src/csoap/http_server.h +++ b/src/webcc/http_server.h @@ -1,5 +1,5 @@ -#ifndef CSOAP_HTTP_SERVER_H_ -#define CSOAP_HTTP_SERVER_H_ +#ifndef WEBCC_HTTP_SERVER_H_ +#define WEBCC_HTTP_SERVER_H_ #include #include @@ -11,9 +11,9 @@ #include "boost/asio/signal_set.hpp" #include "boost/asio/ip/tcp.hpp" -#include "csoap/http_session.h" +#include "webcc/http_session.h" -namespace csoap { +namespace webcc { class HttpRequestHandler; @@ -57,6 +57,6 @@ private: boost::scoped_ptr acceptor_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_SERVER_H_ +#endif // WEBCC_HTTP_SERVER_H_ diff --git a/src/csoap/http_session.cc b/src/webcc/http_session.cc similarity index 94% rename from src/csoap/http_session.cc rename to src/webcc/http_session.cc index 06bb5fc..839aa42 100644 --- a/src/csoap/http_session.cc +++ b/src/webcc/http_session.cc @@ -1,15 +1,15 @@ -#include "csoap/http_session.h" +#include "webcc/http_session.h" #include -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif #include "boost/asio/write.hpp" -#include "csoap/http_request_handler.h" +#include "webcc/http_request_handler.h" -namespace csoap { +namespace webcc { HttpSession::HttpSession(boost::asio::ip::tcp::socket socket, HttpRequestHandler* handler) @@ -90,7 +90,7 @@ void HttpSession::HandleRead(boost::system::error_code ec, // ensured by Asio. void HttpSession::HandleWrite(boost::system::error_code ec, size_t length) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT boost::thread::id thread_id = boost::this_thread::get_id(); std::cout << "Response has been sent back (thread: " << thread_id << ")\n"; #endif @@ -106,4 +106,4 @@ void HttpSession::HandleWrite(boost::system::error_code ec, } } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/http_session.h b/src/webcc/http_session.h similarity index 85% rename from src/csoap/http_session.h rename to src/webcc/http_session.h index ea48862..73e78da 100644 --- a/src/csoap/http_session.h +++ b/src/webcc/http_session.h @@ -1,17 +1,17 @@ -#ifndef CSOAP_HTTP_SESSION_H_ -#define CSOAP_HTTP_SESSION_H_ +#ifndef WEBCC_HTTP_SESSION_H_ +#define WEBCC_HTTP_SESSION_H_ #include #include #include "boost/asio/ip/tcp.hpp" // for ip::tcp::socket -#include "csoap/common.h" -#include "csoap/http_request.h" -#include "csoap/http_request_parser.h" -#include "csoap/http_response.h" +#include "webcc/common.h" +#include "webcc/http_request.h" +#include "webcc/http_request_parser.h" +#include "webcc/http_response.h" -namespace csoap { +namespace webcc { class HttpRequestHandler; @@ -77,6 +77,6 @@ private: typedef std::shared_ptr HttpSessionPtr; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_HTTP_SESSION_H_ +#endif // WEBCC_HTTP_SESSION_H_ diff --git a/src/csoap/queue.h b/src/webcc/queue.h similarity index 90% rename from src/csoap/queue.h rename to src/webcc/queue.h index 8018369..057f6de 100644 --- a/src/csoap/queue.h +++ b/src/webcc/queue.h @@ -1,5 +1,5 @@ -#ifndef CSOAP_QUEUE_H_ -#define CSOAP_QUEUE_H_ +#ifndef WEBCC_QUEUE_H_ +#define WEBCC_QUEUE_H_ // A general message queue. @@ -10,7 +10,7 @@ #include "boost/thread/locks.hpp" #include "boost/thread/mutex.hpp" -namespace csoap { +namespace webcc { template class Queue { @@ -57,6 +57,6 @@ private: boost::condition_variable not_empty_cv_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_QUEUE_H_ +#endif // WEBCC_QUEUE_H_ diff --git a/src/csoap/rest_server.cc b/src/webcc/rest_server.cc similarity index 94% rename from src/csoap/rest_server.cc rename to src/webcc/rest_server.cc index e4bd1f0..c0b454c 100644 --- a/src/csoap/rest_server.cc +++ b/src/webcc/rest_server.cc @@ -1,12 +1,12 @@ -#include "csoap/rest_server.h" +#include "webcc/rest_server.h" -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif -#include "csoap/url.h" +#include "webcc/url.h" -namespace csoap { +namespace webcc { //////////////////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ bool RestServiceManager::AddService(RestServicePtr service, return true; } catch (std::regex_error& e) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << e.what() << std::endl; #endif } @@ -76,7 +76,7 @@ HttpStatus::Enum RestRequestHandler::HandleSession(HttpSessionPtr session) { std::vector sub_matches; RestServicePtr service = service_manager_.GetService(url.path(), &sub_matches); if (!service) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "No service matches the URL: " << url.path() << std::endl; #endif session->SetResponseStatus(HttpStatus::kBadRequest); @@ -117,4 +117,4 @@ bool RestServer::RegisterService(RestServicePtr service, return rest_request_handler_->RegisterService(service, url); } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/rest_server.h b/src/webcc/rest_server.h similarity index 92% rename from src/csoap/rest_server.h rename to src/webcc/rest_server.h index 3609e06..2e2499c 100644 --- a/src/csoap/rest_server.h +++ b/src/webcc/rest_server.h @@ -1,5 +1,5 @@ -#ifndef CSOAP_REST_SERVER_H_ -#define CSOAP_REST_SERVER_H_ +#ifndef WEBCC_REST_SERVER_H_ +#define WEBCC_REST_SERVER_H_ // HTTP server handling REST requests. @@ -7,11 +7,11 @@ #include #include -#include "csoap/http_request_handler.h" -#include "csoap/http_server.h" -#include "csoap/rest_service.h" +#include "webcc/http_request_handler.h" +#include "webcc/http_server.h" +#include "webcc/rest_service.h" -namespace csoap { +namespace webcc { class Url; @@ -100,6 +100,6 @@ private: RestRequestHandler* rest_request_handler_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_REST_SERVER_H_ +#endif // WEBCC_REST_SERVER_H_ diff --git a/src/csoap/rest_service.h b/src/webcc/rest_service.h similarity index 75% rename from src/csoap/rest_service.h rename to src/webcc/rest_service.h index 3dcbcc6..0c32dad 100644 --- a/src/csoap/rest_service.h +++ b/src/webcc/rest_service.h @@ -1,12 +1,12 @@ -#ifndef CSOAP_REST_SERVICE_H_ -#define CSOAP_REST_SERVICE_H_ +#ifndef WEBCC_REST_SERVICE_H_ +#define WEBCC_REST_SERVICE_H_ #include #include -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { // Base class for your REST service. class RestService { @@ -24,6 +24,6 @@ public: typedef std::shared_ptr RestServicePtr; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_REST_SERVICE_H_ +#endif // WEBCC_REST_SERVICE_H_ diff --git a/src/csoap/soap_client.cc b/src/webcc/soap_client.cc similarity index 86% rename from src/csoap/soap_client.cc rename to src/webcc/soap_client.cc index dec0f34..bf20ffd 100644 --- a/src/csoap/soap_client.cc +++ b/src/webcc/soap_client.cc @@ -1,14 +1,14 @@ -#include "csoap/soap_client.h" +#include "webcc/soap_client.h" #include -#include "csoap/http_client.h" -#include "csoap/http_request.h" -#include "csoap/http_response.h" -#include "csoap/soap_request.h" -#include "csoap/soap_response.h" +#include "webcc/http_client.h" +#include "webcc/http_request.h" +#include "webcc/http_response.h" +#include "webcc/soap_request.h" +#include "webcc/soap_response.h" -namespace csoap { +namespace webcc { Error SoapClient::Call(const std::string& operation, std::vector&& parameters, @@ -68,4 +68,4 @@ Error SoapClient::Call(const std::string& operation, return kNoError; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/soap_client.h b/src/webcc/soap_client.h similarity index 83% rename from src/csoap/soap_client.h rename to src/webcc/soap_client.h index cf7b0cb..5f4305c 100644 --- a/src/csoap/soap_client.h +++ b/src/webcc/soap_client.h @@ -1,12 +1,12 @@ -#ifndef CSOAP_SOAP_CLIENT_H_ -#define CSOAP_SOAP_CLIENT_H_ +#ifndef WEBCC_SOAP_CLIENT_H_ +#define WEBCC_SOAP_CLIENT_H_ #include #include -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { // Base class for your SOAP client. // Set URL, host, port, etc. in your sub-class before make the call. @@ -41,6 +41,6 @@ protected: std::string result_name_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_CLIENT_H_ +#endif // WEBCC_SOAP_CLIENT_H_ diff --git a/src/csoap/soap_message.cc b/src/webcc/soap_message.cc similarity index 93% rename from src/csoap/soap_message.cc rename to src/webcc/soap_message.cc index 9788a9c..02cdb42 100644 --- a/src/csoap/soap_message.cc +++ b/src/webcc/soap_message.cc @@ -1,9 +1,9 @@ -#include "csoap/soap_message.h" +#include "webcc/soap_message.h" #include -#include "csoap/xml.h" +#include "webcc/xml.h" -namespace csoap { +namespace webcc { void SoapMessage::ToXml(std::string* xml_string) { assert(soapenv_ns_.IsValid() && @@ -51,4 +51,4 @@ bool SoapMessage::FromXml(const std::string& xml_string) { return false; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/soap_message.h b/src/webcc/soap_message.h similarity index 86% rename from src/csoap/soap_message.h rename to src/webcc/soap_message.h index 0197c85..ca2be7e 100644 --- a/src/csoap/soap_message.h +++ b/src/webcc/soap_message.h @@ -1,11 +1,11 @@ -#ifndef CSOAP_SOAP_MESSAGE_H_ -#define CSOAP_SOAP_MESSAGE_H_ +#ifndef WEBCC_SOAP_MESSAGE_H_ +#define WEBCC_SOAP_MESSAGE_H_ #include #include "pugixml/pugixml.hpp" -#include "csoap/common.h" +#include "webcc/common.h" -namespace csoap { +namespace webcc { // Base class for SOAP request and response. class SoapMessage { @@ -50,6 +50,6 @@ protected: std::string operation_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_MESSAGE_H_ +#endif // WEBCC_SOAP_MESSAGE_H_ diff --git a/src/csoap/soap_request.cc b/src/webcc/soap_request.cc similarity index 93% rename from src/csoap/soap_request.cc rename to src/webcc/soap_request.cc index 53c953a..92b0c4f 100644 --- a/src/csoap/soap_request.cc +++ b/src/webcc/soap_request.cc @@ -1,7 +1,7 @@ -#include "csoap/soap_request.h" -#include "csoap/xml.h" +#include "webcc/soap_request.h" +#include "webcc/xml.h" -namespace csoap { +namespace webcc { void SoapRequest::AddParameter(const Parameter& parameter) { parameters_.push_back(parameter); @@ -54,4 +54,4 @@ bool SoapRequest::FromXmlBody(pugi::xml_node xbody) { return true; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/soap_request.h b/src/webcc/soap_request.h similarity index 76% rename from src/csoap/soap_request.h rename to src/webcc/soap_request.h index d081aeb..ccfd20a 100644 --- a/src/csoap/soap_request.h +++ b/src/webcc/soap_request.h @@ -1,10 +1,10 @@ -#ifndef CSOAP_SOAP_REQUEST_H_ -#define CSOAP_SOAP_REQUEST_H_ +#ifndef WEBCC_SOAP_REQUEST_H_ +#define WEBCC_SOAP_REQUEST_H_ #include -#include "csoap/soap_message.h" +#include "webcc/soap_message.h" -namespace csoap { +namespace webcc { // SOAP request. // Used to compose the SOAP request envelope XML which will be sent as the HTTP @@ -26,6 +26,6 @@ private: std::vector parameters_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_REQUEST_H_ +#endif // WEBCC_SOAP_REQUEST_H_ diff --git a/src/csoap/soap_response.cc b/src/webcc/soap_response.cc similarity index 89% rename from src/csoap/soap_response.cc rename to src/webcc/soap_response.cc index 061209c..b66f2e9 100644 --- a/src/csoap/soap_response.cc +++ b/src/webcc/soap_response.cc @@ -1,9 +1,9 @@ -#include "csoap/soap_response.h" +#include "webcc/soap_response.h" #include -#include "csoap/xml.h" +#include "webcc/xml.h" -namespace csoap { +namespace webcc { void SoapResponse::ToXmlBody(pugi::xml_node xbody) { std::string rsp_operation = operation_ + "Response"; @@ -32,4 +32,4 @@ bool SoapResponse::FromXmlBody(pugi::xml_node xbody) { return false; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/soap_response.h b/src/webcc/soap_response.h similarity index 85% rename from src/csoap/soap_response.h rename to src/webcc/soap_response.h index 59dc14b..226fd6f 100644 --- a/src/csoap/soap_response.h +++ b/src/webcc/soap_response.h @@ -1,9 +1,9 @@ -#ifndef CSOAP_SOAP_RESPONSE_H_ -#define CSOAP_SOAP_RESPONSE_H_ +#ifndef WEBCC_SOAP_RESPONSE_H_ +#define WEBCC_SOAP_RESPONSE_H_ -#include "csoap/soap_message.h" +#include "webcc/soap_message.h" -namespace csoap { +namespace webcc { // SOAP response. class SoapResponse : public SoapMessage { @@ -45,6 +45,6 @@ private: std::string result_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_RESPONSE_H_ +#endif // WEBCC_SOAP_RESPONSE_H_ diff --git a/src/csoap/soap_server.cc b/src/webcc/soap_server.cc similarity index 91% rename from src/csoap/soap_server.cc rename to src/webcc/soap_server.cc index c57824d..b24fbca 100644 --- a/src/csoap/soap_server.cc +++ b/src/webcc/soap_server.cc @@ -1,13 +1,13 @@ -#include "csoap/soap_server.h" +#include "webcc/soap_server.h" -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT #include #endif -#include "csoap/soap_request.h" -#include "csoap/soap_response.h" +#include "webcc/soap_request.h" +#include "webcc/soap_response.h" -namespace csoap { +namespace webcc { //////////////////////////////////////////////////////////////////////////////// @@ -55,13 +55,13 @@ SoapServicePtr SoapRequestHandler::GetServiceByUrl(const std::string& url) { UrlServiceMap::const_iterator it = url_service_map_.find(url); if (it != url_service_map_.end()) { -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "Service matches the URL: " << url << std::endl; #endif return it->second; } -#if CSOAP_DEBUG_OUTPUT +#if WEBCC_DEBUG_OUTPUT std::cout << "No service matches the URL: " << url << std::endl; #endif @@ -86,4 +86,4 @@ bool SoapServer::RegisterService(SoapServicePtr service, return soap_request_handler_->RegisterService(service, url); } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/soap_server.h b/src/webcc/soap_server.h similarity index 85% rename from src/csoap/soap_server.h rename to src/webcc/soap_server.h index 197f152..8b121a0 100644 --- a/src/csoap/soap_server.h +++ b/src/webcc/soap_server.h @@ -1,15 +1,15 @@ -#ifndef CSOAP_SOAP_SERVER_H_ -#define CSOAP_SOAP_SERVER_H_ +#ifndef WEBCC_SOAP_SERVER_H_ +#define WEBCC_SOAP_SERVER_H_ // HTTP server handling SOAP requests. #include #include -#include "csoap/http_request_handler.h" -#include "csoap/http_server.h" +#include "webcc/http_request_handler.h" +#include "webcc/http_server.h" -namespace csoap { +namespace webcc { //////////////////////////////////////////////////////////////////////////////// @@ -47,6 +47,6 @@ private: SoapRequestHandler* soap_request_handler_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_SERVER_H_ +#endif // WEBCC_SOAP_SERVER_H_ diff --git a/src/csoap/soap_service.h b/src/webcc/soap_service.h similarity index 73% rename from src/csoap/soap_service.h rename to src/webcc/soap_service.h index 70fc19d..f4e9eda 100644 --- a/src/csoap/soap_service.h +++ b/src/webcc/soap_service.h @@ -1,9 +1,9 @@ -#ifndef CSOAP_SOAP_SERVICE_H_ -#define CSOAP_SOAP_SERVICE_H_ +#ifndef WEBCC_SOAP_SERVICE_H_ +#define WEBCC_SOAP_SERVICE_H_ #include -namespace csoap { +namespace webcc { class SoapRequest; class SoapResponse; @@ -21,6 +21,6 @@ public: typedef std::shared_ptr SoapServicePtr; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_SOAP_SERVICE_H_ +#endif // WEBCC_SOAP_SERVICE_H_ diff --git a/src/csoap/url.cc b/src/webcc/url.cc similarity index 95% rename from src/csoap/url.cc rename to src/webcc/url.cc index 8ad9cd6..810e1bc 100644 --- a/src/csoap/url.cc +++ b/src/webcc/url.cc @@ -1,8 +1,8 @@ -#include "csoap/url.h" +#include "webcc/url.h" #include -namespace csoap { +namespace webcc { Url::Url(const std::string& str) { std::size_t pos = str.find('?'); @@ -73,4 +73,4 @@ Url::Query Url::SplitQuery(const std::string& query) { return result; } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/url.h b/src/webcc/url.h similarity index 89% rename from src/csoap/url.h rename to src/webcc/url.h index 9a6af62..d37bd3b 100644 --- a/src/csoap/url.h +++ b/src/webcc/url.h @@ -1,5 +1,5 @@ -#ifndef CSOAP_URL_H_ -#define CSOAP_URL_H_ +#ifndef WEBCC_URL_H_ +#define WEBCC_URL_H_ // A simplified implementation of URL (or URI). // The URL should start with "/". @@ -11,7 +11,7 @@ #include #include -namespace csoap { +namespace webcc { class Url { public: @@ -48,6 +48,6 @@ private: std::string query_; }; -} // namespace csoap +} // namespace webcc -#endif // CSOAP_URL_H_ +#endif // WEBCC_URL_H_ diff --git a/src/csoap/utility.cc b/src/webcc/utility.cc similarity index 90% rename from src/csoap/utility.cc rename to src/webcc/utility.cc index e77c2aa..4a3c2fe 100644 --- a/src/csoap/utility.cc +++ b/src/webcc/utility.cc @@ -1,9 +1,9 @@ -#include "csoap/utility.h" +#include "webcc/utility.h" #include using tcp = boost::asio::ip::tcp; -namespace csoap { +namespace webcc { // Print the resolved endpoints. // NOTE: Endpoint is one word, don't use "end point". @@ -25,4 +25,4 @@ void DumpEndpoints(tcp::resolver::results_type& endpoints) { } } -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/utility.h b/src/webcc/utility.h similarity index 63% rename from src/csoap/utility.h rename to src/webcc/utility.h index 1c37e21..1ff5e39 100644 --- a/src/csoap/utility.h +++ b/src/webcc/utility.h @@ -1,14 +1,14 @@ -#ifndef CSOAP_UTILITY_H_ -#define CSOAP_UTILITY_H_ +#ifndef WEBCC_UTILITY_H_ +#define WEBCC_UTILITY_H_ #include "boost/asio/ip/tcp.hpp" -namespace csoap { +namespace webcc { // Print the resolved endpoints. // NOTE: Endpoint is one word, don't use "end point". void DumpEndpoints(boost::asio::ip::tcp::resolver::results_type& endpoints); -} // namespace csoap +} // namespace webcc -#endif // CSOAP_UTILITY_H_ +#endif // WEBCC_UTILITY_H_ diff --git a/src/csoap/xml.cc b/src/webcc/xml.cc similarity index 97% rename from src/csoap/xml.cc rename to src/webcc/xml.cc index 28b235b..6b292c1 100644 --- a/src/csoap/xml.cc +++ b/src/webcc/xml.cc @@ -1,6 +1,6 @@ -#include "csoap/xml.h" +#include "webcc/xml.h" -namespace csoap { +namespace webcc { namespace xml { void SplitName(const pugi::xml_node& xnode, @@ -106,4 +106,4 @@ bool PrettyPrintXml(std::ostream& os, } } // namespace xml -} // namespace csoap +} // namespace webcc diff --git a/src/csoap/xml.h b/src/webcc/xml.h similarity index 96% rename from src/csoap/xml.h rename to src/webcc/xml.h index 7400c10..0608b38 100644 --- a/src/csoap/xml.h +++ b/src/webcc/xml.h @@ -1,12 +1,12 @@ -#ifndef CSOAP_XML_H_ -#define CSOAP_XML_H_ +#ifndef WEBCC_XML_H_ +#define WEBCC_XML_H_ // XML utilities. #include #include "pugixml/pugixml.hpp" -namespace csoap { +namespace webcc { namespace xml { // Split the node name into namespace prefix and real name. @@ -86,6 +86,6 @@ bool PrettyPrintXml(std::ostream& os, const char* indent = "\t"); } // namespace xml -} // namespace csoap +} // namespace webcc -#endif // CSOAP_XML_H_ +#endif // WEBCC_XML_H_ diff --git a/src/csoap_unittest/CMakeLists.txt b/src/webcc_unittest/CMakeLists.txt similarity index 100% rename from src/csoap_unittest/CMakeLists.txt rename to src/webcc_unittest/CMakeLists.txt diff --git a/src/csoap_unittest/rest_service_manager_test.cc b/src/webcc_unittest/rest_service_manager_test.cc similarity index 100% rename from src/csoap_unittest/rest_service_manager_test.cc rename to src/webcc_unittest/rest_service_manager_test.cc