1*2661106aSZhong Yang /*************************************************************************** 2*2661106aSZhong Yang copyright : (C) 2002 - 2008 by Scott Wheeler 3*2661106aSZhong Yang email : [email protected] 4*2661106aSZhong Yang ***************************************************************************/ 5*2661106aSZhong Yang 6*2661106aSZhong Yang /*************************************************************************** 7*2661106aSZhong Yang * This library is free software; you can redistribute it and/or modify * 8*2661106aSZhong Yang * it under the terms of the GNU Lesser General Public License version * 9*2661106aSZhong Yang * 2.1 as published by the Free Software Foundation. * 10*2661106aSZhong Yang * * 11*2661106aSZhong Yang * This library is distributed in the hope that it will be useful, but * 12*2661106aSZhong Yang * WITHOUT ANY WARRANTY; without even the implied warranty of * 13*2661106aSZhong Yang * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 14*2661106aSZhong Yang * Lesser General Public License for more details. * 15*2661106aSZhong Yang * * 16*2661106aSZhong Yang * You should have received a copy of the GNU Lesser General Public * 17*2661106aSZhong Yang * License along with this library; if not, write to the Free Software * 18*2661106aSZhong Yang * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 19*2661106aSZhong Yang * 02110-1301 USA * 20*2661106aSZhong Yang * * 21*2661106aSZhong Yang * Alternatively, this file is available under the Mozilla Public * 22*2661106aSZhong Yang * License Version 1.1. You may obtain a copy of the License at * 23*2661106aSZhong Yang * http://www.mozilla.org/MPL/ * 24*2661106aSZhong Yang ***************************************************************************/ 25*2661106aSZhong Yang 26*2661106aSZhong Yang #ifndef TAGLIB_UNKNOWNFRAME_H 27*2661106aSZhong Yang #define TAGLIB_UNKNOWNFRAME_H 28*2661106aSZhong Yang 29*2661106aSZhong Yang #include "id3v2frame.h" 30*2661106aSZhong Yang #include "taglib_export.h" 31*2661106aSZhong Yang 32*2661106aSZhong Yang namespace TagLib { 33*2661106aSZhong Yang 34*2661106aSZhong Yang namespace ID3v2 { 35*2661106aSZhong Yang 36*2661106aSZhong Yang //! A frame type \e unknown to TagLib. 37*2661106aSZhong Yang 38*2661106aSZhong Yang /*! 39*2661106aSZhong Yang * This class represents a frame type not known (or more often simply 40*2661106aSZhong Yang * unimplemented) in TagLib. This is here provide a basic API for 41*2661106aSZhong Yang * manipulating the binary data of unknown frames and to provide a means 42*2661106aSZhong Yang * of rendering such \e unknown frames. 43*2661106aSZhong Yang * 44*2661106aSZhong Yang * Please note that a cleaner way of handling frame types that TagLib 45*2661106aSZhong Yang * does not understand is to subclass ID3v2::Frame and ID3v2::FrameFactory 46*2661106aSZhong Yang * to have your frame type supported through the standard ID3v2 mechanism. 47*2661106aSZhong Yang */ 48*2661106aSZhong Yang 49*2661106aSZhong Yang class TAGLIB_EXPORT UnknownFrame : public Frame 50*2661106aSZhong Yang { 51*2661106aSZhong Yang friend class FrameFactory; 52*2661106aSZhong Yang 53*2661106aSZhong Yang public: 54*2661106aSZhong Yang UnknownFrame(const ByteVector &data); 55*2661106aSZhong Yang virtual ~UnknownFrame(); 56*2661106aSZhong Yang 57*2661106aSZhong Yang virtual String toString() const; 58*2661106aSZhong Yang 59*2661106aSZhong Yang /*! 60*2661106aSZhong Yang * Returns the field data (everything but the header) for this frame. 61*2661106aSZhong Yang */ 62*2661106aSZhong Yang ByteVector data() const; 63*2661106aSZhong Yang 64*2661106aSZhong Yang protected: 65*2661106aSZhong Yang virtual void parseFields(const ByteVector &data); 66*2661106aSZhong Yang virtual ByteVector renderFields() const; 67*2661106aSZhong Yang 68*2661106aSZhong Yang private: 69*2661106aSZhong Yang UnknownFrame(const ByteVector &data, Header *h); 70*2661106aSZhong Yang UnknownFrame(const UnknownFrame &); 71*2661106aSZhong Yang UnknownFrame &operator=(const UnknownFrame &); 72*2661106aSZhong Yang 73*2661106aSZhong Yang class UnknownFramePrivate; 74*2661106aSZhong Yang UnknownFramePrivate *d; 75*2661106aSZhong Yang }; 76*2661106aSZhong Yang 77*2661106aSZhong Yang } 78*2661106aSZhong Yang } 79*2661106aSZhong Yang #endif 80