comparison vamp-sdk/hostext/PluginLoader.cpp @ 73:6d16c376fd2f

* Make library name case-insensitive in PluginLoader * Some doc updates
author cannam
date Wed, 06 Jun 2007 12:49:55 +0000
parents 65add4f460e9
children 0f8524203677
comparison
equal deleted inserted replaced
72:65add4f460e9 73:6d16c376fd2f
210 210
211 for (vector<string>::iterator fi = files.begin(); 211 for (vector<string>::iterator fi = files.begin();
212 fi != files.end(); ++fi) { 212 fi != files.end(); ++fi) {
213 213
214 if (libraryName != "") { 214 if (libraryName != "") {
215 string::size_type pi = fi->find('.'); 215 // libraryName is lowercased and lacking an extension,
216 // as it came from the plugin key
217 string temp = *fi;
218 for (size_t i = 0; i < temp.length(); ++i) {
219 temp[i] = std::tolower(temp[i]);
220 }
221 string::size_type pi = temp.find('.');
216 if (pi == string::npos) { 222 if (pi == string::npos) {
217 if (libraryName != *fi) continue; 223 if (libraryName != temp) continue;
218 } else { 224 } else {
219 if (libraryName != fi->substr(0, pi)) continue; 225 if (libraryName != temp.substr(0, pi)) continue;
220 } 226 }
221 } 227 }
222 228
223 string fullPath = path[i]; 229 string fullPath = path[i];
224 fullPath = splicePath(fullPath, *fi); 230 fullPath = splicePath(fullPath, *fi);
258 } 264 }
259 265
260 PluginLoader::PluginKey 266 PluginLoader::PluginKey
261 PluginLoader::Impl::composePluginKey(string libraryName, string identifier) 267 PluginLoader::Impl::composePluginKey(string libraryName, string identifier)
262 { 268 {
263 //!!! deal with case issues
264
265 string basename = libraryName; 269 string basename = libraryName;
266 270
267 string::size_type li = basename.rfind('/'); 271 string::size_type li = basename.rfind('/');
268 if (li != string::npos) basename = basename.substr(li + 1); 272 if (li != string::npos) basename = basename.substr(li + 1);
269 273
270 li = basename.find('.'); 274 li = basename.find('.');
271 if (li != string::npos) basename = basename.substr(0, li); 275 if (li != string::npos) basename = basename.substr(0, li);
276
277 for (size_t i = 0; i < basename.length(); ++i) {
278 basename[i] = std::tolower(basename[i]);
279 }
272 280
273 return basename + ":" + identifier; 281 return basename + ":" + identifier;
274 } 282 }
275 283
276 bool 284 bool