Tag Parser  6.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
helper.h
Go to the documentation of this file.
1 #ifndef TAGPARSER_TEST_HELPER
2 #define TAGPARSER_TEST_HELPER
3 
4 #include "../tagvalue.h"
5 
6 #include <ostream>
7 
8 std::ostream &operator <<(std::ostream &os, const Media::TagTextEncoding &encoding);
9 
13 inline std::ostream &operator <<(std::ostream &os, const Media::TagValue &tagValue)
14 {
15  return os << tagValue.toString(Media::TagTextEncoding::Utf8) << " (encoding: " << tagValue.dataEncoding() << ")";
16 }
17 
18 #endif // TAGPARSER_TEST_HELPER
The TagValue class wraps values of different types.
Definition: tagvalue.h:63
TagTextEncoding dataEncoding() const
Returns the data encoding.
Definition: tagvalue.h:475
std::ostream & operator<<(std::ostream &os, const Media::TagTextEncoding &encoding)
Prints a TagTextEncoding to enable CPPUNIT_ASSERT_EQUAL for tag values.
Definition: helper.cpp:6
TagTextEncoding
Specifies the text encoding.
Definition: tagvalue.h:21
std::string toString(TagTextEncoding encoding=TagTextEncoding::Unspecified) const
Converts the value of the current TagValue object to its equivalent std::string representation.
Definition: tagvalue.h:316