Since arrays can be multi-dimensional, a single index does not suffice to
identify an element. We use the name string of the TypeComponent as index path. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33395 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
84153f2c57
commit
9e4a5c5fdc
@ -11,6 +11,7 @@
|
||||
#include <ObjectList.h>
|
||||
#include <Referenceable.h>
|
||||
|
||||
#include "ArrayIndexPath.h"
|
||||
#include "Type.h"
|
||||
|
||||
|
||||
@ -68,12 +69,20 @@ struct TypeComponent {
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
void SetToArrayElement(type_kind typeKind, uint64 index)
|
||||
void SetToArrayElement(type_kind typeKind, const BString& indexPath)
|
||||
{
|
||||
this->componentKind = TYPE_COMPONENT_ARRAY_ELEMENT;
|
||||
this->typeKind = typeKind;
|
||||
this->index = index;
|
||||
this->name = name;
|
||||
this->index = 0;
|
||||
this->name = indexPath;
|
||||
}
|
||||
|
||||
bool SetToArrayElement(type_kind typeKind, const ArrayIndexPath& indexPath)
|
||||
{
|
||||
this->componentKind = TYPE_COMPONENT_ARRAY_ELEMENT;
|
||||
this->typeKind = typeKind;
|
||||
this->index = 0;
|
||||
return indexPath.GetPathString(this->name);
|
||||
}
|
||||
|
||||
uint32 HashValue() const;
|
||||
|
Loading…
Reference in New Issue
Block a user