mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 05:17:09 +00:00
[C++ server] Adjust the names (script, sample folder, generator) to lang option (#250)
* Renamce C++ server scripts * Change output folder * Rename sample folder: pistache-server -> cpp-pistache * Rename sample folder: restbed -> cpp-restbed
This commit is contained in:
committed by
William Cheng
parent
f5f00069bd
commit
2392a09eeb
66
samples/server/petstore/cpp-pistache/model/ModelBase.cpp
Normal file
66
samples/server/petstore/cpp-pistache/model/ModelBase.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
#include "ModelBase.h"
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
ModelBase::ModelBase()
|
||||
{
|
||||
}
|
||||
ModelBase::~ModelBase()
|
||||
{
|
||||
}
|
||||
|
||||
std::string ModelBase::toJson( const std::string& value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
std::string ModelBase::toJson( const std::time_t& value )
|
||||
{
|
||||
char buf[sizeof "2011-10-08T07:07:09Z"];
|
||||
strftime(buf, sizeof buf, "%FT%TZ", gmtime(&value));
|
||||
return buf;
|
||||
}
|
||||
|
||||
int32_t ModelBase::toJson( int32_t value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
int64_t ModelBase::toJson( int64_t value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
double ModelBase::toJson( double value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
bool ModelBase::toJson( bool value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
nlohmann::json ModelBase::toJson( std::shared_ptr<ModelBase> content )
|
||||
{
|
||||
return content.get() ? content->toJson() : nlohmann::json();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user