forked from loafle/openapi-generator-original
* Add CPP_NAMESPACE option * update mustache template to exploit cppNamespace option * update sample files * correction : missing namespace replacement in template
65 lines
1.1 KiB
Plaintext
65 lines
1.1 KiB
Plaintext
{{>licenseInfo}}
|
|
{{#models}}{{#model}}/*
|
|
* {{classname}}.h
|
|
*
|
|
* {{description}}
|
|
*/
|
|
|
|
#ifndef {{classname}}_H_
|
|
#define {{classname}}_H_
|
|
|
|
#include <FApp.h>
|
|
#include <FBase.h>
|
|
#include <FSystem.h>
|
|
#include <FWebJson.h>
|
|
#include "{{prefix}}Helpers.h"
|
|
#include "{{prefix}}Object.h"
|
|
|
|
using namespace Tizen::Web::Json;
|
|
|
|
{{/model}}{{/models}}
|
|
{{#imports}}{{{import}}}
|
|
{{/imports}}
|
|
|
|
{{#models}}{{#model}}
|
|
|
|
{{#cppNamespaceDeclarations}}
|
|
namespace {{this}} {
|
|
{{/cppNamespaceDeclarations}}
|
|
|
|
class {{classname}}: public {{prefix}}Object {
|
|
public:
|
|
{{classname}}();
|
|
{{classname}}(String* json);
|
|
virtual ~{{classname}}();
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
String asJson ();
|
|
|
|
JsonObject* asJsonObject();
|
|
|
|
void fromJsonObject(IJsonValue* json);
|
|
|
|
{{classname}}* fromJson(String* obj);
|
|
|
|
{{#vars}}
|
|
{{datatype}} {{getter}}();
|
|
void {{setter}}({{datatype}} {{name}});
|
|
{{/vars}}
|
|
|
|
private:
|
|
{{#vars}}{{datatype}} {{name}};
|
|
{{/vars}}
|
|
};
|
|
|
|
{{#cppNamespaceDeclarations}}
|
|
}
|
|
{{/cppNamespaceDeclarations}}
|
|
|
|
#endif /* {{classname}}_H_ */
|
|
{{/model}}
|
|
{{/models}}
|