3 * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPControlSet.h"
12 LDAPControlSet::LDAPControlSet(){
15 LDAPControlSet::LDAPControlSet(const LDAPControlSet& cs){
16 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet(&)" << endl);
20 LDAPControlSet::LDAPControlSet(LDAPControl** controls){
21 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet()" << endl);
24 for( i=controls; *i!=0;i++) {
30 LDAPControlSet::~LDAPControlSet(){
31 DEBUG(LDAP_DEBUG_DESTROY,"LDAPControlSet::~LDAPControlSet()" << endl);
34 size_t LDAPControlSet::size() const {
35 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::size()" << endl);
39 bool LDAPControlSet::empty() const {
40 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::empty()" << endl);
44 LDAPControlSet::const_iterator LDAPControlSet::begin() const{
45 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::begin()" << endl);
50 LDAPControlSet::const_iterator LDAPControlSet::end() const{
51 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::end()" << endl);
55 void LDAPControlSet::add(const LDAPCtrl& ctrl){
56 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::add()" << endl);
60 LDAPControl** LDAPControlSet::toLDAPControlArray() const{
61 DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::toLDAPControlArray()" << endl);
65 LDAPControl** ret= new LDAPControl*[data.size()+1];
66 CtrlList::const_iterator i;
68 for(i=data.begin(); i!=data.end(); i++,j++){
69 ret[j] = i->getControlStruct();
76 void LDAPControlSet::freeLDAPControlArray(LDAPControl **ctrl){
77 DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::freeLDAPControlArray()" << endl);
79 for( LDAPControl **i = ctrl; *i != 0; ++i ){
80 LDAPCtrl::freeLDAPControlStruct(*i);