svcore  1.9
PluginRDFIndexer.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2008 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef _PLUGIN_RDF_INDEXER_H_
17 #define _PLUGIN_RDF_INDEXER_H_
18 
19 #include <QString>
20 #include <QStringList>
21 #include <QMutex>
22 #include <map>
23 #include <set>
24 
25 namespace Dataquay {
26  class BasicStore;
27 }
28 
30 {
31 public:
32  static PluginRDFIndexer *getInstance();
33 
46  bool indexConfiguredURLs();
47 
48  bool indexURL(QString url); // in addition to "installed" URLs
49 
50  QString getURIForPluginId(QString pluginId);
51  QString getIdForPluginURI(QString uri);
52 
53  QStringList getIndexedPluginIds();
54 
55  const Dataquay::BasicStore *getIndex();
56 
58 
59 protected:
61  QMutex m_mutex;
62 
63  typedef std::map<QString, QString> StringMap;
66 
67  void indexInstalledURLs();
68 
69  bool pullFile(QString path);
70  bool pullURL(QString urlString);
71  bool reindex();
72 
73  Dataquay::BasicStore *m_index;
74 
76 };
77 
78 #endif
79 
QString getURIForPluginId(QString pluginId)
QString getIdForPluginURI(QString uri)
Dataquay::BasicStore * m_index
StringMap m_idToUriMap
const Dataquay::BasicStore * getIndex()
QStringList getIndexedPluginIds()
bool indexURL(QString url)
bool indexConfiguredURLs()
Index all URLs obtained from index files defined in the current settings.
StringMap m_uriToIdMap
static PluginRDFIndexer * getInstance()
bool pullFile(QString path)
std::map< QString, QString > StringMap
bool pullURL(QString urlString)
static PluginRDFIndexer * m_instance