]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPUrlList.cpp
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LDAPUrlList.cpp
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2013 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #include "LDAPUrlList.h"
8 #include <assert.h>
9 #include "debug.h"
10
11 using namespace std;
12
13 LDAPUrlList::LDAPUrlList(){
14     DEBUG(LDAP_DEBUG_CONSTRUCT," LDAPUrlList::LDAPUrlList()" << endl);
15     m_urls=LDAPUrlList::ListType();
16 }
17
18 LDAPUrlList::LDAPUrlList(const LDAPUrlList& urls){
19     DEBUG(LDAP_DEBUG_CONSTRUCT," LDAPUrlList::LDAPUrlList(&)" << endl);
20     m_urls = urls.m_urls;
21 }
22
23
24 LDAPUrlList::LDAPUrlList(char** url){
25     DEBUG(LDAP_DEBUG_CONSTRUCT," LDAPUrlList::LDAPUrlList()" << endl);
26     char** i;
27     assert(url);
28     for(i = url; *i != 0; i++){
29         add(LDAPUrl(*i));
30     }
31 }
32
33 LDAPUrlList::~LDAPUrlList(){
34     DEBUG(LDAP_DEBUG_DESTROY," LDAPUrlList::~LDAPUrlList()" << endl);
35     m_urls.clear();
36 }
37
38 size_t LDAPUrlList::size() const{
39     return m_urls.size();
40 }
41
42 bool LDAPUrlList::empty() const{
43     return m_urls.empty();
44 }
45
46 LDAPUrlList::const_iterator LDAPUrlList::begin() const{
47     return m_urls.begin();
48 }
49
50 LDAPUrlList::const_iterator LDAPUrlList::end() const{
51     return m_urls.end();
52 }
53
54 void LDAPUrlList::add(const LDAPUrl& url){
55     m_urls.push_back(url);
56 }
57