~njh-aelius/maxosx/musicbrainz-tags

« back to all changes in this revision

Viewing changes to Frameworks/taglib/taglib/taglib/mpeg/id3v2/frames/unknownframe.cpp

  • Committer: stephen_booth
  • Date: 2008-04-30 02:09:12 UTC
  • Revision ID: svn-v4:6b6cea13-1402-0410-9567-a7afb52bf336:trunk:1372
Update to latest taglib SVN

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
 
19
 *   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
 
 
41
UnknownFrame::UnknownFrame(const ByteVector &data) : Frame(data)
 
42
{
 
43
  d = new UnknownFramePrivate;
 
44
  setData(data);
 
45
}
 
46
 
 
47
UnknownFrame::~UnknownFrame()
 
48
{
 
49
  delete d;
 
50
}
 
51
 
 
52
String UnknownFrame::toString() const
 
53
{
 
54
  return String::null;
 
55
}
 
56
 
 
57
ByteVector UnknownFrame::data() const
 
58
{
 
59
  return d->fieldData;
 
60
}
 
61
 
 
62
////////////////////////////////////////////////////////////////////////////////
 
63
// protected members
 
64
////////////////////////////////////////////////////////////////////////////////
 
65
 
 
66
void UnknownFrame::parseFields(const ByteVector &data)
 
67
{
 
68
  d->fieldData = data;
 
69
}
 
70
 
 
71
ByteVector UnknownFrame::renderFields() const
 
72
{
 
73
  return d->fieldData;
 
74
}
 
75
 
 
76
////////////////////////////////////////////////////////////////////////////////
 
77
// private members
 
78
////////////////////////////////////////////////////////////////////////////////
 
79
 
 
80
UnknownFrame::UnknownFrame(const ByteVector &data, Header *h) : Frame(h)
 
81
{
 
82
  d = new UnknownFramePrivate;
 
83
  parseFields(fieldData(data));
 
84
}