Codegen. Add the possibility to add custom codegen.

This commit is contained in:
lganzzzo 2020-04-27 03:23:42 +03:00
parent 0460817ea4
commit 53518d03da
9 changed files with 22 additions and 15 deletions

View File

@ -11,12 +11,12 @@ add_library(oatpp
oatpp/codegen/api_controller/auth_undef.hpp
oatpp/codegen/api_controller/cors_define.hpp
oatpp/codegen/api_controller/cors_undef.hpp
oatpp/codegen/codegen_define_ApiClient_.hpp
oatpp/codegen/codegen_define_ApiController_.hpp
oatpp/codegen/codegen_define_DTO_.hpp
oatpp/codegen/codegen_undef_ApiClient_.hpp
oatpp/codegen/codegen_undef_ApiController_.hpp
oatpp/codegen/codegen_undef_DTO_.hpp
oatpp/codegen/ApiController_define.hpp
oatpp/codegen/ApiController_undef.hpp
oatpp/codegen/ApiClient_define.hpp
oatpp/codegen/ApiClient_undef.hpp
oatpp/codegen/DTO_define.hpp
oatpp/codegen/DTO_undef.hpp
oatpp/core/Types.hpp
oatpp/core/async/Coroutine.cpp
oatpp/core/async/Coroutine.hpp

View File

@ -26,8 +26,8 @@
* This file contains source code for basic helper macros used for code-generator.
*/
#ifndef oatpp_macro_ForEach_hpp
#define oatpp_macro_ForEach_hpp
#ifndef oatpp_macro_basic_hpp
#define oatpp_macro_basic_hpp
#define OATPP_MACRO_FOREACH_EXAMPLE_FUNC(INDEX, COUNT, X) \
ENV::log("macro", "param: %d/%d: '%s'", INDEX, COUNT, #X);
@ -498,4 +498,4 @@ OATPP_MACRO_EXPAND(OATPP_MACRO_FOREACH_CALL(N - 99, N, M, OATPP_MACRO_FIRSTARG_E
OATPP_MACRO_FOREACH_98(N, M, OATPP_MACRO_RESTARGS(__VA_ARGS__))
#endif /* oatpp_macro_ForEach_hpp */
#endif /* oatpp_macro_basic_hpp */

View File

@ -35,14 +35,21 @@
*
*/
#ifndef codegen_hpp
#define codegen_hpp
#ifndef oatpp_macro_codegen_hpp
#define oatpp_macro_codegen_hpp
#include "./basic.hpp"
#define OATPP_MACRO_CODEGEN_EXPAND(X) OATPP_MACRO_STR(X)
#define OATPP_CODEGEN_DEFINE_ApiController "oatpp/codegen/ApiController_define.hpp"
#define OATPP_CODEGEN_UNDEF_ApiController "oatpp/codegen/ApiController_undef.hpp"
#define OATPP_CODEGEN_BEGIN(NAME) OATPP_MACRO_CODEGEN_EXPAND(OATPP_MACRO_CONCAT2(oatpp/codegen/codegen_define_, NAME##_.hpp))
#define OATPP_CODEGEN_END(NAME) OATPP_MACRO_CODEGEN_EXPAND(OATPP_MACRO_CONCAT2(oatpp/codegen/codegen_undef_, NAME##_.hpp))
#define OATPP_CODEGEN_DEFINE_ApiClient "oatpp/codegen/ApiClient_define.hpp"
#define OATPP_CODEGEN_UNDEF_ApiClient "oatpp/codegen/ApiClient_undef.hpp"
#endif /* codegen_hpp */
#define OATPP_CODEGEN_DEFINE_DTO "oatpp/codegen/DTO_define.hpp"
#define OATPP_CODEGEN_UNDEF_DTO "oatpp/codegen/DTO_undef.hpp"
#define OATPP_CODEGEN_BEGIN(NAME) OATPP_MACRO_EXPAND(OATPP_CODEGEN_DEFINE_ ## NAME)
#define OATPP_CODEGEN_END(NAME) OATPP_MACRO_EXPAND(OATPP_CODEGEN_UNDEF_ ## NAME)
#endif /* oatpp_macro_codegen_hpp */