SchemaVersion Struct Reference

This is a datatype to store the versioning details for the Grassroots JSON schema that is being used. More...

#include <schema_version.h>

Public Member Functions

SchemaVersionAllocateSchemaVersion (const int major, const int minor)
 Create a new SchemaVersion. More...
 
bool SetSchemaVersionDetails (SchemaVersion *sv_p, const int major, const int minor)
 Set the details for a given SchemaVersion. More...
 
void FreeSchemaVersion (SchemaVersion *sv_p)
 Free the memory and resources for a given SchemaVersion. More...
 
void ClearSchemaVersion (SchemaVersion *sv_p)
 Clear the memory and resources for a given SchemaVersion. More...
 
json_t * GetSchemaVersionAsJSON (const SchemaVersion *const sv_p)
 Get the JSON representation for a SchemaVersion. More...
 
SchemaVersionGetSchemaVersionFromJSON (const json_t *const json_p)
 Create a SchemaVersion from a JSON representation. More...
 

Data Fields

uint32 sv_major
 The major revision of the schema. More...
 
uint32 sv_minor
 The minor revision of the schema. More...
 
char * sv_version_s
 The version as a string this will be of the form. More...
 

Detailed Description

This is a datatype to store the versioning details for the Grassroots JSON schema that is being used.

This allows backward compatibility code to be used as the schema is upgraded.

Member Function Documentation

◆ AllocateSchemaVersion()

SchemaVersion * AllocateSchemaVersion ( const int  major,
const int  minor 
)

Create a new SchemaVersion.

Parameters
majorThe major revision of the SchemaVersion.
minorThe minor revision of the SchemaVersion.
Returns
The newly-allocated SchemaVersion which will need to be freed when finished with or NULL upon error.
See also
FreeSchemaVersion

◆ SetSchemaVersionDetails()

bool SetSchemaVersionDetails ( SchemaVersion sv_p,
const int  major,
const int  minor 
)

Set the details for a given SchemaVersion.

Parameters
majorThe major revision to set the SchemaVersion to.
minorThe minor revision to set the SchemaVersion to.
sv_pThe SchemaVersion to amend.
Returns
true if the SchemaVersion was amended successfully, false otherwise.

◆ FreeSchemaVersion()

void FreeSchemaVersion ( SchemaVersion sv_p)

Free the memory and resources for a given SchemaVersion.

Parameters
sv_pThe SchemaVersion to free.

◆ ClearSchemaVersion()

void ClearSchemaVersion ( SchemaVersion sv_p)

Clear the memory and resources for a given SchemaVersion.

Parameters
sv_pThe SchemaVersion to clear.

◆ GetSchemaVersionAsJSON()

json_t * GetSchemaVersionAsJSON ( const SchemaVersion *const  sv_p)

Get the JSON representation for a SchemaVersion.

Parameters
sv_pThe SchemaVersion to get the JSON representation of.
Returns
The newly-allocated JSON representation or NULL upon error.

◆ GetSchemaVersionFromJSON()

SchemaVersion * GetSchemaVersionFromJSON ( const json_t *const  json_p)

Create a SchemaVersion from a JSON representation.

Parameters
json_pThe JSON representation to create a SchemaVersion from.
Returns
The newly-allocated SchemaVersion which will need to be freed when finished with or NULL upon error.
See also
FreeSchemaVersion

Field Documentation

◆ sv_major

uint32 sv_major

The major revision of the schema.

◆ sv_minor

uint32 sv_minor

The minor revision of the schema.

◆ sv_version_s

char* sv_version_s

The version as a string this will be of the form.

sv_major.sv_minor


The documentation for this struct was generated from the following file: