Hello All
please help me understand the below code snippet,
LDAPControl** LDAPControlSet::toLDAPControlArray() const{
DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::toLDAPControlArray()" << endl);
if(data.empty()){
return 0;
}else{
LDAPControl** ret= new LDAPControl*[data.size()+1];
CtrlList::const_iterator i;
int j=0;
for(i=data.begin(); i!=data.end(); i++,j++){
ret[j] = i->getControlStruct();
}
ret[data.size()]=0;
return ret;
}
}
please note in the above code,
data and const_iterator are of list type (typedef by CtrlList), which is private member of the class
thanks.