changeset 477:628a5b8ff634

Revert to C++98 -- this library is not supposed to use C++11
author Chris Cannam
date Fri, 18 Nov 2016 14:02:49 +0000
parents 15348e89c1d7
children 0eebd22a081a
files src/vamp-hostsdk/Files.cpp src/vamp-hostsdk/PluginLoader.cpp
diffstat 2 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-hostsdk/Files.cpp	Fri Nov 18 12:53:21 2016 +0000
+++ b/src/vamp-hostsdk/Files.cpp	Fri Nov 18 14:02:49 2016 +0000
@@ -66,7 +66,7 @@
 vector<string>
 Files::listLibraryFiles()
 {
-    return listLibraryFilesMatching({});
+    return listLibraryFilesMatching(Filter());
 }
 
 vector<string>
@@ -78,7 +78,8 @@
     // we match case-insensitively, but only with ascii range
     // characters (input strings are expected to be utf-8)
     vector<string> libraryNames;
-    for (auto n: filter.libraryNames) {
+    for (int j = 0; j < int(filter.libraryNames.size()); ++j) {
+        string n = filter.libraryNames[j];
         for (size_t i = 0; i < n.length(); ++i) {
             if (!(n[i] & 0x80)) {
                 n[i] = char(tolower(n[i]));
@@ -97,9 +98,9 @@
             // we match case-insensitively, but only with ascii range
             // characters (this string is expected to be utf-8)
             string cleaned = *fi;
-            for (size_t i = 0; i < cleaned.length(); ++i) {
-                if (!(cleaned[i] & 0x80)) {
-                    cleaned[i] = char(tolower(cleaned[i]));
+            for (size_t j = 0; j < cleaned.length(); ++j) {
+                if (!(cleaned[j] & 0x80)) {
+                    cleaned[j] = char(tolower(cleaned[j]));
                 }
             }
 
@@ -119,8 +120,8 @@
                 break;
 
             case Filter::Matching:
-                for (const auto &n: libraryNames) {
-                    if (cleaned == n) {
+                for (int j = 0; j < int(libraryNames.size()); ++j) {
+                    if (cleaned == libraryNames[j]) {
                         matched = true;
                         break;
                     }
@@ -129,8 +130,8 @@
 
             case Filter::NotMatching:
                 matched = true;
-                for (const auto &n: libraryNames) {
-                    if (cleaned == n) {
+                for (int j = 0; j < int(libraryNames.size()); ++j) {
+                    if (cleaned == libraryNames[j]) {
                         matched = false;
                         break;
                     }
--- a/src/vamp-hostsdk/PluginLoader.cpp	Fri Nov 18 12:53:21 2016 +0000
+++ b/src/vamp-hostsdk/PluginLoader.cpp	Fri Nov 18 14:02:49 2016 +0000
@@ -213,11 +213,13 @@
 PluginLoader::PluginKeyList
 PluginLoader::Impl::listPlugins() 
 {
-    if (!m_allPluginsEnumerated) enumeratePlugins({});
+    if (!m_allPluginsEnumerated) enumeratePlugins(Enumeration());
 
     vector<PluginKey> plugins;
-    for (const auto &mi: m_pluginLibraryNameMap) {
-        plugins.push_back(mi.first);
+    for (map<PluginKey, string>::const_iterator i =
+             m_pluginLibraryNameMap.begin();
+         i != m_pluginLibraryNameMap.end(); ++i) {
+        plugins.push_back(i->first);
     }
 
     return plugins;
@@ -259,10 +261,11 @@
             std::cerr << "WARNING: Vamp::HostExt::PluginLoader: "
                       << "Invalid plugin key \"" << enumeration.key
                       << "\" in enumerate" << std::endl;
-            return {};
+            return vector<string>();
         }
         filter.type = Files::Filter::Matching;
-        filter.libraryNames = { libraryName };
+        filter.libraryNames.clear();
+        filter.libraryNames.push_back(libraryName);
         break;
     }