forked from loafle/openapi-generator-original
[C++] [Restbed] Reworked the model template for restbed to create generic models (#5873)
* - Added Restbed Generator * - Added Json processing functions to model - Removed unnused code from restbed codegen class - Added response header processing to api template * Changed it to respect alphabetical order * Made the string joining java 7 compatible * Added samples * - Reworked the getter setter generation
This commit is contained in:
parent
3a32857790
commit
981ad60050
@ -37,10 +37,8 @@ public:
|
||||
/// <summary>
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
{{^isNotContainer}}{{{datatype}}}& {{getter}}();
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{getter}}() const;
|
||||
{{{datatype}}} {{getter}}() const;
|
||||
void {{setter}}({{{datatype}}} value);
|
||||
{{/isNotContainer}}
|
||||
{{/vars}}
|
||||
|
||||
protected:
|
||||
|
@ -73,11 +73,8 @@ void {{classname}}::fromJsonString(std::string const& jsonString)
|
||||
{{/vars}}
|
||||
}
|
||||
|
||||
{{#vars}}{{^isNotContainer}}{{{datatype}}}& {{classname}}::{{getter}}()
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{{#vars}}
|
||||
{{{datatype}}} {{classname}}::{{getter}}() const
|
||||
{
|
||||
return m_{{name}};
|
||||
}
|
||||
@ -85,7 +82,6 @@ void {{classname}}::{{setter}}({{{datatype}}} value)
|
||||
{
|
||||
m_{{name}} = value;
|
||||
}
|
||||
{{/isNotContainer}}
|
||||
{{/vars}}
|
||||
|
||||
{{#modelNamespaceDeclarations}}
|
||||
|
@ -85,14 +85,22 @@ void Pet::setName(std::string value)
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
std::vector<std::string>& Pet::getPhotoUrls()
|
||||
std::vector<std::string> Pet::getPhotoUrls() const
|
||||
{
|
||||
return m_PhotoUrls;
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>>& Pet::getTags()
|
||||
void Pet::setPhotoUrls(std::vector<std::string> value)
|
||||
{
|
||||
m_PhotoUrls = value;
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>> Pet::getTags() const
|
||||
{
|
||||
return m_Tags;
|
||||
}
|
||||
void Pet::setTags(std::vector<std::shared_ptr<Tag>> value)
|
||||
{
|
||||
m_Tags = value;
|
||||
}
|
||||
std::string Pet::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
|
@ -65,11 +65,13 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::string>& getPhotoUrls();
|
||||
std::vector<std::string> getPhotoUrls() const;
|
||||
void setPhotoUrls(std::vector<std::string> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::shared_ptr<Tag>>& getTags();
|
||||
std::vector<std::shared_ptr<Tag>> getTags() const;
|
||||
void setTags(std::vector<std::shared_ptr<Tag>> value);
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user