#ifndef TAG_PARSER_ABSTRACTCHAPTER_H #define TAG_PARSER_ABSTRACTCHAPTER_H #include "./localeawarestring.h" #include #include #include namespace TagParser { class Diagnostics; class TAG_PARSER_EXPORT AbstractChapter { public: virtual ~AbstractChapter(); std::uint64_t id() const; const std::vector &names() const; CppUtilities::TimeSpan startTime() const; CppUtilities::TimeSpan endTime() const; const std::vector &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); void parseNested(Diagnostics &diag); protected: AbstractChapter(); virtual void internalParse(Diagnostics &diag) = 0; std::uint64_t m_id; std::vector m_names; CppUtilities::TimeSpan m_startTime; CppUtilities::TimeSpan m_endTime; std::vector m_tracks; 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 &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 &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