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

Detailed Description

This class is used for loading GML application schemas from a file path or a buffer. A file path may either be local or a URL.

GML application schemas should be loaded via one of the loadSchema methods of this class.

Public Member Functions

 TSLGMLApplicationSchemaLoader ()
 
void destroy ()
 
void gmlSFValidationLevel (TSLGMLSFValidationLevel level)
 
TSLGMLSFValidationLevel gmlSFValidationLevel () const
 
TSLGMLApplicationSchemaloadSchema (const char *location)
 
TSLGMLApplicationSchemaloadSchema (const char *buffer, unsigned int bufferLen, const char *location=0)
 
void strictValidation (bool isStrict)
 
bool strictValidation () const
 
void unhandledFeatureDefinitionCallback (TSLGMLUnhandledFeatureDefinitionCallback *callback)
 
const TSLGMLUnhandledFeatureDefinitionCallbackunhandledFeatureDefinitionCallback () const
 
void urlLoaderCallback (TSLGMLURLLoaderCallback *callback)
 
const TSLGMLURLLoaderCallbackurlLoaderCallback () const
 
void * operator new (size_t size)
 
void * operator new (size_t size, char *filename, int line)
 

Constructor & Destructor Documentation

◆ TSLGMLApplicationSchemaLoader()

TSLGMLApplicationSchemaLoader::TSLGMLApplicationSchemaLoader ( )

Default constructor.

Member Function Documentation

◆ destroy()

void TSLGMLApplicationSchemaLoader::destroy ( )

Destroy this object.

This method must be used instead of delete.

◆ gmlSFValidationLevel() [1/2]

TSLGMLSFValidationLevel TSLGMLApplicationSchemaLoader::gmlSFValidationLevel ( ) const

Queries the current GML SF profile validation level that loaded schemas will be checked against.

The default is not to perform any validation (TSLGMLSFValidationNone)

Should the schema being loaded fail the validation rules, then the loading will fail and an error will be placed on the error stack.

◆ gmlSFValidationLevel() [2/2]

void TSLGMLApplicationSchemaLoader::gmlSFValidationLevel ( TSLGMLSFValidationLevel level)

Sets the GML SF validation level to check schemas that have been loaded against.

The default is not to perform any validation (TSLGMLSFValidationNone)

Should the schema being loaded fail the validation rules, then the loading will fail and an error will be placed on the error stack.

◆ loadSchema() [1/2]

TSLGMLApplicationSchema * TSLGMLApplicationSchemaLoader::loadSchema ( const char * buffer,
unsigned int bufferLen,
const char * location = 0 )

Loads a GML application schema from a user provided buffer.

Schema loading requires access to all schemas that the target schema depends upon, including the base GML schemas. Through the use of the urlLoader Callback method of this class, the location that this dependent schemas are loaded from can be redirected to local copies.

An additional location parameter can optionally be provided. This is used to form the path of dependent schema files that are referenced by relative path names.

Parameters
bufferThe buffer containing the schema
bufferLenThe length of the buffer
locationThe source location of the schema for relative path resolution.

If the schema loads successfully then a TSLGMLApplicationSchema instance will be returned. On error, null will be returned.

◆ loadSchema() [2/2]

TSLGMLApplicationSchema * TSLGMLApplicationSchemaLoader::loadSchema ( const char * location)

Loads a GML application schema from the location provided. This location may either be a local file path or a URL.

Schema loading requires access to all schemas that the target schema depends upon, including the base GML schemas. Through the use of the urlLoader Callback method of this class, the location that this dependent schemas are loaded from can be redirected to local copies.

Parameters
locationThe location to load the GML application schema from.
Returns
a TSLGMLApplicationSchema object on success, null otherwise.

◆ operator new() [1/2]

void * TSLGMLApplicationSchemaLoader::operator new ( size_t size)

◆ operator new() [2/2]

void * TSLGMLApplicationSchemaLoader::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ strictValidation() [1/2]

bool TSLGMLApplicationSchemaLoader::strictValidation ( ) const

Queries whether strict schema validation will be used during loading. By default this setting is off.

This validation refers to whether the schema is strictly valid according to the W3 definition of a schema, rather than its use of GML or whether it is supported by MapLink.

◆ strictValidation() [2/2]

void TSLGMLApplicationSchemaLoader::strictValidation ( bool isStrict)

Sets whether strict schema validation will be used. By default this setting is off.

This validation refers to whether the schema is strictly valid according to the W3 definition of a schema, rather than its use of GML or whether it is supported by MapLink.

Parameters
isStrictSets whether strict validation should be used.

◆ unhandledFeatureDefinitionCallback() [1/2]

const TSLGMLUnhandledFeatureDefinitionCallback * TSLGMLApplicationSchemaLoader::unhandledFeatureDefinitionCallback ( ) const

Get the unhandled feature definition callback used by the schema loader.

The callback instance's method will be called whenever the schema loader finds an feature definition that it doesn't support. This maybe due to the feature being more complex than GML SF-0 permits or because it failed to fully understand the feature.

◆ unhandledFeatureDefinitionCallback() [2/2]

void TSLGMLApplicationSchemaLoader::unhandledFeatureDefinitionCallback ( TSLGMLUnhandledFeatureDefinitionCallback * callback)

Set the unhandled feature definition callback used by the schema loader.

The callback instance's method will be called whenever the schema loader finds an feature definition that it doesn't support. This maybe due to the feature being more complex than GML SF-0 permits or because it failed to fully understand the feature.

NOTE: The user retains ownership of the callback instance.

Parameters
callbackThe new callback to set. Pass null to clear the existing callback.

◆ urlLoaderCallback() [1/2]

const TSLGMLURLLoaderCallback * TSLGMLApplicationSchemaLoader::urlLoaderCallback ( ) const

Get the url loader callback used by the schema loader.

The callback instance's method will be called whenever the schema loader finds an schema include or import directive that refers to a URL in a schema file being loaded. It gives the opportunity for the user to redirect that location that the schema will be loaded from to a local file.

◆ urlLoaderCallback() [2/2]

void TSLGMLApplicationSchemaLoader::urlLoaderCallback ( TSLGMLURLLoaderCallback * callback)

Set the url loader callback used by the schema loader.

The callback instance's method will be called whenever the schema loader finds an schema include or import directive that refers to a URL in a schema file being loaded. It gives the opportunity for the user to redirect that location that the schema will be loaded from to a local file.

NOTE: The user retains ownership of the callback instance.

Parameters
callbackThe new callback to set. Pass null to clear the existing callback.