vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / kernel / file_systems / packagefs / indices / NameIndex.h
blob021ff1666386dce7b3d1ee7764538e6fa8350fe7
1 /*
2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef NAME_INDEX_H
6 #define NAME_INDEX_H
9 #include "Index.h"
10 #include "NodeListener.h"
13 template<typename Policy> class GenericIndexIterator;
16 class NameIndex : public Index, private NodeListener {
17 public:
18 NameIndex();
19 virtual ~NameIndex();
21 status_t Init(Volume* volume);
23 virtual int32 CountEntries() const;
25 private:
26 virtual void NodeAdded(Node* node);
27 virtual void NodeRemoved(Node* node);
28 virtual void NodeChanged(Node* node, uint32 statFields,
29 const OldNodeAttributes& oldAttributes);
31 protected:
32 virtual AbstractIndexIterator* InternalGetIterator();
33 virtual AbstractIndexIterator* InternalFind(const void* key,
34 size_t length);
36 private:
37 class EntryTree;
38 struct IteratorPolicy;
39 struct Iterator;
41 friend struct IteratorPolicy;
43 void _UpdateLiveQueries(Node* entry,
44 const char* oldName, const char* newName);
46 private:
47 EntryTree* fEntries;
51 #endif // NAME_INDEX_H