add accessor APIs

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@11 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Steve Lhomme
2010-03-15 15:59:48 +00:00
parent eeb3b1d104
commit eea805cb01
4 changed files with 69 additions and 56 deletions

View File

@@ -263,6 +263,13 @@ class EBML_DLL_API EbmlElement {
*/
EbmlElement(const EbmlElement & ElementToClone);
uint64 GetDefaultSize() const {return DefaultSize;}
inline void SetSize_(uint64 aSize) {Size = aSize;}
inline void SetValueIsSet(bool Set = true) {bValueIsSet = Set;}
void SetDefaultIsSet(bool Set = true) {DefaultIsSet = Set;}
void SetSizeIsFinite(bool Set = true) {bSizeIsFinite = Set;}
uint64 GetSizePosition() const {return SizePosition;}
uint64 Size; ///< the size of the data to write
uint64 DefaultSize; ///< Minimum data size to fill on rendering (0 = optimal)
int SizeLength; /// the minimum size on which the size will be written (0 = optimal)

View File

@@ -75,6 +75,9 @@ class EBML_DLL_API EbmlId {
}
}
inline size_t GetLength() const { return Length; }
inline uint32 GetValue() const { return Value; }
uint32 Value;
size_t Length;
};

View File

@@ -117,6 +117,9 @@ class EBML_DLL_API EbmlMaster : public EbmlElement {
size_t ListSize() const {return ElementList.size();}
inline std::vector<EbmlElement *>::const_iterator begin() {return ElementList.begin();}
inline std::vector<EbmlElement *>::const_iterator end() {return ElementList.end();}
EbmlElement * operator[](unsigned int position) {return ElementList[position];}
const EbmlElement * operator[](unsigned int position) const {return ElementList[position];}

View File

@@ -1,56 +1,56 @@
/****************************************************************************
** 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: EbmlVersion.h 1326 2009-08-23 00:47:52Z robux4 $
\author Steve Lhomme <robux4 @ users.sf.net>
*/
#ifndef LIBEBML_VERSION_H
#define LIBEBML_VERSION_H
#include <string>
#include "EbmlConfig.h"
START_LIBEBML_NAMESPACE
#define LIBEBML_VERSION 0x000709
static const std::string EbmlCodeVersion = "0.7.9";
static const std::string EbmlCodeDate = __TIMESTAMP__;
/*!
\todo Closer relation between an element and the context it comes from (context is an element attribute ?)
*/
END_LIBEBML_NAMESPACE
#endif // LIBEBML_VERSION_H
/****************************************************************************
** 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: EbmlVersion.h 1326 2009-08-23 00:47:52Z robux4 $
\author Steve Lhomme <robux4 @ users.sf.net>
*/
#ifndef LIBEBML_VERSION_H
#define LIBEBML_VERSION_H
#include <string>
#include "EbmlConfig.h"
START_LIBEBML_NAMESPACE
#define LIBEBML_VERSION 0x000800
static const std::string EbmlCodeVersion = "0.8.0";
static const std::string EbmlCodeDate = __TIMESTAMP__;
/*!
\todo Closer relation between an element and the context it comes from (context is an element attribute ?)
*/
END_LIBEBML_NAMESPACE
#endif // LIBEBML_VERSION_H