30 #include "id3/utils.h" 46 _flags.set(HEADER_FLAG_EXPERIMENTAL, _info->is_experimental);
47 _flags.set(HEADER_FLAG_EXTENDED, _info->is_extended);
57 if (_info->is_extended)
59 bytesUsed += _info->extended_bytes;
78 if (_flags.test(HEADER_FLAG_EXTENDED))
89 for (
size_t i = 0; i < 6; ++i)
106 ID3D_NOTICE(
"ID3_TagHeader::Parse(): not an id3v2 header" );
118 _flags.set(static_cast<ID3_Flags::TYPE>(reader.
readChar()));
123 if (_flags.test(HEADER_FLAG_EXTENDED) && this->GetSpec() ==
ID3V2_2_1)
126 _flags.set(HEADER_FLAG_EXTENDED,
false);
127 _info->extended_bytes = 0;
155 _info->extended_bytes = 14;
158 _info->extended_bytes = 10;
171 const int extflagbytes = reader.
readChar();
173 for (i = 0; i < extflagbytes; ++i)
180 if (extflags[0]->test(EXT_HEADER_FLAG_BIT2))
185 const int extheaderflagdatasize = reader.
readChar();
186 extrabytes += extheaderflagdatasize;
191 if (extflags[0]->test(EXT_HEADER_FLAG_BIT3))
196 const int extheaderflagdatasize = reader.
readChar();
197 extrabytes += extheaderflagdatasize;
202 if (extflags[0]->test(EXT_HEADER_FLAG_BIT4))
207 const int extheaderflagdatasize = reader.
readChar();
208 extrabytes += extheaderflagdatasize;
213 _info->extended_bytes = 5 + extflagbytes + extrabytes;
217 _flags.set(HEADER_FLAG_EXTENDED,
false);
220 _data_size -= _info->extended_bytes;
221 _info->extended_bytes = 0;
ID3_C_EXPORT uint32 readUInt28(ID3_Reader &)
static size_t IsV2Tag(const uchar *)
Analyses a buffer to determine if we have a valid ID3v2 tag header.
virtual size_type writeChars(const char_type buf[], size_type len)=0
Write up to len characters into buf and advance the internal position accordingly.
void setExitPos(ID3_Reader::pos_type pos)
static const int_type END_OF_WRITER
uchar ID3_V2SpecToVer(ID3_V2Spec spec)
virtual pos_type getCur()=0
Return the current position in the reader.
virtual pos_type setCur(pos_type pos)=0
Set the value of the current position for reading.
ID3_C_EXPORT size_t writeUInt28(ID3_Writer &, uint32)
virtual size_type readChars(char_type buf[], size_type len)=0
Read up to len characters into buf and advance the internal position accordingly. ...
virtual int_type readChar()
Read a single character and advance the internal position.
ID3_V2Spec ID3_VerRevToV2Spec(uchar ver, uchar rev)
uchar ID3_V2SpecToRev(ID3_V2Spec spec)
ID3_C_EXPORT uint32 readBENumber(ID3_Reader &, size_t)
ID3_C_EXPORT size_t writeBENumber(ID3_Writer &, uint32 val, size_t)
virtual int_type writeChar(char_type ch)
Write a single character and advance the internal position.