MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLMDStreamingHelper Class Reference

Detailed Description

This help class exists to aid in serializing metadata to either a file or TSLofstream.

Static Public Member Functions

static void deleteString (char *str)
 
static TSLMDMetadatainitialiseISO19139 (const char *filename, TSLMDMetadata *metadata=0, TSLXMLParser_Expat *parser=0)
 
static TSLMDMetadatainitialiseISO19139FromString (const char *metadataString, TSLMDMetadata *metadata=0, TSLXMLParser_Expat *parser=0)
 
static bool serializeISO19139 (const TSLMDMetadata *metadata, TSLofstream &outputStream, bool indent, const char *codeListPath=0, bool writeMetadataHeader=true)
 
static char * serializeISO19139ToString (const TSLMDMetadata *metadata, bool indent, const char *codeListPath=0, bool writeMetadataHeader=true)
 
static char * serializeToString (const TSLMDMetadata *metadata, bool indent, bool writeMetadataHeader=true)
 
static bool serializeWithSchemaAndXSL (const TSLMDMetadata *metadata, const char *filename, bool indent, bool writeMetadataHeader=true)
 
static bool serializeWithSchemaAndXSL (const TSLMDMetadata *metadata, TSLofstream &outputStream, bool indent, TSLMetadataFormatEnum format=TSLMetadataFormatISO19115, const char *schemaLocation=NULL, const char *stylesheetLocation=NULL, const char *codeListPath=NULL, bool writeMetadataHeader=true)
 
static char * serializeWithSchemaAndXSLToString (const TSLMDMetadata *metadata, bool indent, bool writeMetadataHeader=true)
 
static bool serializeWithSchemaAndXSL (const TSLMDMetadata *metadata, const char *filename, bool indent, const char *schemaLocation, const char *stylesheetLocation, bool writeMetadataHeader=true)
 
static bool serializeWithSchemaAndXSL (const TSLMDMetadata *metadata, TSLofstream &outputStream, bool indent, const char *schemaLocation, const char *stylesheetLocation, bool writeMetadataHeader=true)
 
static char * serializeWithSchemaAndXSLToString (const TSLMDMetadata *metadata, bool indent, const char *schemaLocation, const char *stylesheetLocation, bool writeMetadataHeader=true)
 
static void setISOFormat (TSLMetadataFormatEnum format)
 
static TSLMetadataFormatEnum getISOFormat ()
 
static void setCodeListFormat (TSLMDCodeListFormatEnum format)
 
static TSLMDCodeListFormatEnum getCodeListFormat ()
 
static TSLMDMetadatainitialise (const char *filename, TSLMDMetadata *metadata=0, TSLXMLParser_Expat *parser=0)
 
static TSLMDMetadatainitialise (TSLifstream &streamOfXML, TSLMDMetadata *metadata=0, TSLXMLParser_Expat *parser=0)
 
static TSLMDMetadatainitialiseFromString (const char *metadataString, TSLMDMetadata *metadata=0, TSLXMLParser_Expat *parser=0)
 
static bool serialize (const TSLMDMetadata *metadata, const char *filename, bool indent, bool writeMetadataHeader=true)
 
static bool serialize (const TSLMDMetadata *metadata, TSLofstream &outputStream, bool indent, bool writeMetadataHeader=true)
 

Member Function Documentation

◆ deleteString()

static void TSLMDStreamingHelper::deleteString ( char * str)
static

Deletes a string created using one of the xxxToString methods of this class.

◆ getCodeListFormat()

static TSLMDCodeListFormatEnum TSLMDStreamingHelper::getCodeListFormat ( )
static

Gets the metadata code list format currently in use

◆ getISOFormat()

static TSLMetadataFormatEnum TSLMDStreamingHelper::getISOFormat ( )
static

Query the current format used for all reading and writing of metadata.

◆ initialise() [1/2]

TSLMDMetadata * TSLMDStreamingHelper::initialise ( const char * filename,
TSLMDMetadata * metadata = 0,
TSLXMLParser_Expat * parser = 0 )
inlinestatic

Initialises a metadata object from a file.

Parameters :

filename : The file, including path (absolute or relative), to read from to. If the file does not exist, 0 is returned;

metadata : The TSLMDMetadata object to initialise, if none is provided, one is created and returned

parser : The TSLXMLParser_Expat to use, if none is provided, one is created.

◆ initialise() [2/2]

TSLMDMetadata * TSLMDStreamingHelper::initialise ( TSLifstream & streamOfXML,
TSLMDMetadata * metadata = 0,
TSLXMLParser_Expat * parser = 0 )
inlinestatic

Initialises a metadata object from a TSLifstream.

Parameters :

streamOfXML : The TSLifStream to read from.

metadata : The TSLMDMetadata object to initialise, if none is provided, one is created and returned

parser : The TSLXMLParser_Expat to use, if none is provided, one is created.

◆ initialiseFromString()

TSLMDMetadata * TSLMDStreamingHelper::initialiseFromString ( const char * metadataString,
TSLMDMetadata * metadata = 0,
TSLXMLParser_Expat * parser = 0 )
inlinestatic

Initialises a metadata object from a string.

Parameters :

metadataString: The string of metadata to read from. If the string is invalid, 0 is returned;

metadata : The TSLMDMetadata object to initialise, if none is provided, one is created and returned

parser : The TSLXMLParser_Expat to use, if none is provided, one is created.

◆ initialiseISO19139()

static TSLMDMetadata * TSLMDStreamingHelper::initialiseISO19139 ( const char * filename,
TSLMDMetadata * metadata = 0,
TSLXMLParser_Expat * parser = 0 )
static

NOTE: ISO19139 support is limited and not intended for general use.

Initialises a metadata object from a file.

Parameters :

filename : The file, including path (absolute or relative), to read from or to. If the file does not exist, 0 is returned;

metadata : The TSLMDMetadata object to initialise, if none is provided, one is created and returned

parser : The TSLXMLParser_Expat to use, if none is provided, one is created.

◆ initialiseISO19139FromString()

static TSLMDMetadata * TSLMDStreamingHelper::initialiseISO19139FromString ( const char * metadataString,
TSLMDMetadata * metadata = 0,
TSLXMLParser_Expat * parser = 0 )
static

Initialises a metadata object from a string.

Parameters :

metadataString: The string of metadata to read from. If the string is invalid, 0 is returned;

metadata : The TSLMDMetadata object to initialise, if none is provided, one is created and returned

parser : The TSLXMLParser_Expat to use, if none is provided, one is created.

◆ serialize() [1/2]

bool TSLMDStreamingHelper::serialize ( const TSLMDMetadata * metadata,
const char * filename,
bool indent,
bool writeMetadataHeader = true )
inlinestatic

Serializes a metadata object to a file.

Parameters :

metadata : The TSLMDMetadata object to serialize

filename : The file, including path (absolute or relative), to serialize to. If the file does not exist, a new one is created;

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serialize() [2/2]

bool TSLMDStreamingHelper::serialize ( const TSLMDMetadata * metadata,
TSLofstream & outputStream,
bool indent,
bool writeMetadataHeader = true )
inlinestatic

Serializes a metadata object to a TSLofstream.

Parameters :

metadata : The TSLMDMetadata object to serialize

outputStream : The output stream to serialize to.

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeISO19139()

static bool TSLMDStreamingHelper::serializeISO19139 ( const TSLMDMetadata * metadata,
TSLofstream & outputStream,
bool indent,
const char * codeListPath = 0,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a TSLofstream.

Parameters :

metadata : The TSLMDMetadata object to serialize

outputStream : The output stream to serialize to.

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeISO19139ToString()

static char * TSLMDStreamingHelper::serializeISO19139ToString ( const TSLMDMetadata * metadata,
bool indent,
const char * codeListPath = 0,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a string. The string becomes the responsibility of the user and should be deleted using the deleteString method. If the serialization fails then null is returned.

Parameters :

metadata : The TSLMDMetadata object to serialize

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeToString()

static char * TSLMDStreamingHelper::serializeToString ( const TSLMDMetadata * metadata,
bool indent,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a string. The string becomes the responsibility of the user and should be deleted using the deleteString method. If the serialization fails then null is returned.

Parameters :

metadata : The TSLMDMetadata object to serialize

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeWithSchemaAndXSL() [1/4]

static bool TSLMDStreamingHelper::serializeWithSchemaAndXSL ( const TSLMDMetadata * metadata,
const char * filename,
bool indent,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a file, referencing the Envitia metadata W3 Schema and XSL stylesheet located on the Envitia website.

Parameters :

metadata : The TSLMDMetadata object to serialize

filename : The file, including path (absolute or relative), to serialize to. If the file does not exist, a new one is created;

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeWithSchemaAndXSL() [2/4]

static bool TSLMDStreamingHelper::serializeWithSchemaAndXSL ( const TSLMDMetadata * metadata,
const char * filename,
bool indent,
const char * schemaLocation,
const char * stylesheetLocation,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a file, referencing the Schema and XSL stylesheet provided by the input parameters.

Parameters :

metadata : The TSLMDMetadata object to serialize

filename : The file, including path (absolute or relative), to serialize to. If the file does not exist, a new one is created;

indent : Specify whether the XML should be indented and new tags appear on new lines.

schemaLocation : The relative or absolute path to the schema, relative to the output directory of the metadata file, as specified by the filename parameter. If null is passed then no schema is referenced.

stylesheetLocation : The relative or absolute path to the stylesheet, relative to the output directory of the metadata file, as specified by the filename parameter. If null is passed then no stylesheet is referenced.

◆ serializeWithSchemaAndXSL() [3/4]

static bool TSLMDStreamingHelper::serializeWithSchemaAndXSL ( const TSLMDMetadata * metadata,
TSLofstream & outputStream,
bool indent,
const char * schemaLocation,
const char * stylesheetLocation,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a TSLofstream, referencing the Schema and XSL stylesheet provided by the input parameters.

Parameters :

metadata : The TSLMDMetadata object to serialize

outputStream : The output stream to serialize to.

indent : Specify whether the XML should be indented and new tags appear on new lines.

schemaLocation : The relative or absolute path to the schema, relative to the output directory of the metadata file, as written by the outputStream. If null is passed then no schema is referenced.

stylesheetLocation : The relative or absolute path to the stylesheet, relative to the output directory of the metadata file, as written by the outputStream. If null is passed then no stylesheet is referenced.

◆ serializeWithSchemaAndXSL() [4/4]

static bool TSLMDStreamingHelper::serializeWithSchemaAndXSL ( const TSLMDMetadata * metadata,
TSLofstream & outputStream,
bool indent,
TSLMetadataFormatEnum format = TSLMetadataFormatISO19115,
const char * schemaLocation = NULL,
const char * stylesheetLocation = NULL,
const char * codeListPath = NULL,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a TSLofstream, referencing the Envitia metadata W3 Schema and XSL stylesheet located on the Envitia website.

Parameters :

metadata : The TSLMDMetadata object to serialize

outputStream : The output stream to serialize to.

indent : Specify whether the XML should be indented and new tags appear on new lines.

format: MetaData format (from enum TSLMetaDataFormat (default ISO19115)

The following parameters are only required if 'format' is TSLMetaDataFormat ISO19139:

schemaLocation: href of the schema location (default NULL)

stylesheetLocation: href of the stylesheet location (default NULL)

codeListPath: href of the path to the code list (default NULL)

◆ serializeWithSchemaAndXSLToString() [1/2]

static char * TSLMDStreamingHelper::serializeWithSchemaAndXSLToString ( const TSLMDMetadata * metadata,
bool indent,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a string, referencing the Envitia metadata W3 Schema and XSL stylesheet located on the Envitia website. The string becomes the responsibility of the user and should be deleted using the delete String method. If the serialization fails then null is returned.

Parameters :

metadata : The TSLMDMetadata object to serialize

indent : Specify whether the XML should be indented and new tags appear on new lines.

◆ serializeWithSchemaAndXSLToString() [2/2]

static char * TSLMDStreamingHelper::serializeWithSchemaAndXSLToString ( const TSLMDMetadata * metadata,
bool indent,
const char * schemaLocation,
const char * stylesheetLocation,
bool writeMetadataHeader = true )
static

Serializes a metadata object to a string, referencing the Schema and XSL stylesheet provided by the input parameters. The string becomes the responsibility of the user and should be deleted using the deleteString method. If the serialization fails then null is returned.

Parameters :

metadata : The TSLMDMetadata object to serialize

indent : Specify whether the XML should be indented and new tags appear on new lines.

schemaLocation : The relative or absolute path to the schema, relative to where the metadata will be viewed from. If null is passed then no schema is referenced.

stylesheetLocation : The relative or absolute path to the stylesheet, relative to where the metadata will be viewed from. If null is passed then no stylesheet is referenced.

◆ setCodeListFormat()

static void TSLMDStreamingHelper::setCodeListFormat ( TSLMDCodeListFormatEnum format)
static

Set the metadata code list format to use.

This setting will be used for all reading and writing of metadata. It will not be modified by any other method, and must be set as required by the application.

Initially this is set to TSLMDCodeListFormatBasic.

If the code list format has been set to TSLMDCodeListFormatExtensible, then the TSLXXXCodeEx classes should be queried from the metadata model, instead of the TSLXXXCode enum values.

◆ setISOFormat()

static void TSLMDStreamingHelper::setISOFormat ( TSLMetadataFormatEnum format)
static

Set the metadata format to use.

Unless specified otherwise for a specific method, the provided metadata format will be used for all reading and all writing of metadata.