<< Click to Display Table of Contents >> Navigation: Reference Manual > Arrays and matrices > DSL_idArray |
Header file: idarray.h
class DSL_idArray : public DSL_stringArray
DSL_intArray is derived from DSL_stringArray. DSL_idArray defines methods for creating and validating SMILE identifiers.
DSL_idArray(bool enableEmptyIds=false);
Creates an empty array and specifies the flag enabling empty identifiers.
DSL_idArray(std::initializer_list<const char*> il, bool enableEmptyIds=false);
Initializes an array and specifies the flag enabling empty identifiers.
DSL_idArray(const DSL_idArray &likeThisOne);
DSL_idArray& operator=(const DSL_idArray& other);
Implement the copy constructor and operator=.
bool EmptyIdsEnabled() const;
Returns true if empty identifiers can be stored in the array.
void SetAllEmptyIds(int newSize=-1);
Sets the flag to enable empty ids to true, and if newSize is greater or equal to zero resizes the array. All elements are then set to empty strings.
virtual int SetString(int index, const char *value) const;
Indexed write access. Returns DSL_OKAY on success, or DSL_OUT_OF_RANGE if the index is invalid, or if value is not a valid identifier, or an array already contains this identifier at some other index.
virtual int Add(const char *value);
Adds new element at the end of the array. Returns DSL_OKAY on success or DSL_OUT_OF_RANGE if the index is invalid, if value is not a valid identifier, or an array already contains this identifier at some other index.
virtual int Insert(int index, const char *value);
Inserts new element in the array at the specified index. Returns DSL_OKAY on success, or DSL_OUT_OF_RANGE if the index is invalid, if value is not a valid identifier, or an array already contains this identifier at some other index.