ebml/EbmlElement.h File Reference

#include "EbmlTypes.h"
#include "EbmlId.h"
#include "IOCallback.h"
Include dependency graph for EbmlElement.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  EbmlCallbacks
class  EbmlSemantic
 contains the semantic informations for a given level and all sublevels More...
class  EbmlSemanticContext
class  EbmlElement
 Hold basic informations about an EBML element (ID + length). More...

Defines

#define DEFINE_xxx_CONTEXT(x, global)   const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, NULL, global, NULL); \
#define DEFINE_xxx_MASTER(x, id, idl, parent, name, global)
#define DEFINE_xxx_MASTER_CONS(x, id, idl, parent, name, global)
#define DEFINE_xxx_MASTER_ORPHAN(x, id, idl, name, global)
#define DEFINE_xxx_CLASS(x, id, idl, parent, name, global)
#define DEFINE_xxx_CLASS_CONS(x, id, idl, parent, name, global)
#define DEFINE_xxx_UINTEGER_DEF(x, id, idl, parent, name, global, defval)
#define DEFINE_xxx_STRING_DEF(x, id, idl, parent, name, global, defval)
#define DEFINE_xxx_FLOAT_DEF(x, id, idl, parent, name, global, defval)
#define DEFINE_xxx_CLASS_GLOBAL(x, id, idl, name, global)
#define DEFINE_xxx_CLASS_ORPHAN(x, id, idl, name, global)
#define DEFINE_EBML_CONTEXT(x)   DEFINE_xxx_CONTEXT(x,*GetEbmlGlobal_Context)
#define DEFINE_EBML_MASTER(x, id, idl, parent, name)   DEFINE_xxx_MASTER(x,id,idl,parent,name,*GetEbmlGlobal_Context)
#define DEFINE_EBML_MASTER_ORPHAN(x, id, idl, name)   DEFINE_xxx_MASTER_ORPHAN(x,id,idl,name,*GetEbmlGlobal_Context)
#define DEFINE_EBML_CLASS(x, id, idl, parent, name)   DEFINE_xxx_CLASS(x,id,idl,parent,name,*GetEbmlGlobal_Context)
#define DEFINE_EBML_CLASS_GLOBAL(x, id, idl, name)   DEFINE_xxx_CLASS_GLOBAL(x,id,idl,name,*GetEbmlGlobal_Context)
#define DEFINE_EBML_CLASS_ORPHAN(x, id, idl, name)   DEFINE_xxx_CLASS_ORPHAN(x,id,idl,name,*GetEbmlGlobal_Context)
#define DEFINE_EBML_UINTEGER_DEF(x, id, idl, parent, name, val)   DEFINE_xxx_UINTEGER_DEF(x,id,idl,parent,name,*GetEbmlGlobal_Context,val)
#define DEFINE_EBML_STRING_DEF(x, id, idl, parent, name, val)   DEFINE_xxx_STRING_DEF(x,id,idl,parent,name,*GetEbmlGlobal_Context,val)
#define DEFINE_EBML_BINARY_CONS(x, id, idl, parent, name)   DEFINE_xxx_CLASS_CONS(x,id,idl,parent,name,*GetEbmlGlobal_Context)
#define DEFINE_SEMANTIC_CONTEXT(x)
#define DEFINE_START_SEMANTIC(x)   static const EbmlSemantic ContextList_##x[] = {
#define DEFINE_END_SEMANTIC(x)   };
#define DEFINE_SEMANTIC_ITEM(m, u, c)   EbmlSemantic(m, u, EBML_INFO(c)),
#define DECLARE_EBML_MASTER(x)
#define DECLARE_EBML_UINTEGER(x)
#define DECLARE_EBML_STRING(x)
#define DECLARE_EBML_BINARY(x)
#define EBML_CONCRETE_CLASS(Type)
#define EBML_CONCRETE_DUMMY_CLASS(Type)
#define EBML_INFO(ref)   ref::ClassInfos
#define EBML_ID(ref)   ref::ClassInfos.GlobalId
#define EBML_CLASS_SEMCONTEXT(ref)   Context_##ref
#define EBML_CLASS_CONTEXT(ref)   ref::ClassInfos.Context
#define EBML_CLASS_CALLBACK(ref)   ref::ClassInfos
#define EBML_CONTEXT(e)   (e)->Generic().Context
#define EBML_NAME(e)   (e)->Generic().DebugName
#define EBML_INFO_ID(cb)   (cb).GlobalId
#define EBML_INFO_NAME(cb)   (cb).DebugName
#define EBML_INFO_CREATE(cb)   (cb).Create()
#define EBML_INFO_CONTEXT(cb)   (cb).Context
#define EBML_SEM_UNIQUE(s)   (s).Unique
#define EBML_SEM_CONTEXT(s)   (s).GetCallbacks.Context
#define EBML_SEM_CREATE(s)   (s).Create()
#define EBML_CTX_SIZE(c)   (c).Size
#define EBML_CTX_MASTER(c)   (c).MasterElt
#define EBML_CTX_PARENT(c)   (c).UpTable
#define EBML_CTX_IDX(c, i)   (c).MyTable[(i)]
#define EBML_CTX_IDX_INFO(c, i)   (c).MyTable[(i)].GetCallbacks
#define EBML_CTX_IDX_ID(c, i)   (c).MyTable[(i)].GetCallbacks.GlobalId
#define INVALID_FILEPOS_T   0
#define EBML_DEF_CONS
#define EBML_DEF_SEP
#define EBML_DEF_PARAM
#define EBML_DEF_BINARY_INIT
#define EBML_DEF_BINARY_CTX(x)
#define EBML_DEF_SINTEGER(x)
#define EBML_DEF_BINARY(x)
#define EBML_EXTRA_PARAM
#define EBML_EXTRA_CALL
#define EBML_EXTRA_DEF

Typedefs

typedef class
EbmlSemanticContext &(* 
_GetSemanticContext )()

Functions

START_LIBEBML_NAMESPACE int
EBML_DLL_API 
CodedSizeLength (uint64 Length, unsigned int SizeLength, bool bSizeIsFinite=true)
 The size of the EBML-coded length.
int EBML_DLL_API CodedValueLength (uint64 Length, int CodedSize, binary *OutBuffer)
 The coded value of the EBML-coded length.
uint64 EBML_DLL_API ReadCodedSizeValue (const binary *InBuffer, uint32 &BufferSize, uint64 &SizeUnknown)
 Read an EBML-coded value from a buffer.
int EBML_DLL_API CodedSizeLengthSigned (int64 Length, unsigned int SizeLength)
 The size of the EBML-coded signed length.
int EBML_DLL_API CodedValueLengthSigned (int64 Length, int CodedSize, binary *OutBuffer)
 The coded value of the EBML-coded signed length.
int64 EBML_DLL_API ReadCodedSizeSignedValue (const binary *InBuffer, uint32 &BufferSize, uint64 &SizeUnknown)
 Read a signed EBML-coded value from a buffer.

Variables

const EbmlSemanticContext Context_EbmlGlobal

Detailed Description

Version:
$Id: EbmlElement.h 280 2010-05-27 15:52:47Z robux4 $
Author:
Steve Lhomme <robux4 @ users.sf.net>

Define Documentation

#define DECLARE_EBML_BINARY (  ) 
Value:
class EBML_DLL_API x : public EbmlBinary { \
  public: \
    x();
#define DECLARE_EBML_MASTER (  ) 
Value:
class EBML_DLL_API x : public EbmlMaster { \
  public: \
    x();
#define DECLARE_EBML_STRING (  ) 
Value:
class EBML_DLL_API x : public EbmlString { \
  public: \
    x();
#define DECLARE_EBML_UINTEGER (  ) 
Value:
class EBML_DLL_API x : public EbmlUInteger { \
  public: \
    x();
#define DEFINE_xxx_CLASS ( x,
id,
idl,
parent,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
    x::x() {}
#define DEFINE_xxx_CLASS_CONS ( x,
id,
idl,
parent,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x);
#define DEFINE_xxx_CLASS_GLOBAL ( x,
id,
idl,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_EbmlGlobal); \
#define DEFINE_xxx_CLASS_ORPHAN ( x,
id,
idl,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, NULL, global, NULL); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
#define DEFINE_xxx_FLOAT_DEF ( x,
id,
idl,
parent,
name,
global,
defval   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
    x::x() :EbmlFloat(defval) {}
#define DEFINE_xxx_MASTER ( x,
id,
idl,
parent,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
    x::x() :EbmlMaster(Context_##x) {}
#define DEFINE_xxx_MASTER_CONS ( x,
id,
idl,
parent,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x);
#define DEFINE_xxx_MASTER_ORPHAN ( x,
id,
idl,
name,
global   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(countof(ContextList_##x), ContextList_##x, NULL, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
#define DEFINE_xxx_STRING_DEF ( x,
id,
idl,
parent,
name,
global,
defval   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
    x::x() :EbmlString(defval) {}
#define DEFINE_xxx_UINTEGER_DEF ( x,
id,
idl,
parent,
name,
global,
defval   ) 
Value:
const EbmlId Id_##x    (id, idl); \
    const EbmlSemanticContext Context_##x = EbmlSemanticContext(0, NULL, &Context_##parent, global, &EBML_INFO(x)); \
    const EbmlCallbacks x::ClassInfos(x::Create, Id_##x, name, Context_##x); \
    x::x() :EbmlUInteger(defval) {}
#define EBML_CONCRETE_CLASS ( Type   ) 
Value:
public: \
                virtual const EbmlCallbacks & Generic() const {return ClassInfos;} \
                virtual operator const EbmlId &() const {return ClassInfos.GlobalId;} \
        virtual EbmlElement & CreateElement() const {return Create();} \
        virtual EbmlElement * Clone() const { return new Type(*this); } \
                static EbmlElement & Create() {return *(new Type);} \
                static const EbmlCallbacks ClassInfos; \
#define EBML_CONCRETE_DUMMY_CLASS ( Type   ) 
Value:
public: \
                virtual const EbmlCallbacks & Generic() const {return ClassInfos;} \
                virtual operator const EbmlId &(); \
        virtual EbmlElement & CreateElement() const {return Create();} \
        virtual EbmlElement * Clone() const { return new Type(*this); } \
                static EbmlElement & Create() {return *(new Type);} \
                static const EbmlCallbacks ClassInfos; \

Function Documentation

START_LIBEBML_NAMESPACE int EBML_DLL_API CodedSizeLength ( uint64  Length,
unsigned int  SizeLength,
bool  bSizeFinite 
)

The size of the EBML-coded length.

Todo:
handle more than CodedSize of 5
int EBML_DLL_API CodedSizeLengthSigned ( int64  Length,
unsigned int  SizeLength 
)

The size of the EBML-coded signed length.

Todo:
handle more than CodedSize of 5
int EBML_DLL_API CodedValueLength ( uint64  Length,
int  CodedSize,
binary *  OutBuffer 
)

The coded value of the EBML-coded length.

Note:
The size of OutBuffer must be 8 octets at least
int EBML_DLL_API CodedValueLengthSigned ( int64  Length,
int  CodedSize,
binary *  OutBuffer 
)

The coded value of the EBML-coded signed length.

Note:
the size of OutBuffer must be 8 octets at least
int64 EBML_DLL_API ReadCodedSizeSignedValue ( const binary *  InBuffer,
uint32 &  BufferSize,
uint64 &  SizeUnknown 
)

Read a signed EBML-coded value from a buffer.

Returns:
the value read
uint64 EBML_DLL_API ReadCodedSizeValue ( const binary *  InBuffer,
uint32 &  BufferSize,
uint64 &  SizeUnknown 
)

Read an EBML-coded value from a buffer.

Returns:
the value read
 All Classes Files Functions Variables Enumerations Enumerator
Generated on Tue Jun 8 11:06:01 2010 for libebml by  doxygen 1.6.3