Tag Parser 11.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
signature.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_SIGNATURE_H
2#define TAG_PARSER_SIGNATURE_H
3
4#include "./mediaformat.h"
5
6#include <cstdint>
7#include <string_view>
8
9namespace TagParser {
10
11enum class TagTargetLevel : std::uint8_t;
12
18enum class ContainerFormat : unsigned int {
19 Unknown,
20 Ac3Frames,
21 Adts,
22 Ar,
23 Asf,
24 Bzip2,
25 Dirac,
26 Ebml,
27 Elf,
28 Flac,
30 Gif87a,
31 Gif89a,
32 Gzip,
33 Id2v2Tag,
34 Ivf,
36 Jpeg,
37 Lha,
38 Lzip,
39 Lzw,
40 Matroska,
41 Midi,
43 Mp4,
45 Ogg,
47 Png,
49 QuickTime,
50 Rar,
51 Riff,
52 RiffAvi,
53 RiffWave,
54 SevenZ,
55 Tar,
58 Utf16Text,
59 Utf32Text,
60 Utf8Text,
61 WavPack,
62 Webm,
65 Xz,
66 YUV4Mpeg2,
67 Zip,
68};
69
70TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize);
71TAG_PARSER_EXPORT ContainerFormat parseSignature(std::string_view buffer);
72TAG_PARSER_EXPORT std::string_view containerFormatName(ContainerFormat containerFormat);
74 ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown, unsigned int version = 0);
75TAG_PARSER_EXPORT std::string_view containerFormatSubversion(ContainerFormat containerFormat);
76TAG_PARSER_EXPORT std::string_view containerMimeType(ContainerFormat containerFormat, MediaType mediaType = MediaType::Unknown);
77TAG_PARSER_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, std::uint64_t targetLevelValue);
78TAG_PARSER_EXPORT std::uint64_t containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel);
79
80inline ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize)
81{
82 return parseSignature(std::string_view(buffer, bufferSize));
83}
84
85} // namespace TagParser
86
87#endif // TAG_PARSER_SIGNATURE_H
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
constexpr TAG_PARSER_EXPORT std::string_view version()
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
TAG_PARSER_EXPORT std::string_view containerFormatSubversion(ContainerFormat containerFormat)
Returns the subversion of the container format as C-style string.
Definition: signature.cpp:478
@ PortableExecutable
Definition: signature.cpp:92
@ MpegAudioFrames
Definition: signature.cpp:91
@ WindowsBitmap
Definition: signature.cpp:94
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
Definition: tagtarget.h:16
TAG_PARSER_EXPORT std::string_view containerFormatAbbreviation(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown, unsigned int version=0)
Returns the abbreviation of the container format as C-style string considering the specified media ty...
Definition: signature.cpp:251
TAG_PARSER_EXPORT std::string_view containerFormatName(ContainerFormat containerFormat)
Returns the name of the specified container format as C-style string.
Definition: signature.cpp:373
TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize)
Definition: signature.h:80
TAG_PARSER_EXPORT std::string_view containerMimeType(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown)
Returns the MIME-type of the container format as C-style string.
Definition: signature.cpp:499
TAG_PARSER_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, std::uint64_t targetLevelValue)
Returns the general TagTargetLevel for the specified container format and raw targetLevelValue.
Definition: signature.cpp:572
@ TiffBigEndian
Definition: signature.cpp:59
@ PhotoshopDocument
Definition: signature.cpp:55
@ TiffLittleEndian
Definition: signature.cpp:60
@ MonkeysAudio
Definition: signature.cpp:52
@ JavaClassFile
Definition: signature.cpp:49
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Definition: mediaformat.h:14
TAG_PARSER_EXPORT std::uint64_t containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel)
Returns the raw target level value for the specified containerFormat and general targetLevel.
Definition: signature.cpp:586
ContainerFormat
Specifies the container format.
Definition: signature.h:18