BQuery: Make SetFlags() behave like other Set..() methods & add documentation.
This commit is contained in:
@@ -330,6 +330,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn status_t BQuery::SetFlags(uint32 flags)
|
||||||
|
\brief Sets the flags the query will be opened with.
|
||||||
|
|
||||||
|
The possible flags to set are defined in \file fs_query.h.
|
||||||
|
|
||||||
|
This methods fails if called after Fetch(). To reuse the BQuery object it
|
||||||
|
must first be reset via Clear().
|
||||||
|
|
||||||
|
\note The \c B_LIVE_QUERY flag will be ignored; BQuery always sets it automatically if necessary.
|
||||||
|
|
||||||
|
\param flags The flags to set.
|
||||||
|
|
||||||
|
\return A status code.
|
||||||
|
\retval B_OK Everything went fine.
|
||||||
|
\retval B_NOT_ALLOWED SetFlags() was called after Fetch().
|
||||||
|
|
||||||
|
\since Haiku R1
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
status_t SetVolume(const BVolume* volume);
|
status_t SetVolume(const BVolume* volume);
|
||||||
status_t SetPredicate(const char* expression);
|
status_t SetPredicate(const char* expression);
|
||||||
status_t SetTarget(BMessenger messenger);
|
status_t SetTarget(BMessenger messenger);
|
||||||
void SetFlags(uint32 flags);
|
status_t SetFlags(uint32 flags);
|
||||||
|
|
||||||
bool IsLive() const;
|
bool IsLive() const;
|
||||||
|
|
||||||
|
|||||||
@@ -231,10 +231,14 @@ BQuery::SetTarget(BMessenger messenger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
BQuery::SetFlags(uint32 flags)
|
BQuery::SetFlags(uint32 flags)
|
||||||
{
|
{
|
||||||
fFlags = flags;
|
if (_HasFetched())
|
||||||
|
return B_NOT_ALLOWED;
|
||||||
|
|
||||||
|
fFlags = (flags & ~B_LIVE_QUERY);
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user