tsc_FeatureLibrary

This class is used to access Feature and Attribute Libraries, as found in an FXL or FAL file.  These are more commonly referred to as Feature Libraries, whether or not they contain only features or contain both features and attributes.

Also see the information page with more details about Feature libraries and their relationship to features and attributes as stored in the database.

At present it is only possible to load and examine the feature library that is attached to the current job. The tsc_FeatureLibrary class and its descendants interface directly to the current job's feature library as it exists in memory and are therefore read-only; there are no methods for modifying, copying, or creating in these classes.

To obtain a reference to the current feature library, use the tsc_Job::CurrentFeatureLibrary() method. tsc_Job also contains methods for attaching a different library to the current job.

Public methods

bool Exists () const;

Returns true if the instance refers to a valid non-empty library, otherwise false.

tsc_String Path () const;

Returns the full path of the library file from which the library was loaded.  This will be the empty string if the instance did not originate from a file.

bool HasFeatures () const;

Returns true if any features are present in the library.  Same as FeatureCount > 0.

bool HasAttributes () const;

Returns true if any feature in the library has one or more attributes.

tsc_LibraryFeature AtIndex (int index) const;

Returns the feature at the given index.  The subscript [] operator may also be used.

int  IndexOf (const char* featureName) const;

Returns the index of the feature with the given name, or -1.  The subscript [] operator may also be used.

bool Contains (const char* featureName) const;

Returns true if the named feature exists within the library.

int FeatureCount () const;

Returns the number of features in the library.

tsc_LibraryAttribute FindAttribute(const char* featureName, const char* attributeName) const;

Find an attribute within a given feature.  If the feature or the attribute does not exist, the returned tsc_LibraryAttribute::IsNull() will return true.

tsc_FeatureLibrary& operator= (const tsc_FeatureLibrary&);

The = operator creates a new reference to the same library.

 

Constructors

tsc_FeatureLibrary (const tsc_FeatureLibrary&);

The copy constructor creates a reference to the same library.

See also

Feature library classes

Database entity feature and attribute classes