[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:
stkrwork 2017-06-19 16:56:01 +02:00 committed by wing328
parent 3a32857790
commit 981ad60050
4 changed files with 19 additions and 15 deletions

View File

@ -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:

View File

@ -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}}

View File

@ -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;

View File

@ -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>