libxspf  1.2.0
XspfExtensionReader.h
Go to the documentation of this file.
1 /*
2  * libxspf - XSPF playlist handling library
3  *
4  * Copyright (C) 2006-2008, Sebastian Pipping / Xiph.Org Foundation
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above
12  * copyright notice, this list of conditions and the following
13  * disclaimer.
14  *
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials
18  * provided with the distribution.
19  *
20  * * Neither the name of the Xiph.Org Foundation nor the names of
21  * its contributors may be used to endorse or promote products
22  * derived from this software without specific prior written
23  * permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
36  * OF THE POSSIBILITY OF SUCH DAMAGE.
37  *
38  * Sebastian Pipping, sping@xiph.org
39  */
40 
46 #ifndef XSPF_EXTENSION_READER_H
47 #define XSPF_EXTENSION_READER_H
48 
49 
50 #include "XspfDefines.h"
51 #include <string>
52 
53 namespace Xspf {
54 
55 
56 template <class T> class XspfStack;
57 class XspfReader;
58 class XspfExtension;
59 class XspfExtensionReaderPrivate;
60 class XspfExtensionReaderFactoryPrivate;
61 
62 
67 
68  friend class XspfReader;
69  friend class XspfReaderPrivate;
70  friend class XspfExtensionReaderFactory;
71  friend class XspfExtensionReaderFactoryPrivate;
72 
73 private:
75  XspfExtensionReaderPrivate * const d;
76 
78 public:
85 
92 
99 
104  virtual ~XspfExtensionReader();
105 
106 protected:
113  bool handleError(int code, XML_Char const * text);
114 
122  bool handleError(int code, XML_Char const * format, XML_Char const * param);
123 
130 
137 
144  bool handleXmlBaseAttribute(XML_Char const * xmlBase);
145 
146 protected:
155  virtual bool handleExtensionStart(XML_Char const * fullName,
156  XML_Char const ** atts) = 0;
157 
165  virtual bool handleExtensionEnd(XML_Char const * fullName) = 0;
166 
173  virtual bool handleExtensionCharacters(XML_Char const * s, int len) = 0;
174 
180  virtual XspfExtension * wrap() = 0;
181 
189  virtual XspfExtensionReader * createBrother(XspfReader * reader) const = 0;
190 
191 private:
200 
201 protected:
203  void virtualHook(int methodId, void * parameters);
205 
206 };
207 
208 
209 } // namespace Xspf
210 
211 #endif // XSPF_EXTENSION_READER_H
virtual bool handleExtensionStart(XML_Char const *fullName, XML_Char const **atts)=0
virtual XspfExtension * wrap()=0
virtual XspfExtensionReader * createBrother(XspfReader *reader) const =0
virtual bool handleExtensionEnd(XML_Char const *fullName)=0
virtual bool handleExtensionCharacters(XML_Char const *s, int len)=0
XspfExtensionReader & operator=(XspfExtensionReader const &source)
XspfStack< unsigned int > & getElementStack() const
XspfExtensionReader(XspfReader *reader)
bool handleError(int code, XML_Char const *text)
XspfStack< std::basic_string< XML_Char > > & getBaseUriStack() const
bool handleXmlBaseAttribute(XML_Char const *xmlBase)