ZRColaWS: Rename .h to .hpp and fix indents
Oat++ is using .hpp extension for header files. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
839c6fc1e6
commit
fa59e71fe3
@ -1,32 +0,0 @@
|
||||
/*
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
Copyright © 2022 Amebis
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <oatpp/core/macro/component.hpp>
|
||||
#include <oatpp/network/tcp/server/ConnectionProvider.hpp>
|
||||
#include <oatpp/parser/json/mapping/ObjectMapper.hpp>
|
||||
#include <oatpp/web/server/HttpConnectionHandler.hpp>
|
||||
|
||||
class AppComponent
|
||||
{
|
||||
public:
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([] {
|
||||
return oatpp::network::tcp::server::ConnectionProvider::createShared({"localhost", 8000, oatpp::network::Address::IP_4});
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, httpRouter)([] {
|
||||
return oatpp::web::server::HttpRouter::createShared();
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)([] {
|
||||
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
|
||||
return oatpp::web::server::HttpConnectionHandler::createShared(router);
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, apiObjectMapper)([] {
|
||||
return oatpp::parser::json::mapping::ObjectMapper::createShared();
|
||||
}());
|
||||
};
|
32
ZRColaWS/appcomponent.hpp
Normal file
32
ZRColaWS/appcomponent.hpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
Copyright © 2022 Amebis
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <oatpp/core/macro/component.hpp>
|
||||
#include <oatpp/network/tcp/server/ConnectionProvider.hpp>
|
||||
#include <oatpp/parser/json/mapping/ObjectMapper.hpp>
|
||||
#include <oatpp/web/server/HttpConnectionHandler.hpp>
|
||||
|
||||
class AppComponent
|
||||
{
|
||||
public:
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([] {
|
||||
return oatpp::network::tcp::server::ConnectionProvider::createShared({"localhost", 8000, oatpp::network::Address::IP_4});
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, httpRouter)([] {
|
||||
return oatpp::web::server::HttpRouter::createShared();
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)([] {
|
||||
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router);
|
||||
return oatpp::web::server::HttpConnectionHandler::createShared(router);
|
||||
}());
|
||||
|
||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, apiObjectMapper)([] {
|
||||
return oatpp::parser::json::mapping::ObjectMapper::createShared();
|
||||
}());
|
||||
};
|
@ -5,9 +5,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "dto.h"
|
||||
#include "iconverter.h"
|
||||
#include "zrcolaws.h"
|
||||
#include "dto.hpp"
|
||||
#include "iconverter.hpp"
|
||||
#include "zrcolaws.hpp"
|
||||
#include <zrcola/translate.h>
|
||||
#include <oatpp/core/macro/codegen.hpp>
|
||||
#include <oatpp/core/macro/component.hpp>
|
||||
@ -89,8 +89,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Flatten mapping and return along with the translated text.
|
||||
|
||||
utf16toutf8 cOut;
|
||||
auto dto = translateOutDto::createShared();
|
||||
dto->text = cOut.convert(dst);
|
@ -3,9 +3,9 @@
|
||||
Copyright © 2022 Amebis
|
||||
*/
|
||||
|
||||
#include "appcomponent.h"
|
||||
#include "controller.h"
|
||||
#include "zrcolaws.h"
|
||||
#include "appcomponent.hpp"
|
||||
#include "controller.hpp"
|
||||
#include "zrcolaws.hpp"
|
||||
#include <oatpp/network/Server.hpp>
|
||||
#include <fstream>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user