]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Migrate some users of Vector to std::vector
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Feb 2014 12:58:49 +0000 (13:58 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 10 Feb 2014 12:58:49 +0000 (13:58 +0100)
src/Notes.cc
src/Notes.h
src/StoreFileSystem.cc
src/StoreFileSystem.h
src/StoreHashIndex.h
src/acl/Acl.cc
src/acl/Acl.h
src/acl/NoteData.cc
src/adaptation/icap/Options.h
src/adaptation/icap/ServiceRep.cc

index b35029c6b99303f39bd2a54288a8d0f6b1e6bbc1..3a93ee3e5c49814f7eecad530e7e9029cf0121bf 100644 (file)
@@ -162,7 +162,7 @@ NotePairs::find(const char *noteKey) const
 {
     static String value;
     value.clean();
-    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(noteKey) == 0) {
             if (value.size())
                 value.append(", ");
@@ -177,7 +177,7 @@ NotePairs::toString(const char *sep) const
 {
     static String value;
     value.clean();
-    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         value.append((*i)->name);
         value.append(": ");
         value.append(ConfigParser::QuoteString((*i)->value));
@@ -189,7 +189,7 @@ NotePairs::toString(const char *sep) const
 const char *
 NotePairs::findFirst(const char *noteKey) const
 {
-    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(noteKey) == 0)
             return (*i)->value.termedBuf();
     }
@@ -219,7 +219,7 @@ NotePairs::addStrList(const char *key, const char *values)
 bool
 NotePairs::hasPair(const char *key, const char *value) const
 {
-    for (Vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = entries.begin(); i != entries.end(); ++i) {
         if ((*i)->name.cmp(key) == 0 && (*i)->value.cmp(value) == 0)
             return true;
     }
@@ -229,7 +229,7 @@ NotePairs::hasPair(const char *key, const char *value) const
 void
 NotePairs::append(const NotePairs *src)
 {
-    for (Vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
         entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf()));
     }
 }
@@ -237,7 +237,7 @@ NotePairs::append(const NotePairs *src)
 void
 NotePairs::appendNewOnly(const NotePairs *src)
 {
-    for (Vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::const_iterator  i = src->entries.begin(); i != src->entries.end(); ++i) {
         if (!hasPair((*i)->name.termedBuf(), (*i)->value.termedBuf()))
             entries.push_back(new NotePairs::Entry((*i)->name.termedBuf(), (*i)->value.termedBuf()));
     }
index f9e5ed0ce452b4720e4684e8eea29fc7da655cdb..f485cf717f50b3197f763d99619b3b6e50fa5794 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "acl/forward.h"
 #include "base/RefCount.h"
-#include "base/Vector.h"
 #include "CbDataList.h"
 #include "format/Format.h"
 #include "MemPool.h"
@@ -13,6 +12,7 @@
 #if HAVE_STRING
 #include <string>
 #endif
+#include <vector>
 
 class HttpRequest;
 class HttpReply;
@@ -40,7 +40,7 @@ public:
         explicit Value(const String &aVal) : value(aVal), aclList(NULL), valueFormat(NULL) {}
         ~Value();
     };
-    typedef Vector<Value::Pointer> Values;
+    typedef std::vector<Value::Pointer> Values;
 
     explicit Note(const String &aKey): key(aKey) {}
 
@@ -70,7 +70,7 @@ class ConfigParser;
 class Notes
 {
 public:
-    typedef Vector<Note::Pointer> NotesList;
+    typedef std::vector<Note::Pointer> NotesList;
     typedef NotesList::iterator iterator; ///< iterates over the notes list
     typedef NotesList::const_iterator const_iterator; ///< iterates over the notes list
 
@@ -184,7 +184,7 @@ public:
      */
     bool empty() const {return entries.empty();}
 
-    Vector<NotePairs::Entry *> entries;          ///< The key/value pair entries
+    std::vector<NotePairs::Entry *> entries;     ///< The key/value pair entries
 
 private:
     NotePairs &operator = (NotePairs const &); // Not implemented
index 293c37f4e20108fc934e2e450734c0fa7efbf8d0..fb73ae921c4bbb0d867591812046ec7156d4276d 100644 (file)
@@ -35,7 +35,7 @@
 #include "squid.h"
 #include "StoreFileSystem.h"
 
-Vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
+std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = NULL;
 
 void
 StoreFileSystem::RegisterAllFsWithCacheManager(void)
@@ -65,17 +65,17 @@ StoreFileSystem::FsAdd(StoreFileSystem &instance)
     GetFileSystems().push_back (&instance);
 }
 
-Vector<StoreFileSystem *> const &
+std::vector<StoreFileSystem *> const &
 StoreFileSystem::FileSystems()
 {
     return GetFileSystems();
 }
 
-Vector<StoreFileSystem*> &
+std::vector<StoreFileSystem*> &
 StoreFileSystem::GetFileSystems()
 {
     if (!_FileSystems)
-        _FileSystems = new Vector<StoreFileSystem *>;
+        _FileSystems = new std::vector<StoreFileSystem *>;
 
     return *_FileSystems;
 }
index 81dd906bb6371f4116aa65752ac314a009e7e3fd..3e45fefed9e81f5fae35e060a0d460268dc3f6c6 100644 (file)
@@ -116,9 +116,9 @@ public:
     static void SetupAllFs();
     static void FsAdd(StoreFileSystem &);
     static void FreeAllFs();
-    static Vector<StoreFileSystem*> const &FileSystems();
-    typedef Vector<StoreFileSystem*>::iterator iterator;
-    typedef Vector<StoreFileSystem*>::const_iterator const_iterator;
+    static std::vector<StoreFileSystem*> const &FileSystems();
+    typedef std::vector<StoreFileSystem*>::iterator iterator;
+    typedef std::vector<StoreFileSystem*>::const_iterator const_iterator;
     StoreFileSystem() : initialised(false) {}
 
     virtual ~StoreFileSystem() {}
@@ -136,8 +136,8 @@ protected:
     virtual void registerWithCacheManager(void);
 
 private:
-    static Vector<StoreFileSystem*> &GetFileSystems();
-    static Vector<StoreFileSystem*> *_FileSystems;
+    static std::vector<StoreFileSystem*> &GetFileSystems();
+    static std::vector<StoreFileSystem*> *_FileSystems;
     static void RegisterAllFsWithCacheManager(void);
 };
 
index 5a33860f484ee340a0fce308cdac53023ff59f28..22460566c72be9cac4fe130adad5896f85fa6ae8 100644 (file)
@@ -117,7 +117,7 @@ private:
     void *cbdata;
     bool _done;
     int bucket;
-    Vector<StoreEntry *> entries;
+    std::vector<StoreEntry *> entries;
 
     // keep this last. it plays with private/public
     CBDATA_CLASS2(StoreSearchHashIndex);
index 1e925e7542f02f858a5b91727322f478de462cc1..574d66a9ed79c7d9970353c558b57eb8dcaf0b05 100644 (file)
@@ -41,6 +41,8 @@
 #include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
+#include <vector>
+
 const ACLFlag ACLFlags::NoFlags[1] = {ACL_F_END};
 
 const char *AclMatchedName = NULL;
@@ -405,7 +407,7 @@ ACL::Prototype::Prototype (ACL const *aPrototype, char const *aType) : prototype
     registerMe ();
 }
 
-Vector<ACL::Prototype const *> * ACL::Prototype::Registry;
+std::vector<ACL::Prototype const *> * ACL::Prototype::Registry;
 void *ACL::Prototype::Initialized;
 
 bool
@@ -429,7 +431,7 @@ ACL::Prototype::registerMe ()
     if (!Registry || (Initialized != ((char *)Registry - 5))  ) {
         /* TODO: extract this */
         /* Not initialised */
-        Registry = new Vector <ACL::Prototype const *>;
+        Registry = new std::vector<ACL::Prototype const *>;
         Initialized = (char *)Registry - 5;
     }
 
index bef60f7dfbc504a9b1cb41ea621f5ba8927c34c0..6996348affa4faccd0e7a1e14c6854b9f006f81b 100644 (file)
@@ -34,7 +34,6 @@
 #define SQUID_ACL_H
 
 #include "acl/forward.h"
-#include "base/Vector.h"
 #include "cbdata.h"
 #include "defines.h"
 #include "dlink.h"
@@ -46,6 +45,7 @@
 #if HAVE_STRING
 #include <string>
 #endif
+#include <vector>
 
 class ConfigParser;
 
@@ -157,10 +157,10 @@ public:
         char const *typeString;
 
     private:
-        static Vector<Prototype const *> * Registry;
+        static std::vector<Prototype const *> * Registry;
         static void *Initialized;
-        typedef Vector<Prototype const*>::iterator iterator;
-        typedef Vector<Prototype const*>::const_iterator const_iterator;
+        typedef std::vector<Prototype const*>::iterator iterator;
+        typedef std::vector<Prototype const*>::const_iterator const_iterator;
         void registerMe();
     };
 
index ab4e4cfb67197083e0e1ca32dff4b7ba51762377..cb8b0322078b523807947341522465f8be805ee3 100644 (file)
@@ -29,7 +29,7 @@ ACLNoteData::matchNotes(NotePairs *note)
     if (values->empty())
         return (note->findFirst(name.termedBuf()) != NULL);
 
-    for (Vector<NotePairs::Entry *>::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) {
+    for (std::vector<NotePairs::Entry *>::iterator i = note->entries.begin(); i!= note->entries.end(); ++i) {
         if ((*i)->name.cmp(name.termedBuf()) == 0) {
             if (values->match((*i)->value.termedBuf()))
                 return true;
index 0a0f772cb3bd5d014c7c1f758987b11db57e23b8..0d7e96c4f3e4101740473aacbbe11719be6a225f 100644 (file)
@@ -71,7 +71,7 @@ public:
     const char *error; // human-readable information; set iff !valid()
 
     // ICAP server MUST supply this info
-    Vector<ICAP::Method> methods;
+    std::vector<ICAP::Method> methods;
     String istag;
 
     // ICAP server MAY supply this info. If not, Squid supplies defaults.
index ac295a767e916a0191652b98d7fdd2b725dd060f..4c4136c04c9826ce5da7fcec5d9c81ea9bbf27c1 100644 (file)
@@ -470,7 +470,7 @@ void Adaptation::Icap::ServiceRep::checkOptions()
     if (!theOptions->methods.empty()) {
         bool method_found = false;
         String method_list;
-        Vector <ICAP::Method>::iterator iter = theOptions->methods.begin();
+        std::vector <ICAP::Method>::iterator iter = theOptions->methods.begin();
 
         while (iter != theOptions->methods.end()) {