2018-03-06 23:09:15 +01:00
|
|
|
#ifndef TAG_PARSER_MATROSKACHAPTER_H
|
|
|
|
#define TAG_PARSER_MATROSKACHAPTER_H
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2015-09-06 19:57:33 +02:00
|
|
|
#include "../abstractchapter.h"
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
namespace TagParser {
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
class EbmlElement;
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
class TAG_PARSER_EXPORT MatroskaChapter : public AbstractChapter {
|
2015-04-22 19:22:01 +02:00
|
|
|
public:
|
|
|
|
MatroskaChapter(EbmlElement *chapterAtomElement);
|
2018-03-05 17:49:29 +01:00
|
|
|
~MatroskaChapter() override;
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2018-03-05 17:49:29 +01:00
|
|
|
MatroskaChapter *nestedChapter(std::size_t index) override;
|
|
|
|
const MatroskaChapter *nestedChapter(std::size_t index) const override;
|
|
|
|
std::size_t nestedChapterCount() const override;
|
|
|
|
void clear() override;
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
protected:
|
2021-02-04 23:21:50 +01:00
|
|
|
void internalParse(Diagnostics &diag, AbortableProgressFeedback &progress) override;
|
2015-04-22 19:22:01 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
EbmlElement *m_chapterAtomElement;
|
2018-03-07 01:17:50 +01:00
|
|
|
std::vector<std::unique_ptr<MatroskaChapter>> m_nestedChapters;
|
2015-04-22 19:22:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
inline MatroskaChapter *MatroskaChapter::nestedChapter(std::size_t index)
|
|
|
|
{
|
|
|
|
return m_nestedChapters[index].get();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const MatroskaChapter *MatroskaChapter::nestedChapter(std::size_t index) const
|
|
|
|
{
|
|
|
|
return m_nestedChapters[index].get();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline std::size_t MatroskaChapter::nestedChapterCount() const
|
|
|
|
{
|
|
|
|
return m_nestedChapters.size();
|
|
|
|
}
|
|
|
|
|
2018-03-07 01:17:50 +01:00
|
|
|
} // namespace TagParser
|
2015-04-22 19:22:01 +02:00
|
|
|
|
2018-03-06 23:09:15 +01:00
|
|
|
#endif // TAG_PARSER_MATROSKACHAPTER_H
|