All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpp-pistache-server.modelbase-source.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
{{>licenseInfo}}
#include "{{prefix}}ModelBase.h"

{{#modelNamespaceDeclarations}}
namespace {{this}} {
{{/modelNamespaceDeclarations}}

{{prefix}}ModelBase::{{prefix}}ModelBase()
{
}
{{prefix}}ModelBase::~{{prefix}}ModelBase()
{
}

std::string {{prefix}}ModelBase::toJson( std::string const& value )
{
    return value;
}

std::string {{prefix}}ModelBase::toJson( std::time_t const& value )
{
    char buf[sizeof "2011-10-08T07:07:09Z"];
    strftime(buf, sizeof buf, "%FT%TZ", gmtime(&value));
    return buf;
}

int32_t {{prefix}}ModelBase::toJson( int32_t const value )
{
    return value;
}

int64_t {{prefix}}ModelBase::toJson( int64_t const value )
{
    return value;
}

double {{prefix}}ModelBase::toJson( double const value )
{
    return value;
}

bool {{prefix}}ModelBase::toJson( bool const value )
{
    return value;
}

nlohmann::json {{prefix}}ModelBase::toJson({{prefix}}ModelBase const& content )
{
    return content.toJson();
}

{{#modelNamespaceDeclarations}}
}
{{/modelNamespaceDeclarations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy