comparison plugin/PluginIdentifier.cpp @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
comparison
equal deleted inserted replaced
-1:000000000000 0:da6937383da8
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005
6
7 This is experimental software. Not for distribution.
8 */
9
10 /*
11 This is a modified version of a source file from the
12 Rosegarden MIDI and audio sequencer and notation editor.
13 This file copyright 2000-2005 Chris Cannam.
14 */
15
16 #include "PluginIdentifier.h"
17 #include <iostream>
18
19 QString
20 PluginIdentifier::createIdentifier(QString type,
21 QString soName,
22 QString label)
23 {
24 QString identifier = type + ":" + soName + ":" + label;
25 return identifier;
26 }
27
28 void
29 PluginIdentifier::parseIdentifier(QString identifier,
30 QString &type,
31 QString &soName,
32 QString &label)
33 {
34 type = identifier.section(':', 0, 0);
35 soName = identifier.section(':', 1, 1);
36 label = identifier.section(':', 2);
37 }
38
39 bool
40 PluginIdentifier::areIdentifiersSimilar(QString id1, QString id2)
41 {
42 QString type1, type2, soName1, soName2, label1, label2;
43
44 parseIdentifier(id1, type1, soName1, label1);
45 parseIdentifier(id2, type2, soName2, label2);
46
47 if (type1 != type2 || label1 != label2) return false;
48
49 bool similar = (soName1.section('/', -1).section('.', 0, 0) ==
50 soName2.section('/', -1).section('.', 0, 0));
51
52 return similar;
53 }
54
55 QString
56 PluginIdentifier::BUILTIN_PLUGIN_SONAME = "_builtin";
57
58 QString
59 PluginIdentifier::RESERVED_PROJECT_DIRECTORY_KEY = "__QMUL__:__RESERVED__:ProjectDirectoryKey";
60