btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / bfs / Query.h
blobfe75cf761223a584b9124fb61dfda60c1ee51bd3
1 /*
2 * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de.
3 * This file may be used under the terms of the MIT License.
4 */
5 #ifndef QUERY_H
6 #define QUERY_H
8 #include "system_dependencies.h"
10 #include "Index.h"
13 class Volume;
14 class Term;
15 class Equation;
16 class TreeIterator;
17 class Query;
20 class Expression {
21 public:
22 Expression(char* expr);
23 ~Expression();
25 status_t InitCheck();
26 const char* Position() const { return fPosition; }
27 Term* Root() const { return fTerm; }
29 protected:
30 Term* ParseOr(char** expr);
31 Term* ParseAnd(char** expr);
32 Term* ParseEquation(char** expr);
34 bool IsOperator(char** expr, char op);
36 private:
37 Expression(const Expression& other);
38 Expression& operator=(const Expression& other);
39 // no implementation
41 char* fPosition;
42 Term* fTerm;
45 class Query : public SinglyLinkedListLinkImpl<Query> {
46 public:
47 Query(Volume* volume, Expression* expression,
48 uint32 flags);
49 ~Query();
51 status_t Rewind();
52 status_t GetNextEntry(struct dirent* , size_t size);
54 void SetLiveMode(port_id port, int32 token);
55 void LiveUpdate(Inode* inode, const char* attribute,
56 int32 type, const uint8* oldKey,
57 size_t oldLength, const uint8* newKey,
58 size_t newLength);
59 void LiveUpdateRenameMove(Inode* inode,
60 ino_t oldDirectoryID, const char* oldName,
61 size_t oldLength, ino_t newDirectoryID,
62 const char* newName, size_t newLength);
64 Expression* GetExpression() const { return fExpression; }
66 private:
67 Volume* fVolume;
68 Expression* fExpression;
69 Equation* fCurrent;
70 TreeIterator* fIterator;
71 Index fIndex;
72 Stack<Equation*> fStack;
74 uint32 fFlags;
75 port_id fPort;
76 int32 fToken;
79 #endif // QUERY_H