tsc_AttributeList

This class contains a list of tsc_Attribute objects, and has methods to find attributes by name or index, and to modify the list.

Note that although there is an Insert method, the order of attributes within the list is inconsequential to Survey Core.  Plugins and back-end processing programs should also be designed work correctly regardless of the sequence of attributes in this list.

tsc_AttributeList does not have a constructor.  This is because the tsc_Feature class always contains an attribute list (even if it is empty), so attributes may always be added directly to a tsc_Feature::Attributes object.

Public methods

tsc_Attribute operator[] (int index) const;

tsc_Attribute AtIndex (int index) const;

Returns the attribute at the given zero-based index.  

tsc_Attribute operator[] (const char* attributeName) const;

Returns the attribute of the given name. If no item exists at that index, the returned tsc_Attribute::IsNull() is true.

int IndexOf (const char* attributeName) const;

Returns the zero-based index of the attribute with the given name, or -1 if it does not exist in the list.

bool Contains (const char* attributeName) const;

Returns true if the named attribute exists in the list.

int Count () const;

Returns the number of attributes in the list.

void Add (const tsc_Attribute& attribute);

Adds an attribute to the end of the list.

void Remove (int index);

Removes the attribute at the given index.

void Insert (int index, const tsc_Attribute& attribute);

Inserts an attribute into the list at the given index.

void Clear ();

Removes all attributes from the list.

See also