id3lib 3.8.3
header_tag.h
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: header_tag.h,v 1.2 2002/07/31 13:20:49 t1mpy Exp $
3
4// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
5// Copyright 1999, 2000 Scott Thomas Haug
6// Copyright 2002 Thijmen Klok (thijmen@id3lib.org)
7
8// This library is free software; you can redistribute it and/or modify it
9// under the terms of the GNU Library General Public License as published by
10// the Free Software Foundation; either version 2 of the License, or (at your
11// option) any later version.
12//
13// This library is distributed in the hope that it will be useful, but WITHOUT
14// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16// License for more details.
17//
18// You should have received a copy of the GNU Library General Public License
19// along with this library; if not, write to the Free Software Foundation,
20// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22// The id3lib authors encourage improvements and optimisations to be sent to
23// the id3lib coordinator. Please see the README file for details on where to
24// send such submissions. See the AUTHORS file for a list of people who have
25// contributed to id3lib. See the ChangeLog file for a list of changes to
26// id3lib. These files are distributed with id3lib at
27// http://download.sourceforge.net/id3lib/
28
29#ifndef _ID3LIB_HEADER_TAG_H_
30#define _ID3LIB_HEADER_TAG_H_
31
32#include "header.h"
33
35{
36public:
37
38 enum
39 {
44 };
45
46 enum
47 {
52 };
53
55 virtual ~ID3_TagHeader() { ; }
56 ID3_TagHeader(const ID3_TagHeader& rhs) : ID3_Header() { *this = rhs; }
57
58 bool SetSpec(ID3_V2Spec);
59 size_t Size() const;
60 void Render(ID3_Writer&) const;
61 bool Parse(ID3_Reader&);
64 { this->ID3_Header::operator=(hdr); return *this; }
65
66 bool SetUnsync(bool b)
67 {
68 bool changed = _flags.set(HEADER_FLAG_UNSYNC, b);
69 _changed = _changed || changed;
70 return changed;
71 }
72 bool GetUnsync() const { return _flags.test(HEADER_FLAG_UNSYNC); }
73 bool SetExtended(bool b)
74 {
75 bool changed = _flags.set(HEADER_FLAG_EXTENDED, b);
76 _changed = _changed || changed;
77 return changed;
78 }
79 bool GetExtended() const { return _flags.test(HEADER_FLAG_EXTENDED); }
80 bool SetExperimental(bool b)
81 {
82 bool changed = _flags.set(HEADER_FLAG_EXPERIMENTAL, b);
83 _changed = _changed || changed;
84 return changed;
85 }
86 bool GetExperimental() const { return _flags.test(HEADER_FLAG_EXPERIMENTAL); }
87 bool SetFooter(bool b)
88 {
89 bool changed = _flags.set(HEADER_FLAG_FOOTER, b);
90 _changed = _changed || changed;
91 return changed;
92 }
93 bool GetFooter() const { return _flags.test(HEADER_FLAG_FOOTER); }
94
95 // id3v2 tag header signature: $49 44 33 MM mm GG ss ss ss ss
96 // MM = major version (will never be 0xFF)
97 // mm = minor version (will never be 0xFF)
98 // ff = flags byte
99 // ss = size bytes (less than $80)
100 static const char* const ID;
101 enum
102 {
108 SIZE = 10 // does not include extented headers
109 };
110
111};
112
113#endif /* _ID3LIB_HEADER_TAG_H_ */
bool _changed
Definition header.h:106
ID3_Header & operator=(const ID3_Header &rhs)
Definition header.h:90
ID3_Header()
Definition header.h:51
ID3_Flags _flags
Definition header.h:104
ID3_TagHeader(const ID3_TagHeader &rhs)
Definition header_tag.h:56
bool SetExperimental(bool b)
Definition header_tag.h:80
@ HEADER_FLAG_EXPERIMENTAL
Definition header_tag.h:42
void Render(ID3_Writer &) const
bool GetUnsync() const
Definition header_tag.h:72
bool Parse(ID3_Reader &)
ID3_TagHeader & operator=(const ID3_TagHeader &hdr)
Definition header_tag.h:63
void ParseExtended(ID3_Reader &)
static const char *const ID
Definition header_tag.h:100
virtual ~ID3_TagHeader()
Definition header_tag.h:55
bool SetFooter(bool b)
Definition header_tag.h:87
size_t Size() const
bool GetExtended() const
Definition header_tag.h:79
bool GetExperimental() const
Definition header_tag.h:86
bool SetSpec(ID3_V2Spec)
bool SetExtended(bool b)
Definition header_tag.h:73
bool SetUnsync(bool b)
Definition header_tag.h:66
bool GetFooter() const
Definition header_tag.h:93
ID3_V2Spec
Definition globals.h:162