2000-09-01 14:46:32 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_URL_LIST_H
|
|
|
|
|
#define LDAP_URL_LIST_H
|
|
|
|
|
|
|
|
|
|
#include <list>
|
2001-03-15 06:07:58 -05:00
|
|
|
#include <LDAPUrl.h>
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2000-10-03 14:25:34 -04:00
|
|
|
typedef list<LDAPUrl> UrlList;
|
2000-09-01 14:46:32 -04:00
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* This container class is used to store multiple LDAPUrl-objects.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
class LDAPUrlList{
|
|
|
|
|
public:
|
2001-03-15 06:07:58 -05:00
|
|
|
typedef UrlList::const_iterator const_iterator;
|
|
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* Constructs an empty list.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPUrlList();
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copy-constructor
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPUrlList(const LDAPUrlList& urls);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* For internal use only
|
|
|
|
|
*
|
|
|
|
|
* This constructor is used by the library internally to create a
|
|
|
|
|
* list of URLs from a array of C-strings that was return by
|
|
|
|
|
* the C-API
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
LDAPUrlList(char** urls);
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
~LDAPUrlList();
|
|
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* @return The number of LDAPUrl-objects that are currently
|
|
|
|
|
* stored in this list.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
size_t size() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
2001-09-07 13:43:55 -04:00
|
|
|
/**
|
|
|
|
|
* @return true if there are zero LDAPUrl-objects currently
|
|
|
|
|
* stored in this list.
|
|
|
|
|
*/
|
|
|
|
|
bool empty() const;
|
|
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* @return A iterator that points to the first element of the list.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
const_iterator begin() const;
|
2001-02-19 06:34:28 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return A iterator that points to the element after the last
|
|
|
|
|
* element of the list.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
const_iterator end() const;
|
|
|
|
|
|
2001-02-19 06:34:28 -05:00
|
|
|
/**
|
|
|
|
|
* Adds one element to the end of the list.
|
|
|
|
|
* @param attr The attribute to add to the list.
|
|
|
|
|
*/
|
2000-10-03 14:25:34 -04:00
|
|
|
void add(const LDAPUrl& url);
|
|
|
|
|
|
|
|
|
|
private :
|
|
|
|
|
UrlList m_urls;
|
|
|
|
|
};
|
2000-09-01 14:46:32 -04:00
|
|
|
#endif //LDAP_URL_LIST_H
|