Skip to content
Snippets Groups Projects
Commit 25c9bb33 authored by Ralf Haferkamp's avatar Ralf Haferkamp
Browse files

Declare ListType inside class definition

parent 9f3b0d60
Branches
Tags
No related merge requests found
......@@ -90,7 +90,7 @@ const LDAPAttribute* LDAPAttributeList::getAttributeByName(
DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::getAttributeByName()" << endl);
DEBUG(LDAP_DEBUG_TRACE | LDAP_DEBUG_PARAMETER,
" name:" << name << endl);
AttrList::const_iterator i;
LDAPAttributeList::const_iterator i;
for( i = m_attrs.begin(); i != m_attrs.end(); i++){
const std::string& tmpType = i->getName();
if(name.size() == tmpType.size()){
......@@ -112,7 +112,7 @@ void LDAPAttributeList::addAttribute(const LDAPAttribute& attr){
const std::string::size_type attrLen = attrType.size();
std::string::size_type tmpAttrLen = 0;
bool done=false;
AttrList::iterator i;
LDAPAttributeList::iterator i;
for( i=m_attrs.begin(); i != m_attrs.end(); i++ ){
const std::string tmpAttrType = i->getName();
tmpAttrLen = tmpAttrType.size();
......@@ -141,7 +141,7 @@ void LDAPAttributeList::addAttribute(const LDAPAttribute& attr){
LDAPMod** LDAPAttributeList::toLDAPModArray() const{
DEBUG(LDAP_DEBUG_TRACE,"LDAPAttribute::toLDAPModArray()" << endl);
LDAPMod **ret = (LDAPMod**) malloc((m_attrs.size()+1) * sizeof(LDAPMod*));
AttrList::const_iterator i;
LDAPAttributeList::const_iterator i;
int j=0;
for (i=m_attrs.begin(); i!= m_attrs.end(); i++, j++){
ret[j]=i->toLDAPMod();
......@@ -151,7 +151,7 @@ LDAPMod** LDAPAttributeList::toLDAPModArray() const{
}
ostream& operator << (ostream& s, const LDAPAttributeList& al){
AttrList::const_iterator i;
LDAPAttributeList::const_iterator i;
for(i=al.m_attrs.begin(); i!=al.m_attrs.end(); i++){
s << *i << "; ";
}
......
......@@ -15,18 +15,18 @@ class LDAPAttribute;
class LDAPAsynConnection;
class LDAPMsg;
typedef std::list<LDAPAttribute> AttrList;
/**
* This container class is used to store multiple LDAPAttribute-objects.
*/
class LDAPAttributeList{
typedef std::list<LDAPAttribute> ListType;
private :
AttrList m_attrs;
ListType m_attrs;
public :
typedef AttrList::const_iterator const_iterator;
typedef AttrList::iterator iterator;
typedef ListType::const_iterator const_iterator;
typedef ListType::iterator iterator;
/**
......
......@@ -10,8 +10,6 @@
class LDAPEntry;
typedef std::list<LDAPEntry> EntryList;
/**
* For internal use only.
*
......@@ -19,8 +17,10 @@ typedef std::list<LDAPEntry> EntryList;
* LDAPEntry-Objects
*/
class LDAPEntryList{
typedef std::list<LDAPEntry> ListType;
public:
typedef EntryList::const_iterator const_iterator;
typedef ListType::const_iterator const_iterator;
/**
* Copy-Constructor
......@@ -63,6 +63,6 @@ class LDAPEntryList{
void addEntry(const LDAPEntry& e);
private:
EntryList m_entries;
ListType m_entries;
};
#endif // LDAP_ENTRY_LIST_H
......@@ -28,7 +28,7 @@ LDAPMod** LDAPModList::toLDAPModArray(){
LDAPMod **ret = (LDAPMod**) malloc(
(m_modList.size()+1) * sizeof(LDAPMod*));
ret[m_modList.size()]=0;
ModList::const_iterator i;
LDAPModList::ListType::const_iterator i;
int j=0;
for (i=m_modList.begin(); i != m_modList.end(); i++ , j++){
ret[j]=i->toLDAPMod();
......
......@@ -11,18 +11,17 @@
#include <list>
#include <LDAPModification.h>
typedef std::list<LDAPModification> ModList;
/**
* This container class is used to store multiple LDAPModification-objects.
*/
class LDAPModList{
typedef std::list<LDAPModification> ListType;
public :
/**
* Constructs an empty list.
*/
LDAPModList();
LDAPModList();
/**
* Copy-constructor
......@@ -33,7 +32,7 @@ class LDAPModList{
* Adds one element to the end of the list.
* @param mod The LDAPModification to add to the std::list.
*/
void addModification(const LDAPModification &mod);
void addModification(const LDAPModification &mod);
/**
* Translates the list to a 0-terminated array of
......@@ -42,7 +41,7 @@ class LDAPModList{
LDAPMod** toLDAPModArray();
private :
ModList m_modList;
ListType m_modList;
};
#endif //LDAP_MOD_LIST_H
......
......@@ -10,16 +10,16 @@
class LDAPSearchReference;
typedef std::list<LDAPSearchReference> RefList;
/**
* Container class for storing a list of Search References
*
* Used internally only by LDAPSearchResults
*/
class LDAPReferenceList{
typedef std::list<LDAPSearchReference> ListType;
public:
typedef RefList::const_iterator const_iterator;
typedef ListType::const_iterator const_iterator;
/**
* Constructs an empty list.
......@@ -66,7 +66,7 @@ class LDAPReferenceList{
void addReference(const LDAPSearchReference& e);
private:
RefList m_refs;
ListType m_refs;
};
#endif // LDAP_REFERENCE_LIST_H
......@@ -11,7 +11,7 @@ using namespace std;
LDAPUrlList::LDAPUrlList(){
DEBUG(LDAP_DEBUG_CONSTRUCT," LDAPUrlList::LDAPUrlList()" << endl);
m_urls=UrlList();
m_urls=LDAPUrlList::ListType();
}
LDAPUrlList::LDAPUrlList(const LDAPUrlList& urls){
......
......@@ -9,14 +9,14 @@
#include <list>
#include <LDAPUrl.h>
typedef std::list<LDAPUrl> UrlList;
/**
* This container class is used to store multiple LDAPUrl-objects.
*/
class LDAPUrlList{
typedef std::list<LDAPUrl> ListType;
public:
typedef UrlList::const_iterator const_iterator;
typedef ListType::const_iterator const_iterator;
/**
* Constructs an empty list.
......@@ -72,6 +72,6 @@ class LDAPUrlList{
void add(const LDAPUrl& url);
private :
UrlList m_urls;
ListType m_urls;
};
#endif //LDAP_URL_LIST_H
......@@ -85,5 +85,5 @@ noinst_HEADERS = LDAPAddRequest.h \
LDAPSearchRequest.h
libldapcpp_la_LIBADD = -lldap -llber
libldapcpp_la_LDFLAGS = -version-info 0:1:0
libldapcpp_la_LDFLAGS = -version-info 0:2:0
......@@ -12,12 +12,12 @@ StringList::StringList(){
}
StringList::StringList(const StringList& sl){
m_data= ListType(sl.m_data);
m_data= StringList::ListType(sl.m_data);
}
StringList::StringList(char** values){
if(values == 0){
m_data=ListType();
m_data=StringList::ListType();
}else{
char** i;
for(i=values; *i != 0; i++){
......
......@@ -8,12 +8,12 @@
#include <string>
#include <list>
typedef std::list<std::string> ListType;
/**
* Container class to store multiple string-objects
*/
class StringList{
typedef std::list<std::string> ListType;
private:
ListType m_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment