13 #ifndef _FBXSDK_CORE_BASE_STRING_LIST_H_ 14 #define _FBXSDK_CORE_BASE_STRING_LIST_H_ 64 int AddItem( Type* pItem ) {
return mList.
Add( pItem ); }
75 Type*
GetItemAt(
int pIndex )
const {
return mList[pIndex]; }
104 inline int GetCount()
const {
return mList.GetCount(); }
113 void SetReferenceAt(
int pIndex, FbxHandle pRef) { mList[pIndex]->mReference = pRef; }
121 if (pIndex<mList.GetCount())
123 mList[pIndex]->mString = pString;
134 for (
int Count=0; Count<mList.GetCount(); Count++) {
135 if (mList[Count]==&pItem) {
148 for (
int Count=0; Count<mList.GetCount(); Count++) {
162 for (
int lCount=0; lCount<mList.GetCount(); lCount++) {
163 if (mList[lCount]->
mString==pString) {
177 int lIndex = FindIndex( pString );
179 return mList[lIndex]->mReference;
187 int lIndex = Find( pItem );
198 int lIndex = FindIndex( pString );
209 int lIndex = Find( pItem );
232 if (mList.GetCount() != 0)
251 if (mList.GetCount() != 0)
264 int Add(
const char* pString, FbxHandle pItem=0 )
266 return InsertAt( mList.GetCount(),pString,pItem );
269 virtual int InsertAt(
int pIndex,
const char* pString, FbxHandle pItem=0 )
271 return mList.
InsertAt( pIndex,FbxNew< Type >( pString,(FbxHandle)pItem ));
297 for (lCount=0; lCount<mList.GetCount(); lCount++)
299 pText += mList[lCount]->mString;
300 if (lCount<mList.GetCount()-1)
315 int lPos=0, lOldPos = 0;
320 for (lPos=0; lName.
Buffer()[lPos]!=0; lPos++) {
321 if (lName.
Buffer()[lPos]==
'~') {
323 lLastIndex = Add(lName.
Buffer()+lOldPos);
330 lLastIndex = Add(lName.
Buffer()+lOldPos);
T * GetArray() const
Get pointer to internal array of elements.
virtual void RemoveAt(int pIndex)
Remove the item at the given position in the array and delete the associated object.
int FindIndex(FbxHandle pReference) const
Find first matching item which has the same reference as given parameter.
FBX SDK environment definition.
virtual int SetText(const char *pList)
Clear the array and set the array's new items with the substring separated by '~' from the given stri...
void FbxArrayDelete(FbxArray< T > &pArray)
Call FbxDelete on each element of the array, and then clear it.
virtual void Clear()
Delete the array.
FbxString & operator[](int pIndex)
Access the string in the item at given index.
int Find(const T &pElement, const int pStartIndex=0) const
Find first matching element, from first to last.
Array that stores pairs of FbxString and a pointer.
Utility class to manipulate strings.
T RemoveAt(const int pIndex)
Remove an element at the given position in the array.
int FindIndex(const char *pString) const
Find first matching item in array whose string address is the same as given pointer.
Type * GetItemAt(int pIndex) const
Access item at given index.
virtual bool SetStringAt(int pIndex, const char *pString)
Set string at given index.
void RemoveLast()
Remove the item at the end of the array and delete the associated object.
char * GetStringAt(int pIndex) const
Access the pointer of string at given index.
void FbxDelete(T *p)
Deletion policy for pointer template classes that uses the FbxDelete() function.
virtual ~FbxStringListT()
Destructor.
int FbxCompareStringListSort(const void *E1, const void *E2)
int FbxCompareCaseSensitiveStringList(const void *E1, const void *E2)
void * FindCaseSensitive(const char *pString) const
Find first matching item which has the same string as given parameter, case sensitive.
int Add(const T &pElement)
Append an element at the end of the array, doubling the array if capacity is not sufficient.
FbxStringListItem(const char *pString, FbxHandle pRef=0)
virtual int InsertAt(int pIndex, const char *pString, FbxHandle pItem=0)
virtual void GetText(FbxString &pText) const
Get the string of all the item.
int FindItem(Type *pItem) const
Find first matching item.
int FbxCompareStringListFindEqual(const void *E1, const void *E2)
FbxStringListT()
Default constructor.
char * Buffer()
Non-const buffer access.
FbxHandle GetReferenceAt(int pIndex) const
Access the value of reference in the item at given index.
int AddItem(Type *pItem)
Append a item at the end of the array.
int InsertItemAt(int pIndex, Type *pItem)
Insert a item in the array.
Wraps a string (FbxString) and a pointer (FbxHandle).
bool RemoveIt(Type &pItem)
Remove first matching item.
int Find(Type &pItem) const
Find first matching item.
bool Remove(const char *pString)
Remove first matching item in array whose string address is the same as given pointer.
Base class of FbxStringList.
int InsertAt(const int pIndex, const T &pElement, bool pCompact=false)
Insert an element at the given position, growing the array if capacity is not sufficient.
void Sort()
Sort the array by the string of every item,not case sensitive.
int Add(const char *pString, FbxHandle pItem=0)
Add a new item at the end of array.
void * FindEqual(const char *pString) const
Find first matching item which has the same string as given parameter,not case sensitive.
bool Remove(Type &pItem)
Remove first matching item.
void SetReferenceAt(int pIndex, FbxHandle pRef)
Set the value of reference at given index.
int GetCount() const
Get number of items in the array.
Class for array of basic elements such as pointers and basic types.
FbxHandle FindReference(const char *pString) const
Access the value of reference of the first matching item in array whose string address is the same as...