MuseScore  3.4
Music composition and notation
revisions.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2010-2011 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __REVISIONS_H__
14 #define __REVISIONS_H__
15 
16 namespace Ms {
17 
18 class XmlWriter;
19 class XmlReader;
20 
21 //---------------------------------------------------------
22 // Revision
23 //---------------------------------------------------------
24 
25 class Revision {
26  QString _id;
27  QString _diff; // diff to parent
28  QDateTime _dateTime;
30  QList<Revision*> _branches;
31 
32  public:
33  Revision();
34  void read(XmlReader&);
35  void write(XmlWriter&) const;
36  void setParent(Revision* r) { _parent = r; }
37  Revision* parent() const { return _parent; }
38  const QList<Revision*>& branches() const { return _branches; }
39  void setId(const QString& s) { _id = s; }
40  void setDiff(const QString& s) { _diff = s; }
41  };
42 
43 //---------------------------------------------------------
44 // Revisions
45 // id: 2.3.1
46 // | | +-- revision of branch
47 // | +---- branch number
48 // +------ revision
49 //---------------------------------------------------------
50 
51 class Revisions {
53 
54  void write(XmlWriter&, const Revision*) const;
55 
56  public:
57  Revisions();
58  void add(Revision*);
59  QString getRevision(QString id);
60  Revision* trunk() { return _trunk; }
61  void write(XmlWriter&) const;
62  };
63 
64 
65 } // namespace Ms
66 #endif
67 
Revision * trunk()
Definition: revisions.h:60
Definition: revisions.h:25
Definition: xml.h:67
Definition: revisions.h:51
QList< Revision * > _branches
Definition: revisions.h:30
Revision * parent() const
Definition: revisions.h:37
const QList< Revision * > & branches() const
Definition: revisions.h:38
Revision * _trunk
Definition: revisions.h:52
Revision * _parent
Definition: revisions.h:29
Revision()
Definition: revisions.cpp:22
QString _diff
Definition: revisions.h:27
QDateTime _dateTime
Definition: revisions.h:28
Definition: aeolus.cpp:26
QString _id
Definition: revisions.h:26
Definition: xml.h:218
Definition: xmlwriter.h:26
void setDiff(const QString &s)
Definition: revisions.h:40
void setParent(Revision *r)
Definition: revisions.h:36
void write(XmlWriter &) const
Definition: revisions.cpp:32
Definition: xmlreader.h:28
void read(XmlReader &)
Definition: revisions.cpp:45
void setId(const QString &s)
Definition: revisions.h:39