1 #ifndef TAG_PARSER_ABSTRACTCONTAINER_H 2 #define TAG_PARSER_ABSTRACTCONTAINER_H 8 #include <c++utilities/chrono/datetime.h> 9 #include <c++utilities/chrono/timespan.h> 10 #include <c++utilities/io/binaryreader.h> 11 #include <c++utilities/io/binarywriter.h> 24 class AbstractChapter;
25 class AbstractAttachment;
27 class AbortableProgressFeedback;
33 std::iostream &stream();
34 void setStream(std::iostream &stream);
35 uint64 startOffset()
const;
36 IoUtilities::BinaryReader &reader();
37 IoUtilities::BinaryWriter &writer();
46 bool isHeaderParsed()
const;
47 bool areTagsParsed()
const;
48 bool areTracksParsed()
const;
49 bool areChaptersParsed()
const;
50 bool areAttachmentsParsed()
const;
53 virtual Tag *tag(std::size_t index);
54 virtual std::size_t tagCount()
const;
55 virtual bool removeTag(
Tag *tag);
56 virtual void removeAllTags();
60 virtual std::size_t trackCount()
const;
62 virtual void removeAllTracks();
63 virtual bool supportsTrackModifications()
const;
67 virtual std::size_t chapterCount()
const;
71 virtual std::size_t attachmentCount()
const;
74 uint64 readVersion()
const;
75 const std::string &documentType()
const;
76 uint64 doctypeVersion()
const;
77 uint64 doctypeReadVersion()
const;
78 const std::vector<std::string> &titles()
const;
79 void setTitle(
const std::string &
title, std::size_t segmentIndex = 0);
80 virtual bool supportsTitle()
const;
81 virtual std::size_t segmentCount()
const;
85 uint32 timeScale()
const;
92 virtual void internalParseHeader(
Diagnostics &diag);
94 virtual void internalParseTracks(
Diagnostics &diag);
95 virtual void internalParseChapters(
Diagnostics &diag);
96 virtual void internalParseAttachments(
Diagnostics &diag);
118 uint64 m_startOffset;
119 std::iostream *m_stream;
120 IoUtilities::BinaryReader m_reader;
121 IoUtilities::BinaryWriter m_writer;
138 m_reader.setStream(m_stream);
139 m_writer.setStream(m_stream);
147 return m_startOffset;
307 #endif // TAG_PARSER_ABSTRACTCONTAINER_H
const std::vector< std::string > & titles() const
Returns the title(s) of the file.
const std::string & documentType() const
Returns a string that describes the document type if available; otherwise returns an empty string...
uint64 readVersion() const
Returns the "read version" if known; otherwise returns 0.
ChronoUtilities::DateTime creationTime() const
Returns the creation time of the file if known; otherwise the returned date time is null...
std::iostream & stream()
Returns the related stream.
ChronoUtilities::DateTime m_creationTime
bool areChaptersParsed() const
Returns an indication whether the chapters have been parsed yet.
uint32 timeScale() const
Returns the time scale of the file if known; otherwise returns 0.
ChronoUtilities::DateTime modificationTime() const
Returns the modification time of the file if known; otherwise the returned date time is null...
bool isHeaderParsed() const
Returns an indication whether the header has been parsed yet.
ChronoUtilities::TimeSpan m_duration
uint64 version() const
Returns the version if known; otherwise returns 0.
Contains utility classes helping to read and write streams.
void setStream(std::iostream &stream)
Sets the related stream.
bool areAttachmentsParsed() const
Returns an indication whether the attachments have been parsed yet.
IoUtilities::BinaryWriter & writer()
Returns the related BinaryWriter.
void setTitle(const std::string &title, std::size_t segmentIndex=0)
Sets the title for the specified segment.
std::vector< std::string > m_titles
bool areTracksParsed() const
Returns an indication whether the tracks have been parsed yet.
uint64 m_doctypeReadVersion
TAG_PARSER_EXPORT const char * duration()
ChronoUtilities::DateTime m_modificationTime
IoUtilities::BinaryReader & reader()
Returns the related BinaryReader.
uint64 startOffset() const
Returns the start offset in the related stream.
uint64 doctypeVersion() const
Returns the document type version if known; otherwise returns 0.
uint64 doctypeReadVersion() const
Returns the document type "read version" if known; otherwise returns 0.
bool areTagsParsed() const
Returns an indication whether the tags have been parsed yet.
ChronoUtilities::TimeSpan duration() const
Returns the duration of the file if known; otherwise returns a time span of zero ticks.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TAG_PARSER_EXPORT const char * title()