Move rest stuff into nap subdir.

Nap is a quick REST. Silly joke really, but hey, 3 letters.
Great namespace name.
This commit is contained in:
King_DuckZ 2020-08-29 12:34:55 +01:00
parent 05c03c2daf
commit c4935ac70d
5 changed files with 11 additions and 11 deletions

View file

@ -103,8 +103,8 @@ executable(meson.project_name(),
'eventia/event.cpp', 'eventia/event.cpp',
'timer_oro_api.cpp', 'timer_oro_api.cpp',
'oro/originsdb.cpp', 'oro/originsdb.cpp',
'oro/page_fetch.cpp', 'nap/page_fetch.cpp',
'oro/http_header_parse.cpp', 'nap/http_header_parse.cpp',
project_config_file, project_config_file,
install: true, install: true,
dependencies: lib_deps, dependencies: lib_deps,

View file

@ -30,11 +30,11 @@ struct is_range<std::basic_string_view<Char, Trait>> : boost::mpl::true_ {};
} //namespace boost::spirit::x3::traits } //namespace boost::spirit::x3::traits
BOOST_FUSION_ADAPT_STRUCT(oro::ParsedHeader, BOOST_FUSION_ADAPT_STRUCT(nap::ParsedHeader,
version, code, message, fields version, code, message, fields
); );
namespace oro { namespace nap {
namespace { namespace {
namespace parser { namespace parser {
//HTTP/1.1 200 OK //HTTP/1.1 200 OK
@ -112,4 +112,4 @@ ParsedHeader header_parse (std::string_view text) {
return retval; return retval;
} }
} //namespace oro } //namespace nap

View file

@ -24,7 +24,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
namespace oro { namespace nap {
namespace { namespace {
bool is_https (std::string_view parUrl) { bool is_https (std::string_view parUrl) {
const char protocol[] = "https://"; const char protocol[] = "https://";
@ -77,4 +77,4 @@ HttpResponse page_fetch (std::string_view url, std::string_view user_agent) {
resp.code_desc = parsed_header.message; resp.code_desc = parsed_header.message;
return resp; return resp;
} }
} //namespace oro } //namespace nap

View file

@ -21,7 +21,7 @@
#include <vector> #include <vector>
#include <utility> #include <utility>
namespace oro { namespace nap {
struct ParsedHeader { struct ParsedHeader {
std::string_view version; std::string_view version;
unsigned int code; unsigned int code;
@ -30,4 +30,4 @@ struct ParsedHeader {
}; };
ParsedHeader header_parse (std::string_view text); ParsedHeader header_parse (std::string_view text);
} //namespace oro } //namespace nap

View file

@ -22,7 +22,7 @@
#include <vector> #include <vector>
#include <utility> #include <utility>
namespace oro { namespace nap {
struct HttpResponse { struct HttpResponse {
std::string raw; std::string raw;
std::vector<std::pair<std::string_view, std::string_view>> header; std::vector<std::pair<std::string_view, std::string_view>> header;
@ -33,4 +33,4 @@ struct HttpResponse {
}; };
HttpResponse page_fetch (std::string_view url, std::string_view user_agent); HttpResponse page_fetch (std::string_view url, std::string_view user_agent);
} //namespace oro } //namespace nap