source: libmatroska/matroska/KaxDefines.h @ 1332

Revision 1332, 9.5 KB checked in by astrange, 4 years ago (diff)

Merge upstream libebml/libmatroska r491

New URL at  https://matroska.svn.sourceforge.net/svnroot/matroska.

More error checking in EbmlMaster::FindFirstElt?.
Should fix an abort in EbmlBinary::ReadData?. (but we might be missing a catch {} there)

Refs #223

Line 
1/****************************************************************************
2** libmatroska : parse Matroska files, see http://www.matroska.org/
3**
4** <file/class description>
5**
6** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
7**
8** This library is free software; you can redistribute it and/or
9** modify it under the terms of the GNU Lesser General Public
10** License as published by the Free Software Foundation; either
11** version 2.1 of the License, or (at your option) any later version.
12**
13** This library is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16** Lesser General Public License for more details.
17**
18** You should have received a copy of the GNU Lesser General Public
19** License along with this library; if not, write to the Free Software
20** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21**
22** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
23** Contact license@matroska.org if any conditions of this licensing are
24** not clear to you.
25**
26**********************************************************************/
27
28/*!
29        \file
30        \version \$Id$
31        \author Steve Lhomme     <robux4 @ users.sf.net>
32*/
33#ifndef LIBMATROSKA_DEFINES_H
34#define LIBMATROSKA_DEFINES_H
35
36#include "ebml/EbmlVersion.h"
37#include "ebml/EbmlElement.h"
38
39#if defined(HAVE_EBML2) || defined(HAS_EBML2)
40#define DEFINE_MKX_CONTEXT(a)                DEFINE_xxx_CONTEXT(a,EBML_SemanticGlobal)
41#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e)    DEFINE_xxx_MASTER_CONS(a,b,d,e,EBML_SemanticGlobal)
42#define DEFINE_MKX_MASTER(a,b,c,d,e)         DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticGlobal)
43#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d)    DEFINE_xxx_MASTER_ORPHAN(a,b,d,EBML_SemanticGlobal)
44#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,d,e,EBML_SemanticGlobal,v)
45#define DEFINE_MKX_UINTEGER(a,b,c,d,e)       DEFINE_xxx_UINTEGER(a,b,d,e,EBML_SemanticGlobal)
46#define DEFINE_MKX_SINTEGER(a,b,c,d,e)       DEFINE_xxx_SINTEGER(a,b,d,e,EBML_SemanticGlobal)
47#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e)  DEFINE_xxx_SINTEGER_CONS(a,b,d,e,EBML_SemanticGlobal)
48#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v)   DEFINE_xxx_STRING_DEF(a,b,d,e,EBML_SemanticGlobal,v)
49#define DEFINE_MKX_STRING(a,b,c,d,e)         DEFINE_xxx_STRING(a,b,d,e,EBML_SemanticGlobal)
50#define DEFINE_MKX_UNISTRING(a,b,c,d,e)      DEFINE_xxx_UNISTRING(a,b,d,e,EBML_SemanticGlobal)
51#define DEFINE_MKX_BINARY(a,b,c,d,e)         DEFINE_xxx_BINARY(a,b,d,e,EBML_SemanticGlobal)
52#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e)    DEFINE_xxx_BINARY_CONS(a,b,d,e,EBML_SemanticGlobal)
53#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v)    DEFINE_xxx_FLOAT_DEF(a,b,d,e,EBML_SemanticGlobal,v)
54#define DEFINE_MKX_FLOAT(a,b,c,d,e)          DEFINE_xxx_FLOAT(a,b,d,e,EBML_SemanticGlobal)
55#define DEFINE_MKX_FLOAT64(a,b,c,d,e)        DEFINE_xxx_FLOAT64(a,b,d,e,EBML_SemanticGlobal)
56#define DEFINE_MKX_DATE(a,b,c,d,e)           DEFINE_xxx_DATE(a,b,d,e,EBML_SemanticGlobal)
57
58#define DECLARE_MKX_CONTEXT(x)
59
60#define DECLARE_MKX_MASTER(x)     DECLARE_MKX_CONTEXT(x) \
61class MATROSKA_DLL_API x : public EbmlMaster { \
62    public: x(EBML_EXTRA_PARAM); \
63    x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
64    EBML_CONCRETE_CLASS(x)
65
66#define DECLARE_MKX_MASTER_CONS(x)     DECLARE_MKX_CONTEXT(x) \
67class MATROSKA_DLL_API x : public EbmlMaster { \
68    public: x(EBML_EXTRA_PARAM); \
69    x(const x & ElementToClone); \
70    EBML_CONCRETE_CLASS(x)
71
72#define DECLARE_MKX_BINARY(x)     DECLARE_MKX_CONTEXT(x) \
73  class MATROSKA_DLL_API x : public EbmlBinary { \
74    public: x(EBML_EXTRA_PARAM); \
75    x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
76    EBML_CONCRETE_CLASS(x)
77
78#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
79  class MATROSKA_DLL_API x : public EbmlBinary { \
80    public: x(EBML_EXTRA_PARAM); \
81    x(const x & ElementToClone); \
82    EBML_CONCRETE_CLASS(x)
83
84#define DECLARE_MKX_UNISTRING(x)  DECLARE_MKX_CONTEXT(x) \
85  class MATROSKA_DLL_API x : public EbmlUnicodeString { \
86    public: x(EBML_EXTRA_PARAM); \
87    x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
88    EBML_CONCRETE_CLASS(x)
89
90#define DECLARE_MKX_STRING(x)     DECLARE_MKX_CONTEXT(x) \
91  class MATROSKA_DLL_API x : public EbmlString { \
92    public: x(EBML_EXTRA_PARAM); \
93    x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
94    EBML_CONCRETE_CLASS(x)
95
96#define DECLARE_MKX_UINTEGER(x)   DECLARE_MKX_CONTEXT(x) \
97  class MATROSKA_DLL_API x : public EbmlUInteger { \
98    public: x(EBML_EXTRA_PARAM); \
99    x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
100    EBML_CONCRETE_CLASS(x)
101
102#define DECLARE_MKX_SINTEGER_CONS(x)   DECLARE_MKX_CONTEXT(x) \
103  class MATROSKA_DLL_API x : public EbmlSInteger { \
104    public: x(EBML_EXTRA_PARAM); \
105    x(const x & ElementToClone); \
106    EBML_CONCRETE_CLASS(x)
107
108#define DECLARE_MKX_SINTEGER(x)   DECLARE_MKX_CONTEXT(x) \
109  class MATROSKA_DLL_API x : public EbmlSInteger { \
110    public: x(EBML_EXTRA_PARAM); \
111    x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
112    EBML_CONCRETE_CLASS(x)
113
114#define DECLARE_MKX_DATE(x)       DECLARE_MKX_CONTEXT(x) \
115  class MATROSKA_DLL_API x : public EbmlDate { \
116    public: x(EBML_EXTRA_PARAM); \
117    x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
118    EBML_CONCRETE_CLASS(x)
119
120#define DECLARE_MKX_FLOAT(x)      DECLARE_MKX_CONTEXT(x) \
121  class MATROSKA_DLL_API x : public EbmlFloat { \
122    public: x(EBML_EXTRA_PARAM); \
123    x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
124    EBML_CONCRETE_CLASS(x)
125
126
127#else
128#define DEFINE_MKX_CONTEXT(a)                DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)
129#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e)    DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
130#define DEFINE_MKX_MASTER(a,b,c,d,e)         DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)
131#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d)    DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)
132#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
133#define DEFINE_MKX_UINTEGER(a,b,c,d,e)       DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
134#define DEFINE_MKX_SINTEGER(a,b,c,d,e)       DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
135#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v)   DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
136#define DEFINE_MKX_STRING(a,b,c,d,e)         DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
137#define DEFINE_MKX_UNISTRING(a,b,c,d,e)      DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
138#define DEFINE_MKX_BINARY(a,b,c,d,e)         DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
139#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v)    DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
140#define DEFINE_MKX_FLOAT(a,b,c,d,e)          DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
141#define DEFINE_MKX_DATE(a,b,c,d,e)           DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
142#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e)    DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
143#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e)  DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
144
145#define DECLARE_MKX_CONTEXT(x)
146
147#define DECLARE_MKX_MASTER(x)     DECLARE_MKX_CONTEXT(x) \
148class MATROSKA_DLL_API x : public EbmlMaster { \
149    public: x(); \
150    x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
151    EBML_CONCRETE_CLASS(x)
152
153#define DECLARE_MKX_MASTER_CONS(x)     DECLARE_MKX_CONTEXT(x) \
154class MATROSKA_DLL_API x : public EbmlMaster { \
155    public: x(); \
156    x(const x & ElementToClone); \
157    EBML_CONCRETE_CLASS(x)
158
159#define DECLARE_MKX_BINARY(x)     DECLARE_MKX_CONTEXT(x) \
160  class MATROSKA_DLL_API x : public EbmlBinary { \
161    public: x(); \
162    x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
163    EBML_CONCRETE_CLASS(x)
164
165#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
166  class MATROSKA_DLL_API x : public EbmlBinary { \
167    public: x(); \
168    x(const x & ElementToClone); \
169    EBML_CONCRETE_CLASS(x)
170
171#define DECLARE_MKX_UNISTRING(x)  DECLARE_MKX_CONTEXT(x) \
172  class MATROSKA_DLL_API x : public EbmlUnicodeString { \
173    public: x(); \
174    x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
175    EBML_CONCRETE_CLASS(x)
176
177#define DECLARE_MKX_STRING(x)     DECLARE_MKX_CONTEXT(x) \
178  class MATROSKA_DLL_API x : public EbmlString { \
179    public: x(); \
180    x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
181    EBML_CONCRETE_CLASS(x)
182
183#define DECLARE_MKX_UINTEGER(x)   DECLARE_MKX_CONTEXT(x) \
184  class MATROSKA_DLL_API x : public EbmlUInteger { \
185    public: x(); \
186    x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
187    EBML_CONCRETE_CLASS(x)
188
189#define DECLARE_MKX_SINTEGER_CONS(x)   DECLARE_MKX_CONTEXT(x) \
190  class MATROSKA_DLL_API x : public EbmlSInteger { \
191    public: x(); \
192    x(const x & ElementToClone); \
193    EBML_CONCRETE_CLASS(x)
194
195#define DECLARE_MKX_SINTEGER(x)   DECLARE_MKX_CONTEXT(x) \
196  class MATROSKA_DLL_API x : public EbmlSInteger { \
197    public: x(); \
198    x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
199    EBML_CONCRETE_CLASS(x)
200
201#define DECLARE_MKX_DATE(x)       DECLARE_MKX_CONTEXT(x) \
202  class MATROSKA_DLL_API x : public EbmlDate { \
203    public: x(); \
204    x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
205    EBML_CONCRETE_CLASS(x)
206
207#define DECLARE_MKX_FLOAT(x)      DECLARE_MKX_CONTEXT(x) \
208  class MATROSKA_DLL_API x : public EbmlFloat { \
209    public: x(); \
210    x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
211    EBML_CONCRETE_CLASS(x)
212
213#endif
214
215#endif // LIBMATROSKA_DEFINES_H
Note: See TracBrowser for help on using the repository browser.