1 /***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
4 ***************************************************************************/
5
6 /***************************************************************************
7 * This library is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU Lesser General Public License version *
9 * 2.1 as published by the Free Software Foundation. *
10 * *
11 * This library is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the Free Software *
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 USA *
20 * *
21 * Alternatively, this file is available under the Mozilla Public *
22 * License Version 1.1. You may obtain a copy of the License at *
23 * http://www.mozilla.org/MPL/ *
24 ***************************************************************************/
25
26 #include "unknownframe.h"
27
28 using namespace TagLib;
29 using namespace ID3v2;
30
31 class UnknownFrame::UnknownFramePrivate
32 {
33 public:
34 ByteVector fieldData;
35 };
36
37 ////////////////////////////////////////////////////////////////////////////////
38 // public members
39 ////////////////////////////////////////////////////////////////////////////////
40
UnknownFrame(const ByteVector & data)41 UnknownFrame::UnknownFrame(const ByteVector &data) :
42 Frame(data),
43 d(new UnknownFramePrivate())
44 {
45 setData(data);
46 }
47
~UnknownFrame()48 UnknownFrame::~UnknownFrame()
49 {
50 delete d;
51 }
52
toString() const53 String UnknownFrame::toString() const
54 {
55 return String();
56 }
57
data() const58 ByteVector UnknownFrame::data() const
59 {
60 return d->fieldData;
61 }
62
63 ////////////////////////////////////////////////////////////////////////////////
64 // protected members
65 ////////////////////////////////////////////////////////////////////////////////
66
parseFields(const ByteVector & data)67 void UnknownFrame::parseFields(const ByteVector &data)
68 {
69 d->fieldData = data;
70 }
71
renderFields() const72 ByteVector UnknownFrame::renderFields() const
73 {
74 return d->fieldData;
75 }
76
77 ////////////////////////////////////////////////////////////////////////////////
78 // private members
79 ////////////////////////////////////////////////////////////////////////////////
80
UnknownFrame(const ByteVector & data,Header * h)81 UnknownFrame::UnknownFrame(const ByteVector &data, Header *h) :
82 Frame(h),
83 d(new UnknownFramePrivate())
84 {
85 parseFields(fieldData(data));
86 }
87