2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPControlSet.h"
11 LDAPControlSet::LDAPControlSet(){
14 LDAPControlSet::LDAPControlSet(const LDAPControlSet& cs){
15 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet(&)" << endl);
19 LDAPControlSet::LDAPControlSet(LDAPControl** controls){
20 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet()" << endl);
23 for( i=controls; *i!=0;i++) {
29 LDAPControlSet::~LDAPControlSet(){
30 DEBUG(LDAP_DEBUG_DESTROY,"LDAPControlSet::~LDAPControlSet()" << endl);
33 size_t LDAPControlSet::size() const {
34 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::size()" << endl);
38 bool LDAPControlSet::empty() const {
39 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::empty()" << endl);
43 LDAPControlSet::const_iterator LDAPControlSet::begin() const{
44 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::begin()" << endl);
49 LDAPControlSet::const_iterator LDAPControlSet::end() const{
50 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::end()" << endl);
54 void LDAPControlSet::add(const LDAPCtrl& ctrl){
55 DEBUG(LDAP_DEBUG_TRACE,"LDAPControlSet::add()" << endl);
59 LDAPControl** LDAPControlSet::toLDAPControlArray() const{
60 DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::toLDAPControlArray()" << endl);
64 LDAPControl** ret= new LDAPControl*[data.size()+1];
65 CtrlList::const_iterator i;
67 for(i=data.begin(); i!=data.end(); i++,j++){
68 ret[j] = i->getControlStruct();
75 void LDAPControlSet::freeLDAPControlArray(LDAPControl **ctrl){
76 DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::freeLDAPControlArray()" << endl);
78 for( LDAPControl **i = ctrl; *i != 0; ++i ){
79 LDAPCtrl::freeLDAPControlStruct(*i);