PropertyNameArray.h [plain text]
#ifndef KJS_PROPERTY_NAME_ARRAY_H
#define KJS_PROPERTY_NAME_ARRAY_H
#include "identifier.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
namespace KJS {
class PropertyNameArray;
typedef Vector<Identifier>::const_iterator PropertyNameArrayIterator;
class PropertyNameArray {
public:
typedef PropertyNameArrayIterator iterator;
void add(const Identifier&);
iterator begin() const { return m_vector.begin(); }
iterator end() const { return m_vector.end(); }
int size() const { return m_vector.size(); }
Identifier& operator[](unsigned i) { return m_vector[i]; }
const Identifier& operator[](unsigned i) const { return m_vector[i]; }
private:
typedef HashSet<UString::Rep*, PtrHash<UString::Rep*> > IdentifierSet;
IdentifierSet m_set;
Vector<Identifier> m_vector;
};
}
#endif // KJS_PROPERTY_NAME_ARRAY_H