cpprest.model-header.mustache Maven / Gradle / Ivy
The newest version!
{{>licenseInfo}}
{{#models}}{{#model}}/*
* {{classname}}.h
*
* {{description}}
*/
#ifndef {{classname}}_H_
#define {{classname}}_H_
{{{defaultInclude}}}
#include "ModelBase.h"
{{#imports}}{{{this}}}
{{/imports}}
{{#modelNamespaceDeclarations}}
namespace {{this}} {
{{/modelNamespaceDeclarations}}
///
/// {{description}}
///
class {{declspec}} {{classname}}
: public ModelBase
{
public:
{{classname}}();
virtual ~{{classname}}();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// {{classname}} members
{{#vars}}
///
/// {{description}}
///
{{^isNotContainer}}{{{datatype}}}& {{getter}}();
{{/isNotContainer}}{{#isNotContainer}}{{{datatype}}} {{getter}}() const;
void {{setter}}({{{datatype}}} value);
{{/isNotContainer}}{{^required}}bool {{baseName}}IsSet() const;
void unset{{name}}();
{{/required}}
{{/vars}}
protected:
{{#vars}}{{{datatype}}} m_{{name}};
{{^required}}bool m_{{name}}IsSet;
{{/required}}
{{/vars}}
};
{{#modelNamespaceDeclarations}}
}
{{/modelNamespaceDeclarations}}
#endif /* {{classname}}_H_ */
{{/model}}
{{/models}}