From: Ralf Haferkamp Date: Tue, 3 Feb 2004 17:11:17 +0000 (+0000) Subject: Declare ListType inside class definition X-Git-Tag: OPENLDAP_REL_ENG_2_2_BP~438 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=25c9bb33c74d5f1afa7ed9ff347fa98052e68560;p=openldap Declare ListType inside class definition --- diff --git a/contrib/ldapc++/src/LDAPAttributeList.cpp b/contrib/ldapc++/src/LDAPAttributeList.cpp index 5d3b467748..235fef3a20 100644 --- a/contrib/ldapc++/src/LDAPAttributeList.cpp +++ b/contrib/ldapc++/src/LDAPAttributeList.cpp @@ -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 << "; "; } diff --git a/contrib/ldapc++/src/LDAPAttributeList.h b/contrib/ldapc++/src/LDAPAttributeList.h index 990a6d8c85..283ad60c68 100644 --- a/contrib/ldapc++/src/LDAPAttributeList.h +++ b/contrib/ldapc++/src/LDAPAttributeList.h @@ -15,18 +15,18 @@ class LDAPAttribute; class LDAPAsynConnection; class LDAPMsg; -typedef std::list AttrList; - /** * This container class is used to store multiple LDAPAttribute-objects. */ class LDAPAttributeList{ + typedef std::list 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; /** diff --git a/contrib/ldapc++/src/LDAPEntryList.h b/contrib/ldapc++/src/LDAPEntryList.h index c82fb02c2f..c65597e465 100644 --- a/contrib/ldapc++/src/LDAPEntryList.h +++ b/contrib/ldapc++/src/LDAPEntryList.h @@ -10,8 +10,6 @@ class LDAPEntry; -typedef std::list EntryList; - /** * For internal use only. * @@ -19,8 +17,10 @@ typedef std::list EntryList; * LDAPEntry-Objects */ class LDAPEntryList{ + typedef std::list 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 diff --git a/contrib/ldapc++/src/LDAPModList.cpp b/contrib/ldapc++/src/LDAPModList.cpp index d8bed4f685..a7674eb381 100644 --- a/contrib/ldapc++/src/LDAPModList.cpp +++ b/contrib/ldapc++/src/LDAPModList.cpp @@ -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(); diff --git a/contrib/ldapc++/src/LDAPModList.h b/contrib/ldapc++/src/LDAPModList.h index 313808d5dd..f62e814e09 100644 --- a/contrib/ldapc++/src/LDAPModList.h +++ b/contrib/ldapc++/src/LDAPModList.h @@ -11,18 +11,17 @@ #include #include -typedef std::list ModList; - /** * This container class is used to store multiple LDAPModification-objects. */ class LDAPModList{ + typedef std::list 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 diff --git a/contrib/ldapc++/src/LDAPReferenceList.h b/contrib/ldapc++/src/LDAPReferenceList.h index 0aa5a18219..fb289833b2 100644 --- a/contrib/ldapc++/src/LDAPReferenceList.h +++ b/contrib/ldapc++/src/LDAPReferenceList.h @@ -10,16 +10,16 @@ class LDAPSearchReference; -typedef std::list RefList; - /** * Container class for storing a list of Search References * * Used internally only by LDAPSearchResults */ class LDAPReferenceList{ + typedef std::list 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 diff --git a/contrib/ldapc++/src/LDAPUrlList.cpp b/contrib/ldapc++/src/LDAPUrlList.cpp index 037349a382..39129aa27f 100644 --- a/contrib/ldapc++/src/LDAPUrlList.cpp +++ b/contrib/ldapc++/src/LDAPUrlList.cpp @@ -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){ diff --git a/contrib/ldapc++/src/LDAPUrlList.h b/contrib/ldapc++/src/LDAPUrlList.h index 1247fc6ad1..2051c1c3e8 100644 --- a/contrib/ldapc++/src/LDAPUrlList.h +++ b/contrib/ldapc++/src/LDAPUrlList.h @@ -9,14 +9,14 @@ #include #include -typedef std::list UrlList; - /** * This container class is used to store multiple LDAPUrl-objects. */ class LDAPUrlList{ + typedef std::list 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 diff --git a/contrib/ldapc++/src/Makefile.am b/contrib/ldapc++/src/Makefile.am index d18fbe7e68..30b121e4ed 100644 --- a/contrib/ldapc++/src/Makefile.am +++ b/contrib/ldapc++/src/Makefile.am @@ -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 diff --git a/contrib/ldapc++/src/StringList.cpp b/contrib/ldapc++/src/StringList.cpp index c997c42dfd..1778cac027 100644 --- a/contrib/ldapc++/src/StringList.cpp +++ b/contrib/ldapc++/src/StringList.cpp @@ -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++){ diff --git a/contrib/ldapc++/src/StringList.h b/contrib/ldapc++/src/StringList.h index caa8ddd147..30f712bd83 100644 --- a/contrib/ldapc++/src/StringList.h +++ b/contrib/ldapc++/src/StringList.h @@ -8,12 +8,12 @@ #include #include -typedef std::list ListType; - /** * Container class to store multiple string-objects */ class StringList{ + typedef std::list ListType; + private: ListType m_data;