Public Member Functions

BQuery Class Reference

Represents a live or non-live file system query. More...

Inheritance diagram for BQuery:
BEntryList

List of all members.

Public Member Functions

virtual int32 CountEntries ()
 Returns the number of entries in the list.
virtual int32 GetNextDirents (struct dirent *buffer, size_t length, int32 count=INT_MAX)
 Returns the BEntryList's next entries as dirent structures.
virtual status_t GetNextEntry (BEntry *entry, bool traverse=false)
 Returns the BEntryList's next entry as a BEntry.
virtual status_t GetNextRef (entry_ref *ref)
 Returns the BEntryList's next entry as an entry_ref.
virtual status_t Rewind ()
 Rewinds the list pointer to the beginning of the list.

Detailed Description

Represents a live or non-live file system query.

Provides an interface for creating file system queries. Implements the BEntryList for iterating through the found entries.

Author:
Ingo Weinhold
Version:
0.0.0

Member Function Documentation

virtual int32 BQuery::CountEntries ( ) [virtual]

Returns the number of entries in the list.

Return values:
B_OKif successful
B_ENTRY_NOT_FOUNDwhen at the end of the list
B_ERRORor another error code (depending on the implementation of the derived class).

Implements BEntryList.

virtual int32 BQuery::GetNextDirents ( struct dirent *  buf,
size_t  length,
int32  count = INT_MAX 
) [virtual]

Returns the BEntryList's next entries as dirent structures.

Reads a number of entries into the array of dirent structures pointed to by buf. Reads as many but no more than count entries, as many entries as remain, or as many entries as will fit into the array at buf with given length length (in bytes), whichever is smallest.

Parameters:
bufA pointer to a buffer to be filled with dirent structures of the found entries.
lengthThe length of the buf array.
countthe maximum number of entries to be read.
Note:
The iterator used by this method is the same one used by GetNextEntry(), GetNextRef(), Rewind() and CountEntries().
Returns:
  • The number of dirent structures stored in the buffer or 0 when there are no more entries to be read.
  • an error code (depending on the implementation of the derived class) if an error occurred.

Implements BEntryList.

virtual status_t BQuery::GetNextEntry ( BEntry entry,
bool  traverse = false 
) [virtual]

Returns the BEntryList's next entry as a BEntry.

Places the next entry in the list in entry, traversing symlinks if traverse is true.

Parameters:
entrya pointer to a BEntry to be initialized with the found entry.
traversespecifies whether to follow it, if the found entry is a symbolic link.
Note:
The iterator used by this method is the same one used by GetNextRef(), GetNextDirents(), Rewind() and CountEntries().
Return values:
B_OKif successful
B_ENTRY_NOT_FOUNDwhen at the end of the list
B_ERRORor another error code (depending on the implementation of the derived class).

Implements BEntryList.

virtual status_t BQuery::GetNextRef ( entry_ref ref) [virtual]

Returns the BEntryList's next entry as an entry_ref.

Places an entry_ref to the next entry in the list into ref.

Parameters:
refa pointer to an entry_ref to be filled in with the data of the found entry.
Note:
The iterator used by this method is the same one used by GetNextEntry(), GetNextDirents(), Rewind() and CountEntries().
Return values:
B_OKif successful
B_ENTRY_NOT_FOUNDwhen at the end of the list
B_ERRORor another error code (depending on the implementation of the derived class).

Implements BEntryList.

virtual status_t BQuery::Rewind ( ) [virtual]

Rewinds the list pointer to the beginning of the list.

Return values:
B_OKif successful
B_ERRORor another error code (depending on the implementation of the derived class).

Implements BEntryList.


The Haiku Book pre-R1 - BQuery Class Reference
Generated on Sat May 12 2012 by Doxygen 1.7.3