MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
TSLFeatureList Class Reference

Detailed Description

A class to encapsulate a collection of MapLink features as defined in the class TSLFeature.

Some methods will allow hierarchical names such as 'roads.motorways'. This example shows that the parent feature called 'roads' has a child feature called 'motorways'.

See also
TSLFeature

Public Member Functions

 TSLFeatureList (bool caseSensitive=false)
 
 TSLFeatureList (const TSLFeatureList &other)
 Copy constructor.
 
TSLFeatureListoperator= (const TSLFeatureList &other)
 Assignment operator.
 
 ~TSLFeatureList ()
 Destructor.
 
void clear ()
 Remove any existing entries from the feature list.
 
unsigned int append (const TSLFeatureList &other)
 
bool addFeature (TSLFeature *feature)
 
unsigned int size () const
 
TSLFeaturequeryFeature (unsigned int index) const
 
TSLFeatureoperator[] (unsigned int index) const
 
TSLFeaturequeryFeature (const char *featureName, const char *product=NULL) const
 
bool removeFeature (unsigned int index)
 
bool removeFeature (const char *featureName, const char *product=NULL)
 
bool renameFeature (const char *featureName, const char *newFeatureName, const char *product=NULL)
 
bool caseSensitive () const
 
void caseSensitive (bool sensitive)
 

Constructor & Destructor Documentation

◆ TSLFeatureList() [1/2]

TSLFeatureList::TSLFeatureList ( bool caseSensitive = false)

Constructor.

Parameters
caseSensitivetrue to use case sensitive section and feature names in the list.

◆ TSLFeatureList() [2/2]

TSLFeatureList::TSLFeatureList ( const TSLFeatureList & other)

Copy constructor.

◆ ~TSLFeatureList()

TSLFeatureList::~TSLFeatureList ( )

Destructor.

Member Function Documentation

◆ addFeature()

bool TSLFeatureList::addFeature ( TSLFeature * feature)

Add a feature.

The provided feature will be added at the top level of the feature hierarchy. The provided feature will not be added if it has a parent.

Parameters
featureThe feature to add. Ownership of this feature will be transferred to the TSLFeatureList if the feature is added.
Returns
true if the feature was added, false otherwise.

◆ append()

unsigned int TSLFeatureList::append ( const TSLFeatureList & other)

Append another feature list.

All top level features will be copied into this feature list. Any features which already exist in this list will not be copied.

Parameters
otherThe feature list to append.
Returns
The number of features added.

◆ caseSensitive() [1/2]

bool TSLFeatureList::caseSensitive ( ) const

Query whether the feature list is case sensitive.

Returns
true if the list is case sensitive, false otherwise

◆ caseSensitive() [2/2]

void TSLFeatureList::caseSensitive ( bool sensitive)

Set whether the feature list is case sensitive.

Parameters
sensitivetrue to make the list case sensitive, false otherwise.

◆ clear()

void TSLFeatureList::clear ( )

Remove any existing entries from the feature list.

◆ operator=()

TSLFeatureList & TSLFeatureList::operator= ( const TSLFeatureList & other)

Assignment operator.

◆ operator[]()

TSLFeature * TSLFeatureList::operator[] ( unsigned int index) const

Array operator.

See also
queryFeature(unsigned int index)

◆ queryFeature() [1/2]

TSLFeature * TSLFeatureList::queryFeature ( const char * featureName,
const char * product = NULL ) const

Query a feature from the list.

This method may be used to query top-level features, or a child feature within the hierarchy. The returned TSLFeature may be modified, however must not be deleted by the application.

Parameters
featureNameThe name of the feature.
productThe product specification of the feature.
Returns
The requested feature, or null if the feature isn't present in the feature hierarchy.

◆ queryFeature() [2/2]

TSLFeature * TSLFeatureList::queryFeature ( unsigned int index) const

Query a feature from the list.

This method may be used to query top-level features, or a child feature within the hierarchy. The returned feature may be modified, however must not be deleted by the application.

Parameters
indexThe index of the feature.
Returns
The requested feature, or null on error.

◆ removeFeature() [1/2]

bool TSLFeatureList::removeFeature ( const char * featureName,
const char * product = NULL )

Remove a feature from the list.

This method may be used to query top-level features, or a child feature within the hierarchy. The specified feature and all of its children will be deleted.

Parameters
featureNameThe name of the feature to remove.
productThe product specification of the feature.
Returns
true if the feature was removed, false otherwise.

◆ removeFeature() [2/2]

bool TSLFeatureList::removeFeature ( unsigned int index)

Remove a feature from the list.

This method may be used to query top-level features, or a child feature within the hierarchy. The specified feature and all of its children will be deleted.

Parameters
indexThe index of the feature.
Returns
true if the feature was removed, false otherwise.

◆ renameFeature()

bool TSLFeatureList::renameFeature ( const char * featureName,
const char * newFeatureName,
const char * product = NULL )

Rename a feature.

This function may only be used to rename top-level features. Child features may be renamed using TSLFeature::renameChild.

Parameters
featureNameThe current feature name.
productThe product specification of the feature.
newFeatureNameThe new feature name.
Returns
true if the feature was renamed, false otherwise.

◆ size()

unsigned int TSLFeatureList::size ( ) const

Query the size of the feature list.

This size will only include the top-level features in the list. It will not contain any child features.

Returns
The number of features in the list.