| 1 |
// $OpenLDAP$ |
| 2 |
/* |
| 3 |
* Copyright 2000-2024 The OpenLDAP Foundation, All Rights Reserved. |
| 4 |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef LDAP_ENTRY_LIST_H |
| 8 |
#define LDAP_ENTRY_LIST_H |
| 9 |
|
| 10 |
#include <cstdio> |
| 11 |
#include <list> |
| 12 |
|
| 13 |
class LDAPEntry; |
| 14 |
|
| 15 |
/** |
| 16 |
* For internal use only. |
| 17 |
* |
| 18 |
* This class is used by LDAPSearchResults to store a std::list of |
| 19 |
* LDAPEntry-Objects |
| 20 |
*/ |
| 21 |
class LDAPEntryList{ |
| 22 |
typedef std::list<LDAPEntry> ListType; |
| 23 |
|
| 24 |
public: |
| 25 |
typedef ListType::const_iterator const_iterator; |
| 26 |
|
| 27 |
/** |
| 28 |
* Copy-Constructor |
| 29 |
*/ |
| 30 |
LDAPEntryList(const LDAPEntryList& el); |
| 31 |
|
| 32 |
/** |
| 33 |
* Default-Constructor |
| 34 |
*/ |
| 35 |
LDAPEntryList(); |
| 36 |
|
| 37 |
/** |
| 38 |
* Destructor |
| 39 |
*/ |
| 40 |
~LDAPEntryList(); |
| 41 |
|
| 42 |
/** |
| 43 |
* @return The number of entries currently stored in the list. |
| 44 |
*/ |
| 45 |
size_t size() const; |
| 46 |
|
| 47 |
/** |
| 48 |
* @return true if there are zero entries currently stored in the list. |
| 49 |
*/ |
| 50 |
bool empty() const; |
| 51 |
|
| 52 |
/** |
| 53 |
* @return An iterator pointing to the first element of the list. |
| 54 |
*/ |
| 55 |
const_iterator begin() const; |
| 56 |
|
| 57 |
/** |
| 58 |
* @return An iterator pointing to the end of the list |
| 59 |
*/ |
| 60 |
const_iterator end() const; |
| 61 |
|
| 62 |
/** |
| 63 |
* Adds an Entry to the end of the list. |
| 64 |
*/ |
| 65 |
void addEntry(const LDAPEntry& e); |
| 66 |
|
| 67 |
private: |
| 68 |
ListType m_entries; |
| 69 |
}; |
| 70 |
#endif // LDAP_ENTRY_LIST_H |