[C++][Pistache] Add some missing {{declspec}} on classes and functions (#14808)

This commit is contained in:
Sylvain Joubert
2023-02-28 11:19:43 +01:00
committed by GitHub
parent a4b5b85067
commit a9e4eaf582
12 changed files with 23 additions and 23 deletions

View File

@@ -28,7 +28,7 @@ namespace {{apiNamespace}}
{{#hasModelImport}}
using namespace {{modelNamespace}};{{/hasModelImport}}
class {{classname}}Impl : public {{apiNamespace}}::{{classname}} {
class {{declspec}} {{classname}}Impl : public {{apiNamespace}}::{{classname}} {
public:
explicit {{classname}}Impl(const std::shared_ptr<Pistache::Rest::Router>& rtr);
~{{classname}}Impl() override = default;

View File

@@ -75,10 +75,10 @@ public:
void setValue({{{this}}} value);
{{{this}}}::e{{{this}}} getEnumValue() const;
void setEnumValue({{{this}}}::e{{{this}}} value);{{/-first}}{{/anyOf}}{{/vendorExtensions.x-is-string-enum-container}}
friend void to_json(nlohmann::json& j, const {{classname}}& o);
friend void from_json(const nlohmann::json& j, {{classname}}& o);{{#vendorExtensions.x-is-string-enum-container}}{{#anyOf}}{{#-first}}
friend void to_json(nlohmann::json& j, const {{{this}}}& o);
friend void from_json(const nlohmann::json& j, {{{this}}}& o);{{/-first}}{{/anyOf}}{{/vendorExtensions.x-is-string-enum-container}}
friend {{declspec}} void to_json(nlohmann::json& j, const {{classname}}& o);
friend {{declspec}} void from_json(const nlohmann::json& j, {{classname}}& o);{{#vendorExtensions.x-is-string-enum-container}}{{#anyOf}}{{#-first}}
friend {{declspec}} void to_json(nlohmann::json& j, const {{{this}}}& o);
friend {{declspec}} void from_json(const nlohmann::json& j, {{{this}}}& o);{{/-first}}{{/anyOf}}{{/vendorExtensions.x-is-string-enum-container}}
protected:
{{#vars}}
{{{dataType}}} m_{{name}};

View File

@@ -17,7 +17,7 @@
namespace {{modelNamespace}}
{
struct {{classname}}
struct {{declspec}} {{classname}}
{
{{#isEnum}}{{#allowableValues}}
enum e{{classname}} {
@@ -59,8 +59,8 @@ struct {{classname}}
static {{classname}} from_json(const nlohmann::json& j);
};
void to_json(nlohmann::json& j, const {{classname}}& o);
void from_json(const nlohmann::json& j, {{classname}}& o);
{{declspec}} void to_json(nlohmann::json& j, const {{classname}}& o);
{{declspec}} void from_json(const nlohmann::json& j, {{classname}}& o);
} // namespace {{modelNamespace}}

View File

@@ -38,7 +38,7 @@ namespace org::openapitools::server::api
using namespace org::openapitools::server::model;
class PetApiImpl : public org::openapitools::server::api::PetApi {
class PetApiImpl : public org::openapitools::server::api::PetApi {
public:
explicit PetApiImpl(const std::shared_ptr<Pistache::Rest::Router>& rtr);
~PetApiImpl() override = default;

View File

@@ -38,7 +38,7 @@ namespace org::openapitools::server::api
using namespace org::openapitools::server::model;
class StoreApiImpl : public org::openapitools::server::api::StoreApi {
class StoreApiImpl : public org::openapitools::server::api::StoreApi {
public:
explicit StoreApiImpl(const std::shared_ptr<Pistache::Rest::Router>& rtr);
~StoreApiImpl() override = default;

View File

@@ -38,7 +38,7 @@ namespace org::openapitools::server::api
using namespace org::openapitools::server::model;
class UserApiImpl : public org::openapitools::server::api::UserApi {
class UserApiImpl : public org::openapitools::server::api::UserApi {
public:
explicit UserApiImpl(const std::shared_ptr<Pistache::Rest::Router>& rtr);
~UserApiImpl() override = default;

View File

@@ -80,8 +80,8 @@ public:
bool messageIsSet() const;
void unsetMessage();
friend void to_json(nlohmann::json& j, const ApiResponse& o);
friend void from_json(const nlohmann::json& j, ApiResponse& o);
friend void to_json(nlohmann::json& j, const ApiResponse& o);
friend void from_json(const nlohmann::json& j, ApiResponse& o);
protected:
int32_t m_Code;
bool m_CodeIsSet;

View File

@@ -73,8 +73,8 @@ public:
bool nameIsSet() const;
void unsetName();
friend void to_json(nlohmann::json& j, const Category& o);
friend void from_json(const nlohmann::json& j, Category& o);
friend void to_json(nlohmann::json& j, const Category& o);
friend void from_json(const nlohmann::json& j, Category& o);
protected:
int64_t m_Id;
bool m_IdIsSet;

View File

@@ -101,8 +101,8 @@ public:
bool completeIsSet() const;
void unsetComplete();
friend void to_json(nlohmann::json& j, const Order& o);
friend void from_json(const nlohmann::json& j, Order& o);
friend void to_json(nlohmann::json& j, const Order& o);
friend void from_json(const nlohmann::json& j, Order& o);
protected:
int64_t m_Id;
bool m_IdIsSet;

View File

@@ -100,8 +100,8 @@ public:
bool statusIsSet() const;
void unsetStatus();
friend void to_json(nlohmann::json& j, const Pet& o);
friend void from_json(const nlohmann::json& j, Pet& o);
friend void to_json(nlohmann::json& j, const Pet& o);
friend void from_json(const nlohmann::json& j, Pet& o);
protected:
int64_t m_Id;
bool m_IdIsSet;

View File

@@ -73,8 +73,8 @@ public:
bool nameIsSet() const;
void unsetName();
friend void to_json(nlohmann::json& j, const Tag& o);
friend void from_json(const nlohmann::json& j, Tag& o);
friend void to_json(nlohmann::json& j, const Tag& o);
friend void from_json(const nlohmann::json& j, Tag& o);
protected:
int64_t m_Id;
bool m_IdIsSet;

View File

@@ -115,8 +115,8 @@ public:
bool userStatusIsSet() const;
void unsetUserStatus();
friend void to_json(nlohmann::json& j, const User& o);
friend void from_json(const nlohmann::json& j, User& o);
friend void to_json(nlohmann::json& j, const User& o);
friend void from_json(const nlohmann::json& j, User& o);
protected:
int64_t m_Id;
bool m_IdIsSet;