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

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

There is a newer version: 3.0.0-rc1
Show newest version
{{>licenseInfo}}
#include "ModelBase.h"

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

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 content )
{
    return content.get() ? content->toJson() : nlohmann::json();
}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy