2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPControlSet.h"
9 LDAPControlSet::LDAPControlSet(){
12 LDAPControlSet::LDAPControlSet(const LDAPControlSet& cs){
13 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet(&)" << endl);
17 LDAPControlSet::LDAPControlSet(LDAPControl** controls){
18 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet()" << endl);
21 for( i=controls; *i!=0;i++) {
27 LDAPControlSet::~LDAPControlSet(){
28 DEBUG(LDAP_DEBUG_DESTROY,"LDAPControlSet::~LDAPControlSet()" << endl);
31 size_t LDAPControlSet::size() const {
32 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::size()" << endl);
36 LDAPControlSet::const_iterator LDAPControlSet::begin() const{
37 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::begin()" << endl);
42 LDAPControlSet::const_iterator LDAPControlSet::end() const{
43 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::end()" << endl);
47 void LDAPControlSet::add(const LDAPCtrl& ctrl){
48 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::add()" << endl);
52 LDAPControl** LDAPControlSet::toLDAPControlArray() const{
53 DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::toLDAPControlArray()" << endl);
57 LDAPControl** ret= new LDAPControl*[data.size()+1];
58 CtrlList::const_iterator i;
60 for(i=data.begin(); i!=data.end(); i++,j++){
61 ret[j] = i->getControlStruct();