HDK
|
A specialization of GA_AIFStringArray to access "shared strings". More...
#include <GA_AIFSharedStringArray.h>
Classes | |
class | iterator |
Class to iterate over all the strings in the shared string table. More... | |
Public Member Functions | |
GA_AIFSharedStringArray () | |
virtual | ~GA_AIFSharedStringArray () |
virtual bool | getStatistics (const GA_Attribute *attrib, GA_StringTableStatistics &stats) const =0 |
Query information about the string storage. More... | |
virtual bool | compactStorage (GA_Attribute *attrib) const =0 |
Compact the string storage. More... | |
virtual bool | extractStrings (const GA_Attribute *attrib, UT_StringArray &strings, UT_IntArray &handles) const =0 |
virtual bool | extractHandles (const GA_Attribute *attrib, UT_IntArray &handles) const =0 |
GA_Size | getTableEntries (const GA_Attribute *attrib) const |
Return the number of entries in the shared string table. More... | |
virtual GA_StringIndexType | validateTableHandle (const GA_Attribute *attrib, GA_StringIndexType index) const =0 |
virtual const char * | getTableString (const GA_Attribute *attrib, GA_StringIndexType handle) const =0 |
Get a string from the string table (without going through an attribute) More... | |
virtual GA_StringIndexType | getTableHandle (const GA_Attribute *attrib, const char *string) const =0 |
virtual const char * | getTableOrderedString (const GA_Attribute *a, exint index) const =0 |
virtual bool | replaceTableString (GA_Attribute *attrib, GA_StringIndexType handle, const char *string) const =0 |
iterator | begin (const GA_Attribute *a) const |
iterator | end () const |
virtual int | getTupleSize (const GA_Attribute *attrib) const =0 |
virtual bool | setTupleSize (GA_Attribute *attrib, int size) const =0 |
virtual GA_Storage | getStorage (const GA_Attribute *attrib) const =0 |
virtual void | getString (const GA_Attribute *attribute, GA_Offset offset, UT_StringArray &strings) const =0 |
Get a single string from the array for a single tuple of an element. More... | |
virtual void | getString (const GA_Attribute *attribute, GA_Offset offset, UT_Array< UT_StringHolder > &strings) const =0 |
virtual void | getStringIndex (const GA_Attribute *attribute, GA_Offset offset, UT_Array< GA_StringIndexType > &indices) const =0 |
Get the handle from the array for a single tuple of an element. More... | |
virtual void | setString (GA_Attribute *attribute, GA_Offset offset, const UT_StringArray &strings) const =0 |
Set a single component for a single element. More... | |
virtual void | setString (GA_Attribute *attribute, GA_Offset offset, const UT_Array< UT_StringHolder > &strings) const =0 |
virtual void | setStringIndex (GA_Attribute *attribute, GA_Offset offset, const UT_Array< GA_StringIndexType > &indices) const =0 |
Set a single component for a range of elements. More... | |
virtual exint | arraySize (const GA_Attribute *atr, GA_Offset off) const =0 |
Return the size of the array for the GA_Offset. More... | |
bool | get (const GA_Attribute *attrib, GA_Offset o, UT_StringArray &v) const |
bool | set (GA_Attribute *attrib, GA_Offset o, const UT_StringArray &v) const |
virtual exint | findMaximumArrayLength (const GA_Attribute *attrib) const =0 |
Protected Member Functions | |
virtual GA_StringIndexType | addStringReference (GA_Attribute *attribute, const char *string) const =0 |
Add (or increment) reference to a string. More... | |
virtual void | delHandleReference (GA_Attribute *attribute, GA_StringIndexType handle) const =0 |
Decrement reference to a handle. More... | |
A specialization of GA_AIFStringArray to access "shared strings".
This class provides the interface to access string table data. Each attribute type may provide this interface if it makes sense.
Definition at line 35 of file GA_AIFSharedStringArray.h.
GA_AIFSharedStringArray::GA_AIFSharedStringArray | ( | ) |
|
virtual |
|
protectedpure virtual |
Add (or increment) reference to a string.
|
pure virtual |
Return the size of the array for the GA_Offset.
|
inline |
Definition at line 204 of file GA_AIFSharedStringArray.h.
|
pure virtual |
Compact the string storage.
|
protectedpure virtual |
Decrement reference to a handle.
Definition at line 206 of file GA_AIFSharedStringArray.h.
|
pure virtual |
Extract all of the unique string handles of the attribute. The string handles are guaranteed to be in ascending order, but may or may not be contiguous.
|
pure virtual |
Extract data from the string table. This will extract all the unique strings which are referenced by the attribute. The string handles are guaranteed to be in ascending order, but may or may not be contiguous.
|
pure virtual |
Return the length of longest array
|
inline |
Get a UT_StringArray at specific GA_Offset. This is an alias for getString() so that we can treat this AIF similar to GA_AIFNumericArray.
Definition at line 246 of file GA_AIFSharedStringArray.h.
|
pure virtual |
Query information about the string storage.
|
pure virtual |
|
pure virtual |
Get a single string from the array for a single tuple of an element.
|
pure virtual |
|
pure virtual |
Get the handle from the array for a single tuple of an element.
|
inline |
Return the number of entries in the shared string table.
Definition at line 73 of file GA_AIFSharedStringArray.h.
|
pure virtual |
Get the handle (index) corresponding to the given string, returning -1 if none.
|
pure virtual |
GA_StringIndexType indices may not be contiguous, this method allows you to get a string given an ordered index. Strings will be defined for all contiguous strings. This may be an expensive operation, it's better to access strings by their index if possible.
This method will return a NULL pointer past the end of the string table
|
pure virtual |
Get a string from the string table (without going through an attribute)
|
pure virtual |
|
pure virtual |
Replace a string in the shared string table with a new value. Warning, it's possible that the table will "collapse" after the replacement. For example:
In the above example, all elements which originally referenced "bar" will now reference "foo". This means that trying to swap two values will not work as expected.
|
inline |
Set a UT_StringArray at specific GA_Offset. This is an alias for setString() so that we can treat this AIF similar to GA_AIFNumericArray.
Definition at line 255 of file GA_AIFSharedStringArray.h.
|
pure virtual |
Set a single component for a single element.
|
pure virtual |
|
pure virtual |
Set a single component for a range of elements.
|
pure virtual |
|
pure virtual |
It's possible that there are invalid handle indexes mixed with the valid handles. When iterating over all the handles, you can call validateTableHandle()
which will ensure that there's a string associated with the given handle.