svcore
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2008 QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _PLUGIN_RDF_INDEXER_H_ 00017 #define _PLUGIN_RDF_INDEXER_H_ 00018 00019 #include <QString> 00020 #include <QStringList> 00021 #include <QMutex> 00022 #include <map> 00023 #include <set> 00024 00025 namespace Dataquay { 00026 class BasicStore; 00027 } 00028 00029 class PluginRDFIndexer 00030 { 00031 public: 00032 static PluginRDFIndexer *getInstance(); 00033 00046 bool indexConfiguredURLs(); 00047 00048 bool indexURL(QString url); // in addition to "installed" URLs 00049 00050 QString getURIForPluginId(QString pluginId); 00051 QString getIdForPluginURI(QString uri); 00052 00053 QStringList getIndexedPluginIds(); 00054 00055 const Dataquay::BasicStore *getIndex(); 00056 00057 ~PluginRDFIndexer(); 00058 00059 protected: 00060 PluginRDFIndexer(); 00061 QMutex m_mutex; 00062 00063 typedef std::map<QString, QString> StringMap; 00064 StringMap m_uriToIdMap; 00065 StringMap m_idToUriMap; 00066 00067 void indexInstalledURLs(); 00068 00069 bool pullFile(QString path); 00070 bool pullURL(QString urlString); 00071 bool reindex(); 00072 00073 Dataquay::BasicStore *m_index; 00074 00075 static PluginRDFIndexer *m_instance; 00076 }; 00077 00078 #endif 00079