Tag Parser
9.1.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Go to the documentation of this file. 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 std::uint64_t startOffset()
const;
36 CppUtilities::BinaryReader &reader();
37 CppUtilities::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 std::uint64_t readVersion()
const;
75 const std::string &documentType()
const;
76 std::uint64_t doctypeVersion()
const;
77 std::uint64_t 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 std::uint32_t 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 std::uint64_t m_startOffset;
119 std::iostream *m_stream;
120 CppUtilities::BinaryReader m_reader;
121 CppUtilities::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
The AbstractChapter class parses chapter information.
The AbstractAttachment class parses and stores attachment information.
constexpr const TAG_PARSER_EXPORT char * title()
CppUtilities::DateTime creationTime() const
Returns the creation time of the file if known; otherwise the returned date time is null.
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks....
std::uint64_t m_doctypeReadVersion
CppUtilities::DateTime m_modificationTime
bool areTracksParsed() const
Returns an indication whether the tracks have been parsed yet.
bool isHeaderParsed() const
Returns an indication whether the header has been parsed yet.
The Tag class is used to store, read and write tag information.
The Diagnostics class is a container for DiagMessage.
std::uint64_t doctypeReadVersion() const
Returns the document type "read version" if known; otherwise returns 0.
Contains all classes and functions of the TagInfo library.
std::uint64_t m_doctypeVersion
constexpr const TAG_PARSER_EXPORT char * duration()
const std::string & documentType() const
Returns a string that describes the document type if available; otherwise returns an empty string.
CppUtilities::DateTime m_creationTime
CppUtilities::DateTime modificationTime() const
Returns the modification time of the file if known; otherwise the returned date time is null.
std::uint64_t readVersion() const
Returns the "read version" if known; otherwise returns 0.
void setStream(std::iostream &stream)
Sets the related stream.
The AbstractContainer class provides an interface and common functionality to parse and make a certai...
void setTitle(const std::string &title, std::size_t segmentIndex=0)
Sets the title for the specified segment.
std::iostream & stream()
Returns the related stream.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
bool areTagsParsed() const
Returns an indication whether the tags have been parsed yet.
const std::vector< std::string > & titles() const
Returns the title(s) of the file.
bool areAttachmentsParsed() const
Returns an indication whether the attachments have been parsed yet.
bool areChaptersParsed() const
Returns an indication whether the chapters have been parsed yet.
std::uint64_t version() const
Returns the version if known; otherwise returns 0.
The TagTarget class specifies the target of a tag.
std::uint64_t doctypeVersion() const
Returns the document type version if known; otherwise returns 0.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
CppUtilities::BinaryReader & reader()
Returns the related BinaryReader.
std::uint32_t m_timeScale
CppUtilities::TimeSpan m_duration
CppUtilities::BinaryWriter & writer()
Returns the related BinaryWriter.
CppUtilities::TimeSpan duration() const
Returns the duration of the file if known; otherwise returns a time span of zero ticks.
std::vector< std::string > m_titles
std::uint64_t startOffset() const
Returns the start offset in the related stream.
std::uint32_t timeScale() const
Returns the time scale of the file if known; otherwise returns 0.
std::uint64_t m_readVersion