Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some macros to access the EBML ID/Context and use them
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@14 a6f86f6d-0131-4f8e-9e7b-e335508773d5
- Loading branch information
Showing
7 changed files
with
144 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
/**************************************************************************** | ||
** libebml : parse EBML files, see http://embl.sourceforge.net/ | ||
** | ||
** <file/class description> | ||
** | ||
** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. | ||
** | ||
** This file is part of libebml. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License as published by the Free Software Foundation; either | ||
** version 2.1 of the License, or (at your option) any later version. | ||
** | ||
** This library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this library; if not, write to the Free Software | ||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
** | ||
** See http://www.matroska.org/license/lgpl/ for LGPL licensing information. | ||
** | ||
** Contact license@matroska.org if any conditions of this licensing are | ||
** not clear to you. | ||
** | ||
**********************************************************************/ | ||
|
||
/*! | ||
\file | ||
\version \$Id: EbmlContexts.cpp 639 2004-07-09 20:59:14Z mosu $ | ||
\author Steve Lhomme <robux4 @ users.sf.net> | ||
*/ | ||
#include "ebml/EbmlContexts.h" | ||
#include "ebml/EbmlCrc32.h" | ||
#include "ebml/EbmlVoid.h" | ||
|
||
START_LIBEBML_NAMESPACE | ||
|
||
const EbmlSemantic EbmlGlobal_ContextList[2] = | ||
{ | ||
EbmlSemantic(false, false, EbmlCrc32::ClassInfos), ///< EbmlCrc32 | ||
EbmlSemantic(false, false, EbmlVoid::ClassInfos), ///< EbmlVoid | ||
}; | ||
|
||
const EbmlSemanticContext EbmlVoid_Context = EbmlSemanticContext(0, NULL, NULL, *GetEbmlGlobal_Context, NULL); | ||
|
||
static const EbmlSemanticContext EbmlGlobal_Context = EbmlSemanticContext(countof(EbmlGlobal_ContextList), EbmlGlobal_ContextList, NULL, *GetEbmlGlobal_Context, NULL); | ||
|
||
const EbmlSemanticContext & GetEbmlGlobal_Context() | ||
{ | ||
return EbmlGlobal_Context; | ||
} | ||
|
||
END_LIBEBML_NAMESPACE | ||
/**************************************************************************** | ||
** libebml : parse EBML files, see http://embl.sourceforge.net/ | ||
** | ||
** <file/class description> | ||
** | ||
** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. | ||
** | ||
** This file is part of libebml. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License as published by the Free Software Foundation; either | ||
** version 2.1 of the License, or (at your option) any later version. | ||
** | ||
** This library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this library; if not, write to the Free Software | ||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
** | ||
** See http://www.matroska.org/license/lgpl/ for LGPL licensing information. | ||
** | ||
** Contact license@matroska.org if any conditions of this licensing are | ||
** not clear to you. | ||
** | ||
**********************************************************************/ | ||
|
||
/*! | ||
\file | ||
\version \$Id: EbmlContexts.cpp 639 2004-07-09 20:59:14Z mosu $ | ||
\author Steve Lhomme <robux4 @ users.sf.net> | ||
*/ | ||
#include "ebml/EbmlContexts.h" | ||
#include "ebml/EbmlCrc32.h" | ||
#include "ebml/EbmlVoid.h" | ||
|
||
START_LIBEBML_NAMESPACE | ||
|
||
const EbmlSemantic EbmlGlobal_ContextList[2] = | ||
{ | ||
EbmlSemantic(false, false, EBML_INFO(EbmlCrc32)), ///< EbmlCrc32 | ||
EbmlSemantic(false, false, EBML_INFO(EbmlVoid)), ///< EbmlVoid | ||
}; | ||
|
||
const EbmlSemanticContext EbmlVoid_Context = EbmlSemanticContext(0, NULL, NULL, *GetEbmlGlobal_Context, NULL); | ||
|
||
static const EbmlSemanticContext EbmlGlobal_Context = EbmlSemanticContext(countof(EbmlGlobal_ContextList), EbmlGlobal_ContextList, NULL, *GetEbmlGlobal_Context, NULL); | ||
|
||
const EbmlSemanticContext & GetEbmlGlobal_Context() | ||
{ | ||
return EbmlGlobal_Context; | ||
} | ||
|
||
END_LIBEBML_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
/**************************************************************************** | ||
** libebml : parse EBML files, see http://embl.sourceforge.net/ | ||
** | ||
** <file/class description> | ||
** | ||
** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. | ||
** | ||
** This file is part of libebml. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License as published by the Free Software Foundation; either | ||
** version 2.1 of the License, or (at your option) any later version. | ||
** | ||
** This library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this library; if not, write to the Free Software | ||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
** | ||
** See http://www.matroska.org/license/lgpl/ for LGPL licensing information. | ||
** | ||
** Contact license@matroska.org if any conditions of this licensing are | ||
** not clear to you. | ||
** | ||
**********************************************************************/ | ||
|
||
/*! | ||
\file | ||
\version \$Id: EbmlSubHead.cpp 639 2004-07-09 20:59:14Z mosu $ | ||
\author Steve Lhomme <robux4 @ users.sf.net> | ||
*/ | ||
#include "ebml/EbmlSubHead.h" | ||
#include "ebml/EbmlContexts.h" | ||
|
||
START_LIBEBML_NAMESPACE | ||
|
||
EbmlId EVersion_TheId (0x4286, 2); | ||
EbmlId EReadVersion_TheId (0x42F7, 2); | ||
EbmlId EMaxIdLength_TheId (0x42F2, 2); | ||
EbmlId EMaxSizeLength_TheId (0x42F3, 2); | ||
EbmlId EDocType_TheId (0x4282, 2); | ||
EbmlId EDocTypeVersion_TheId (0x4287, 2); | ||
EbmlId EDocTypeReadVersion_TheId (0x4285, 2); | ||
|
||
const EbmlCallbacks EVersion::ClassInfos(EVersion::Create, EVersion_TheId, "EBMLVersion", EVersion_Context); | ||
const EbmlCallbacks EReadVersion::ClassInfos(EReadVersion::Create, EReadVersion_TheId, "EBMLReadVersion", EReadVersion_Context); | ||
const EbmlCallbacks EMaxIdLength::ClassInfos(EMaxIdLength::Create, EMaxIdLength_TheId, "EBMLMaxIdLength", EMaxIdLength_Context); | ||
const EbmlCallbacks EMaxSizeLength::ClassInfos(EMaxSizeLength::Create, EMaxSizeLength_TheId, "EBMLMaxSizeLength", EMaxSizeLength_Context); | ||
const EbmlCallbacks EDocType::ClassInfos(EDocType::Create, EDocType_TheId, "EBMLDocType", EDocType_Context); | ||
const EbmlCallbacks EDocTypeVersion::ClassInfos(EDocTypeVersion::Create, EDocTypeVersion_TheId, "EBMLDocTypeVersion", EDocTypeVersion_Context); | ||
const EbmlCallbacks EDocTypeReadVersion::ClassInfos(EDocTypeReadVersion::Create, EDocTypeReadVersion_TheId, "EBMLDocTypeReadVersion", EDocTypeReadVersion_Context); | ||
|
||
const EbmlSemanticContext EVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EVersion::ClassInfos); | ||
const EbmlSemanticContext EReadVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EReadVersion::ClassInfos); | ||
const EbmlSemanticContext EMaxIdLength_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EMaxIdLength::ClassInfos); | ||
const EbmlSemanticContext EMaxSizeLength_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EMaxSizeLength::ClassInfos); | ||
const EbmlSemanticContext EDocType_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EDocType::ClassInfos); | ||
const EbmlSemanticContext EDocTypeVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EDocTypeVersion::ClassInfos); | ||
const EbmlSemanticContext EDocTypeReadVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EDocTypeReadVersion::ClassInfos); | ||
|
||
END_LIBEBML_NAMESPACE | ||
/**************************************************************************** | ||
** libebml : parse EBML files, see http://embl.sourceforge.net/ | ||
** | ||
** <file/class description> | ||
** | ||
** Copyright (C) 2002-2004 Steve Lhomme. All rights reserved. | ||
** | ||
** This file is part of libebml. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License as published by the Free Software Foundation; either | ||
** version 2.1 of the License, or (at your option) any later version. | ||
** | ||
** This library is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
** Lesser General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU Lesser General Public | ||
** License along with this library; if not, write to the Free Software | ||
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
** | ||
** See http://www.matroska.org/license/lgpl/ for LGPL licensing information. | ||
** | ||
** Contact license@matroska.org if any conditions of this licensing are | ||
** not clear to you. | ||
** | ||
**********************************************************************/ | ||
|
||
/*! | ||
\file | ||
\version \$Id: EbmlSubHead.cpp 639 2004-07-09 20:59:14Z mosu $ | ||
\author Steve Lhomme <robux4 @ users.sf.net> | ||
*/ | ||
#include "ebml/EbmlSubHead.h" | ||
#include "ebml/EbmlContexts.h" | ||
|
||
START_LIBEBML_NAMESPACE | ||
|
||
EbmlId EVersion_TheId (0x4286, 2); | ||
EbmlId EReadVersion_TheId (0x42F7, 2); | ||
EbmlId EMaxIdLength_TheId (0x42F2, 2); | ||
EbmlId EMaxSizeLength_TheId (0x42F3, 2); | ||
EbmlId EDocType_TheId (0x4282, 2); | ||
EbmlId EDocTypeVersion_TheId (0x4287, 2); | ||
EbmlId EDocTypeReadVersion_TheId (0x4285, 2); | ||
|
||
const EbmlCallbacks EVersion::ClassInfos(EVersion::Create, EVersion_TheId, "EBMLVersion", EVersion_Context); | ||
const EbmlCallbacks EReadVersion::ClassInfos(EReadVersion::Create, EReadVersion_TheId, "EBMLReadVersion", EReadVersion_Context); | ||
const EbmlCallbacks EMaxIdLength::ClassInfos(EMaxIdLength::Create, EMaxIdLength_TheId, "EBMLMaxIdLength", EMaxIdLength_Context); | ||
const EbmlCallbacks EMaxSizeLength::ClassInfos(EMaxSizeLength::Create, EMaxSizeLength_TheId, "EBMLMaxSizeLength", EMaxSizeLength_Context); | ||
const EbmlCallbacks EDocType::ClassInfos(EDocType::Create, EDocType_TheId, "EBMLDocType", EDocType_Context); | ||
const EbmlCallbacks EDocTypeVersion::ClassInfos(EDocTypeVersion::Create, EDocTypeVersion_TheId, "EBMLDocTypeVersion", EDocTypeVersion_Context); | ||
const EbmlCallbacks EDocTypeReadVersion::ClassInfos(EDocTypeReadVersion::Create, EDocTypeReadVersion_TheId, "EBMLDocTypeReadVersion", EDocTypeReadVersion_Context); | ||
|
||
const EbmlSemanticContext EVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EVersion)); | ||
const EbmlSemanticContext EReadVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EReadVersion)); | ||
const EbmlSemanticContext EMaxIdLength_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EMaxIdLength)); | ||
const EbmlSemanticContext EMaxSizeLength_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EMaxSizeLength)); | ||
const EbmlSemanticContext EDocType_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EDocType)); | ||
const EbmlSemanticContext EDocTypeVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EDocTypeVersion)); | ||
const EbmlSemanticContext EDocTypeReadVersion_Context = EbmlSemanticContext(0, NULL, &EbmlHead_Context, *GetEbmlGlobal_Context, &EBML_INFO(EDocTypeReadVersion)); | ||
|
||
END_LIBEBML_NAMESPACE |