2 * Copyright 2002-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
10 #include <Messenger.h>
39 _B_RESERVED_OP_
= 0x100000
43 class BQuery
: public BEntryList
{
50 status_t
PushAttr(const char* attrName
);
51 status_t
PushOp(query_op op
);
53 status_t
PushUInt32(uint32 value
);
54 status_t
PushInt32(int32 value
);
55 status_t
PushUInt64(uint64 value
);
56 status_t
PushInt64(int64 value
);
57 status_t
PushFloat(float value
);
58 status_t
PushDouble(double value
);
59 status_t
PushString(const char* value
,
60 bool caseInsensitive
= false);
61 status_t
PushDate(const char* date
);
63 status_t
SetVolume(const BVolume
* volume
);
64 status_t
SetPredicate(const char* expression
);
65 status_t
SetTarget(BMessenger messenger
);
69 status_t
GetPredicate(char* buffer
, size_t length
);
70 status_t
GetPredicate(BString
* predicate
);
71 size_t PredicateLength();
73 dev_t
TargetDevice() const;
77 // BEntryList interface
78 virtual status_t
GetNextEntry(BEntry
* entry
, bool traverse
= false);
79 virtual status_t
GetNextRef(entry_ref
* ref
);
80 virtual int32
GetNextDirents(struct dirent
* buffer
, size_t length
,
81 int32 count
= INT_MAX
);
82 virtual status_t
Rewind();
83 virtual int32
CountEntries();
86 bool _HasFetched() const;
87 status_t
_PushNode(BPrivate::Storage::QueryNode
* node
,
89 status_t
_SetPredicate(const char* expression
);
90 status_t
_EvaluateStack();
91 void _ParseDates(BString
& parsedPredicate
);
94 virtual void _QwertyQuery1();
95 virtual void _QwertyQuery2();
96 virtual void _QwertyQuery3();
97 virtual void _QwertyQuery4();
98 virtual void _QwertyQuery5();
99 virtual void _QwertyQuery6();
102 BPrivate::Storage::QueryStack
* fStack
;
109 int32 _reservedData
[4];