-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathabstractchapter.h
133 lines (112 loc) · 3.07 KB
/
abstractchapter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef TAG_PARSER_ABSTRACTCHAPTER_H
#define TAG_PARSER_ABSTRACTCHAPTER_H
#include "./localeawarestring.h"
#include <c++utilities/chrono/timespan.h>
#include <memory>
#include <string>
#include <vector>
namespace TagParser {
class AbortableProgressFeedback;
class Diagnostics;
struct AbstractChapterPrivate;
class TAG_PARSER_EXPORT AbstractChapter {
public:
virtual ~AbstractChapter();
std::uint64_t id() const;
const std::vector<LocaleAwareString> &names() const;
CppUtilities::TimeSpan startTime() const;
CppUtilities::TimeSpan endTime() const;
const std::vector<std::uint64_t> &tracks() const;
bool isHidden() const;
bool isEnabled() const;
std::string label() const;
virtual AbstractChapter *nestedChapter(std::size_t index);
virtual const AbstractChapter *nestedChapter(std::size_t index) const;
virtual std::size_t nestedChapterCount() const;
virtual void clear();
void parse(Diagnostics &diag, AbortableProgressFeedback &progress);
void parseNested(Diagnostics &diag, AbortableProgressFeedback &progress);
protected:
AbstractChapter();
virtual void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress) = 0;
std::uint64_t m_id;
std::vector<LocaleAwareString> m_names;
CppUtilities::TimeSpan m_startTime;
CppUtilities::TimeSpan m_endTime;
std::vector<std::uint64_t> m_tracks;
std::unique_ptr<AbstractChapterPrivate> m_p;
bool m_hidden;
bool m_enabled;
};
/*!
* \brief Returns the chapter ID if known; otherwise returns zero.
*/
inline std::uint64_t AbstractChapter::id() const
{
return m_id;
}
/*!
* \brief Returns the chapter name.
*/
inline const std::vector<LocaleAwareString> &AbstractChapter::names() const
{
return m_names;
}
/*!
* \brief Returns the start time if known; otherwise returns a negative time span.
*/
inline CppUtilities::TimeSpan AbstractChapter::startTime() const
{
return m_startTime;
}
/*!
* \brief Returns the end time if known; otherwise returns a negative time span.
*/
inline CppUtilities::TimeSpan AbstractChapter::endTime() const
{
return m_endTime;
}
/*!
* \brief Returns a list of tracks on which the chapter applies.
*/
inline const std::vector<std::uint64_t> &AbstractChapter::tracks() const
{
return m_tracks;
}
/*!
* \brief Returns whether the chapter is flagged as hidden.
*/
inline bool AbstractChapter::isHidden() const
{
return m_hidden;
}
/*!
* \brief Returns whether the chapter is flagged as enabled.
*/
inline bool AbstractChapter::isEnabled() const
{
return m_enabled;
}
/*!
* \brief Returns the nested chapter with the specified \a index.
*/
inline AbstractChapter *AbstractChapter::nestedChapter(std::size_t)
{
return nullptr;
}
/*!
* \brief Returns the nested chapter with the specified \a index.
*/
inline const AbstractChapter *AbstractChapter::nestedChapter(std::size_t) const
{
return nullptr;
}
/*!
* \brief Returns the number of nested chapters.
*/
inline std::size_t AbstractChapter::nestedChapterCount() const
{
return 0;
}
} // namespace TagParser
#endif // TAG_PARSER_ABSTRACTCHAPTER_H