libebml_ng
Classes | Typedefs | Functions | Variables
ebml Namespace Reference

Classes

class  _slot_t
 
class  c_ebmlElement_l
 Read-only list wrapper for EBML element shared pointers. More...
 
class  childElemHelper_t
 
class  childSlot_t
 A templated helper class managing a child slot within an EBML master element. More...
 
class  childSlot_t< ebmlElement >
 
class  childTypeSpec_t
 Specifies accepted child element types within a parent element. More...
 
struct  childTypeSpecArg_t
 Structure representing a single child type specification argument. More...
 
class  const_slot_t
 
struct  control_block
 
class  ebml_shared_ptr
 A drop-in replacement for std::shared_ptr tailored for EBML objects. More...
 
class  ebml_weak_ptr
 A drop-in replacement for std::weak_ptr tailored for EBML objects. More...
 
class  ebmlDataContinues
 
class  ebmlDataElement
 
class  ebmlDataElement< const T >
 
class  ebmlDataType
 Template class for EBML data types. More...
 
class  ebmlDataType< const T >
 
class  ebmlDecodeError
 
class  ebmlDocument
 
class  ebmlElement
 Abstract base class for EBML Element instances. More...
 
class  ebmlElementCRTP
 CRTP template for EBML Element instances. More...
 
class  ebmlElementType
 Abstract base class for EBML Element Type objects. More...
 
class  ebmlEncodeError
 
class  ebmlException
 
class  ebmlFormatError
 
class  ebmlInsertionError
 
class  ebmlInvalidVint
 
class  ebmlLazyLoad
 Represents an EBML Master Element with on-disk, transactional child management. More...
 
class  ebmlLazyLoadClass
 
class  ebmlLazyLoadSeekHelper
 
class  ebmlLazyLoadType
 A template class representing a lazy-loading EBML master element. More...
 
class  ebmlList
 
class  ebmlListType
 Represents a list-like EBML master element. More...
 
class  ebmlMap
 
class  ebmlMapType
 A template class representing a map-like EBML element type. More...
 
class  ebmlMasterElement
 Abstract base class for EBML master element instances.This class provides the functionality to manage child elements, perform encoding/decoding, and traverse child elements through iterators. It uses CRTP to enable type safety. More...
 
class  ebmlMasterElementType
 Represents the base type for all EBML master elements. More...
 
class  ebmlMoveError
 
class  ebmlNoChildMatch
 
class  ebmlNoMatch
 
class  ebmlNotImplementedError
 
class  ebmlPair
 
class  ebmlPairType
 A template class representing a key-value pair. More...
 
class  ebmlResizeError
 
class  ebmlSchema
 
class  ebmlStruct
 
class  ebmlStructType
 Represents a structure-like EBML master element. More...
 
class  ebmlTypeCRTP
 CRTP template for EBML Element Type objects. More...
 
class  ebmlUnexpectedEndOfData
 
class  ebmlVoid
 
class  ebmlVoidType
 Represents a void EBML element. More...
 
class  ebmlWriteError
 
struct  element_t
 
struct  extent_t
 
class  flexible_ptr
 A flexible pointer that can store either a strong (shared) or weak pointer. More...
 
class  io
 Template class that implements the ioBase interface. More...
 
class  ioBase
 Base class for file-like IO operations. More...
 
class  localReadLock_t
 
class  localWriteLock_t
 
struct  occurSpec_t
 Structure representing occurrence specifications. More...
 
class  parseFile
 Represents a parsed EBML file segment. More...
 
class  parseString
 Represents a parsed EBML string segment. More...
 
class  prepared_base_t
 
class  prepared_insert_t
 
class  prepared_move_t
 
class  prepared_multiinsert_t
 
class  prepared_remove_t
 
class  prepared_resize_t
 
struct  range_t
 
class  readLock_t
 
class  seekData_t
 Represents parsed seek data extracted from an EBML element. More...
 
class  seekDataWithKey_t
 A templated subclass of seekData_t that stores a key of type K. More...
 
class  seekHelper_t
 Helper class for creating and initializing seek data. More...
 
class  seekHelperByEBMLID
 Templated helper class for EBML elements that search for key data within child elements. More...
 
class  seekMap
 Container mapping keys to seek data objects with keys. More...
 
class  seekMapBase
 Base class for seek map containers. More...
 
struct  sizetree_t
 Structure representing the size tree for an EBML master element. More...
 
class  slot_t
 
class  slotArg_t
 
class  slotSpec_t
 
class  status_t
 
class  stopIteration
 
class  unicodeDecodeError
 
class  unicodeEncodeError
 
class  upgradedLock_t
 
class  writeLock_t
 

Typedefs

typedef ::ebml::ebmlDataType< unsigned long long > ebmlUnsignedIntegerType
 EBML Unsigned Integer Type. More...
 
typedef ::ebml::ebmlDataElement< unsigned long long > ebmlUnsignedInteger
 
typedef ::ebml::ebmlDataType< long long > ebmlSignedIntegerType
 EBML Signed Integer Type. More...
 
typedef ::ebml::ebmlDataElement< long long > ebmlSignedInteger
 
typedef ::ebml::ebmlDataType< double > ebmlFloatType
 EBML Float Type. More...
 
typedef ::ebml::ebmlDataElement< double > ebmlFloat
 
typedef ::ebml::ebmlDataType< std::string > ebmlBinaryType
 EBML Binary Type. More...
 
typedef ::ebml::ebmlDataElement< std::string > ebmlBinary
 
typedef ::ebml::ebmlDataType< std::wstring > ebmlUnicodeType
 EBML Unicode Type. More...
 
typedef ::ebml::ebmlDataElement< std::wstring > ebmlUnicode
 
typedef ::ebml::ebmlDataType< timepoint_tebmlDateTimeType
 EBML Date Type. More...
 
typedef ::ebml::ebmlDataElement< timepoint_tebmlDateTime
 
template<typename T >
using ebmlDataElement_sp = std::shared_ptr< ebmlDataElement< T > >
 
typedef flexible_ptr< ebmlElementebmlElement_fp
 
typedef flexible_ptr< ebmlMasterElementebmlMasterElement_fp
 
typedef uint64_t ebmlID_t
 
typedef uint8_t vintWidth_t
 
typedef std::vector< ebmlElement_spebmlElement_l
 
typedef std::list< childTypeSpecArg_tchildTypeSpecArg_l
 Alias for a list of child type specification arguments. More...
 
typedef std::initializer_list< childTypeSpecArg_tchildClassSpecArg_init_l
 Alias for an initializer list of child type specification arguments. More...
 
typedef std::unordered_map< ebmlID_t, const ebmlElementType * > ebmlElementClass_d
 Defines the mapping from EBML ID to ebmlElementType pointers. More...
 
typedef std::unordered_set< const ebmlElementType * > ebmlElementClass_s
 Defines a set of ebmlElementType pointers. More...
 
typedef std::unordered_map< ebmlID_t, occurSpec_toccurSpec_d
 Defines the mapping from EBML ID to occurrence specifications. More...
 
typedef std::unordered_map< ebmlID_t, unsigned long > occur_d
 
template<typename K , typename V , typename H = std::hash<K>, typename E = std::equal_to<K>, typename A = std::allocator<std::pair<const K, ebml::ptr<ebmlPair<const K, V>>>>>
using ebmlMapData = std::unordered_map< K, ebml::ptr< ebmlPair< const K, V > >, H, E, A >
 
template<typename K , typename V , typename H = std::hash<K>, typename E = std::equal_to<K>, typename B = std::allocator<std::pair<const K, pair_value_t<V>>>>
using ebmlMapArgs = std::unordered_map< K, pair_value_t< V >, H, E, B >
 
template<typename K , typename V >
using ebmlPair_sp = ebml::ptr< ebmlPair< K, V > >
 
template<typename K , typename V >
using c_ebmlPair_sp = ebml::ptr< const ebmlPair< K, V > >
 
template<typename K >
using pair_key_class_t = ebmlDataType< K >
 
template<typename K >
using pair_key_inst_t = ebmlDataElement< K >
 
template<typename V >
using pair_value_class_t = std::conditional_t< std::is_class< V >::value &&std::is_base_of< ebmlElement, V >::value, ebmlElementType, ebmlDataType< V > >
 
template<typename V >
using pair_value_inst_t = std::conditional_t< std::is_class< V >::value &&std::is_base_of< ebmlElement, V >::value, V, ebmlDataElement< V > >
 
template<typename V >
using pair_value_inst_sp = ebml::ptr< pair_value_inst_t< V > >
 
template<typename V >
using pair_value_t = std::conditional_t< std::is_class< V >::value &&std::is_base_of< ebmlElement, V >::value, ebml::ptr< V >, V >
 
template<typename V >
using pair_value_slot_t = std::conditional_t< std::is_class< V >::value &&std::is_base_of< ebmlElement, V >::value, childSlot_t< V >, V & >
 
template<typename V >
using pair_const_value_t = std::conditional_t< std::is_class< V >::value &&std::is_base_of< ebmlElement, V >::value, ebml::ptr< const V >, const V & >
 
typedef std::vector< slotSpec_tslotSpec_l
 
typedef std::list< slotArg_tslotArg_l
 
typedef std::unordered_map< std::string, slotArg_tslotArg_d
 
typedef ebml::ptr< ebmlStructebmlMultiSlot_sp
 
typedef ebml::ptr< const ebmlStructc_ebmlMultiSlot_sp
 
typedef std::map< off_t, std::unique_ptr< seekData_t > > children_m
 
typedef std::pair< ebmlElement_sp, seekData_t * > elem_seek_pair
 
typedef std::unique_lock< std::shared_mutex > globalWriteLock_t
 
template<typename T >
using ptr = ebml_shared_ptr< T >
 
template<typename T >
using wptr = ebml_weak_ptr< T >
 
typedef ptr< ebmlElementebmlElement_sp
 
typedef ptr< const ebmlElementc_ebmlElement_sp
 
typedef ptr< ebmlMasterElementebmlMasterElement_sp
 
typedef ptr< const ebmlMasterElementc_ebmlMasterElement_sp
 
typedef ptr< ebmlListebmlList_sp
 
typedef ptr< const ebmlListc_ebmlList_sp
 
typedef ptr< ebmlLazyLoadebmlLazyLoad_sp
 
typedef ptr< const ebmlLazyLoadc_ebmlLazyLoad_sp
 
typedef wptr< ebmlElementebmlElement_wp
 
typedef wptr< const ebmlElementc_ebmlElement_wp
 
typedef wptr< ebmlMasterElementebmlMasterElement_wp
 
typedef wptr< const ebmlMasterElementc_ebmlMasterElement_wp
 
typedef std::shared_ptr< ebmlDocumentebmlDocument_sp
 
typedef std::weak_ptr< ebmlDocumentebmlDocument_wp
 
typedef ptr< ioBaseioBase_sp
 
typedef std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > timepoint_t
 

Functions

template<typename T >
T & data (const ebmlElement_sp &elem)
 
template<typename T >
const T & data (const c_ebmlElement_sp &elem)
 
std::string make_exc_msg (const char *msg, unsigned int lineno, const char *file)
 
template<typename T >
data (const const_slot_t &slot)
 
template<typename T >
T & data (slot_t &slot)
 
void _parseFile (ioBase &file, ebmlID_t &ebmlID, unsigned char &ebmlIDWidth, size_t &dataSize, unsigned char &sizeWidth)
 
void _parseFile (ioBase &file, off_t offset, ebmlID_t &ebmlID, unsigned char &ebmlIDWidth, size_t &dataSize, unsigned char &sizeWidth)
 
template std::string parseFile::unpack< std::string > () const
 
template std::wstring parseFile::unpack< std::wstring > () const
 
void _parseString (const char *data, size_t size, ebmlID_t &ebmlID, unsigned char &ebmlIDWidth, size_t &dataSize, unsigned char &sizeWidth)
 
bool in_multrange (const std::map< char16_t, char16_t > &d, char16_t c)
 
std::wstring repr (const std::string &str)
 
bool in_multrange (const std::map< wchar_t, wchar_t > &d, wchar_t c)
 
std::wstring repr (const std::wstring &str)
 
std::wstring repr (unsigned long long n)
 
std::wstring repr (unsigned long n)
 
std::wstring repr (long long z)
 
std::wstring repr (long z)
 
std::wstring repr (double x)
 
std::wstring repr (timepoint_t t)
 
template<typename T >
std::wstring repr (const std::shared_ptr< T > &obj)
 
template<typename T >
std::wstring repr (const T &obj)
 
template<typename T >
std::wstring repr (T *const obj)
 
size_t size (const std::string &value)
 
size_t pack (const std::string &value, size_t size, char *dest)
 
size_t pack (const std::string &value, char *dest)
 
template<>
std::string unpack< std::string > (const char *src, size_t size)
 
size_t size (const timepoint_t &value)
 
size_t pack (const timepoint_t &value, size_t size, char *dest)
 
template<>
timepoint_t unpack< timepoint_t > (const char *src, size_t size)
 
 DEF_PACK_ALT (float)
 
 DEF_PACK_ALT (double)
 
 DEF_UNPACK (float)
 
 DEF_UNPACK (double)
 
 DEF_SIZE (long long)
 
 DEF_PACK (long long)
 
 DEF_UNPACK (long long)
 
 DEF_SIZE (unsigned long long)
 
 DEF_PACK (unsigned long long)
 
 DEF_UNPACK (unsigned long long)
 
size_t _size_utf8 (const std::wstring &value)
 
size_t _pack_utf8 (const std::wstring &value, size_t size, char *dest)
 
unsigned char utf8_char_width (unsigned char d)
 
bool detect_overlong_encode (const char *src, const unsigned char *masks)
 
std::wstring _unpack_utf8 (const char *src, size_t size)
 
size_t size (const std::wstring &value)
 
size_t pack (const std::wstring &value, size_t size, char *dest)
 
template<>
std::wstring unpack< std::wstring > (const char *src, size_t size)
 
void _reverse (char *s, unsigned int j, unsigned int k)
 Reverses the contents of a character array between indices [j, k]. More...
 
template<typename T >
size_t size (const T &value)
 Computes the size in bytes required to encode the given value. More...
 
template<typename T >
size_t pack (const T &value, char *dest)
 Packs the given value into a raw data buffer. More...
 
template<typename T >
size_t pack (const T &value, size_t size, char *dest)
 Packs the given value into a raw data buffer with a size constraint. More...
 
template<typename T >
std::string pack (const T &value)
 Packs the given value into a std::string. More...
 
template<typename T >
unpack (const char *src, size_t size)
 Unpacks a value of type T from a raw data buffer. More...
 
template<typename T >
unpack (const std::string &str)
 Unpacks a value of type T from a std::string. More...
 
template<typename T >
std::string typeof (const T *inst)
 
template<typename T >
std::string typeof ()
 
unsigned long long unpackVint (const char *data, size_t dataSize, unsigned char &vintw)
 Decodes a vint from a byte array of known size. More...
 
unsigned long long unpackVint (ioBase &file, unsigned char &vintw)
 Decodes a vint from an I/O stream. More...
 
unsigned long long unpackVint (ioBase &file, off_t offset, unsigned char &vintw)
 Decodes a vint from an I/O stream starting at a specified offset. More...
 
unsigned char vintWidth (char b)
 Determines the width (in bytes) of a variable-length integer (vint) based on its first byte. More...
 
unsigned char widthAsVint (unsigned long long n)
 Computes the minimal width (in bytes) required to encode an unsigned long long as a vint. More...
 
unsigned long long unpackVint (const char *data, unsigned char size)
 Decodes a variable-length integer (vint) from a byte array with a given size. More...
 
unsigned long long unpackVint (const char *data)
 Automatically detects the vint width and decodes the variable-length integer. More...
 
void packVint (unsigned long long n, unsigned char size, char *dest)
 Encodes an unsigned long long as a variable-length integer (vint) with a specified width. More...
 
unsigned char packVint (unsigned long long n, char *dest)
 Encodes an unsigned long long as a variable-length integer (vint) by automatically determining the required width. More...
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_dynamic_pointer_cast (const ebml_shared_ptr< U > &)
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_dynamic_pointer_cast (ebml_shared_ptr< U > &&)
 
template<typename T , typename U >
ebml_weak_ptr< T > ebml_dynamic_pointer_cast (const ebml_weak_ptr< U > &)
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_static_pointer_cast (const ebml_shared_ptr< U > &)
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_static_pointer_cast (ebml_shared_ptr< U > &&)
 
template<typename T , typename U >
ebml_weak_ptr< T > ebml_static_pointer_cast (const ebml_weak_ptr< U > &)
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_const_pointer_cast (const ebml_shared_ptr< U > &)
 
template<typename T , typename U >
ebml_shared_ptr< T > ebml_const_pointer_cast (ebml_shared_ptr< U > &&)
 

Variables

template<typename ebmlinst_t , typename parse_t >
concept has_init
 
template<typename ebmlinst_t , typename parse_t >
concept has_cinit
 
template<typename ebmlinst_t , typename... Args>
concept has_constructor
 
template<typename ebmlinst_t >
concept has_clone_method
 
const ebmlUnsignedIntegerType EBMLVersion = ebmlUnsignedIntegerType("\x42\x86", L"EBMLVersion", 1)
 
const ebmlUnsignedIntegerType EBMLReadVersion = ebmlUnsignedIntegerType("\x42\xf7", L"EBMLReadVersion", 1)
 
const ebmlUnsignedIntegerType EBMLMaxIDLength = ebmlUnsignedIntegerType("\x42\xf2", L"EBMLMaxIDLength", 4)
 
const ebmlUnsignedIntegerType EBMLMaxSizeLength = ebmlUnsignedIntegerType("\x42\xf3", L"EBMLMaxSizeLength", 8)
 
const ebmlBinaryType DocType = ebmlBinaryType("\x42\x82", L"DocType")
 
const ebmlUnsignedIntegerType DocTypeVersion = ebmlUnsignedIntegerType("\x42\x87", L"DocTypeVersion", 1)
 
const ebmlUnsignedIntegerType DocTypeReadVersion = ebmlUnsignedIntegerType("\x42\x85", L"DocTypeReadVersion", 1)
 
const ebmlStructType EBMLHead
 
ebmlVoidType Void
 
childElemHelper_t childHelper
 
static const std::unordered_map< char, std::wstring > special = {{0x27, L"\\'"}, {0x09, L"\\t"}, {0x10, L"\\n"}, {0x13, L"\\r"}, {0x92, L"\\\\"}}
 
static const std::map< char16_t, char16_t > x_ranges
 
static const std::unordered_map< wchar_t, std::wstring > special_unicode = {{0x27, L"\\'"}, {0x09, L"\\t"}, {0x10, L"\\n"}, {0x13, L"\\r"}, {0x92, L"\\\\"}}
 
static const std::map< wchar_t, wchar_t > x_ranges_unicode
 
static const std::map< wchar_t, wchar_t > u_ranges
 
static const std::map< wchar_t, wchar_t > U_ranges
 
seekHelper_t seekHelper
 
const timepoint_t epoch = timepoint_t(std::chrono::duration<long long, std::nano>(978307200000000000LL))
 
static const unsigned long long sizes [4] = {1LL << 7, 1LL << 11, 1LL << 16, 1LL << 21}
 
static const unsigned char fcp [4] = {0x00, 0xC0, 0xE0, 0xF0}
 
static const unsigned char fcm [4] = {0x80, 0xE0, 0xF0, 0xF8}
 
static const unsigned char overlong [4][3]
 
unsigned long long __one = 1
 
bool _is_littleendian = (((char*)&__one)[0] == 1)
 
const size_t UNKNOWN = 0xffffffffffffffffULL
 Special constant representing an unknown or maximum value. More...
 

Typedef Documentation

◆ c_ebmlElement_sp

Shared pointer to a const ebmlElement instance.

◆ c_ebmlElement_wp

Weak pointer to a const ebmlElement instance.

◆ c_ebmlLazyLoad_sp

Shared pointer to a const ebmlLazyLoad instance.

◆ c_ebmlList_sp

Shared pointer to a const ebmlList instance.

◆ c_ebmlMasterElement_sp

Shared pointer to a const ebmlMasterElement instance.

◆ c_ebmlMasterElement_wp

Weak pointer to a const ebmlElement instance.

◆ c_ebmlMultiSlot_sp

◆ c_ebmlPair_sp

template<typename K , typename V >
using ebml::c_ebmlPair_sp = typedef ebml::ptr<const ebmlPair<K, V> >

◆ childClassSpecArg_init_l

typedef std::initializer_list<childTypeSpecArg_t> ebml::childClassSpecArg_init_l

Alias for an initializer list of child type specification arguments.

◆ children_m

typedef std::map< off_t, std::unique_ptr< seekData_t > > ebml::children_m

◆ childTypeSpecArg_l

Alias for a list of child type specification arguments.

◆ ebmlBinary

typedef ::ebml::ebmlDataElement< std::string > ebml::ebmlBinary

◆ ebmlDataElement_sp

template<typename T >
using ebml::ebmlDataElement_sp = typedef std::shared_ptr<ebmlDataElement<T> >

◆ ebmlDateTime

◆ ebmlDocument_sp

typedef std::shared_ptr<ebmlDocument> ebml::ebmlDocument_sp

Shared pointer to an ebmlDocument instance.

◆ ebmlDocument_wp

typedef std::weak_ptr<ebmlDocument> ebml::ebmlDocument_wp

Weak pointer to an ebmlDocument instance.

◆ ebmlElement_fp

◆ ebmlElement_l

typedef std::vector<ebmlElement_sp> ebml::ebmlElement_l

◆ ebmlElement_sp

Shared pointer to an ebmlElement instance.

◆ ebmlElement_wp

Weak pointer to an ebmlElement instance.

◆ ebmlElementClass_d

typedef std::unordered_map<ebmlID_t, const ebmlElementType *> ebml::ebmlElementClass_d

Defines the mapping from EBML ID to ebmlElementType pointers.

◆ ebmlElementClass_s

typedef std::unordered_set<const ebmlElementType *> ebml::ebmlElementClass_s

Defines a set of ebmlElementType pointers.

◆ ebmlFloat

◆ ebmlID_t

typedef uint64_t ebml::ebmlID_t

◆ ebmlLazyLoad_sp

Shared pointer to an ebmlLazyLoad instance.

◆ ebmlList_sp

Shared pointer to an ebmlList instance.

◆ ebmlMapArgs

template<typename K , typename V , typename H = std::hash<K>, typename E = std::equal_to<K>, typename B = std::allocator<std::pair<const K, pair_value_t<V>>>>
using ebml::ebmlMapArgs = typedef std::unordered_map<K, pair_value_t<V>, H, E, B>

◆ ebmlMapData

template<typename K , typename V , typename H = std::hash<K>, typename E = std::equal_to<K>, typename A = std::allocator<std::pair<const K, ebml::ptr<ebmlPair<const K, V>>>>>
using ebml::ebmlMapData = typedef std::unordered_map<K, ebml::ptr<ebmlPair<const K, V> >, H, E, A>

◆ ebmlMasterElement_fp

◆ ebmlMasterElement_sp

Shared pointer to an ebmlMasterElement instance.

◆ ebmlMasterElement_wp

Weak pointer to an ebmlElement instance.

◆ ebmlMultiSlot_sp

◆ ebmlPair_sp

template<typename K , typename V >
using ebml::ebmlPair_sp = typedef ebml::ptr<ebmlPair<K, V> >

◆ ebmlSignedInteger

◆ ebmlUnicode

typedef ::ebml::ebmlDataElement< std::wstring > ebml::ebmlUnicode

◆ ebmlUnsignedInteger

typedef ::ebml::ebmlDataElement< unsigned long long > ebml::ebmlUnsignedInteger

◆ elem_seek_pair

◆ globalWriteLock_t

typedef std::unique_lock<std::shared_mutex> ebml::globalWriteLock_t

◆ ioBase_sp

Shared pointer to an ioBase instance.

◆ occur_d

typedef std::unordered_map<ebmlID_t, unsigned long> ebml::occur_d

◆ occurSpec_d

typedef std::unordered_map<ebmlID_t, occurSpec_t> ebml::occurSpec_d

Defines the mapping from EBML ID to occurrence specifications.

◆ pair_const_value_t

template<typename V >
using ebml::pair_const_value_t = typedef std::conditional_t<std::is_class< V >::value && std::is_base_of<ebmlElement, V >::value, ebml::ptr<const V>, const V&>

◆ pair_key_class_t

template<typename K >
using ebml::pair_key_class_t = typedef ebmlDataType<K>

◆ pair_key_inst_t

template<typename K >
using ebml::pair_key_inst_t = typedef ebmlDataElement<K>

◆ pair_value_class_t

template<typename V >
using ebml::pair_value_class_t = typedef std::conditional_t<std::is_class< V >::value && std::is_base_of<ebmlElement, V >::value, ebmlElementType, ebmlDataType<V> >

◆ pair_value_inst_sp

template<typename V >
using ebml::pair_value_inst_sp = typedef ebml::ptr<pair_value_inst_t<V> >

◆ pair_value_inst_t

template<typename V >
using ebml::pair_value_inst_t = typedef std::conditional_t<std::is_class< V >::value && std::is_base_of<ebmlElement, V >::value, V, ebmlDataElement<V> >

◆ pair_value_slot_t

template<typename V >
using ebml::pair_value_slot_t = typedef std::conditional_t<std::is_class< V >::value && std::is_base_of<ebmlElement, V >::value, childSlot_t<V>, V&>

◆ pair_value_t

template<typename V >
using ebml::pair_value_t = typedef std::conditional_t<std::is_class< V >::value && std::is_base_of<ebmlElement, V >::value, ebml::ptr<V>, V>

◆ ptr

template<typename T >
using ebml::ptr = typedef ebml_shared_ptr<T>

◆ slotArg_d

typedef std::unordered_map<std::string, slotArg_t> ebml::slotArg_d

◆ slotArg_l

typedef std::list<slotArg_t> ebml::slotArg_l

◆ slotSpec_l

typedef std::vector<slotSpec_t> ebml::slotSpec_l

◆ timepoint_t

typedef std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> ebml::timepoint_t

◆ vintWidth_t

typedef uint8_t ebml::vintWidth_t

◆ wptr

template<typename T >
using ebml::wptr = typedef ebml_weak_ptr<T>

Function Documentation

◆ _pack_utf8()

size_t ebml::_pack_utf8 ( const std::wstring &  value,
size_t  size,
char *  dest 
)

◆ _parseFile() [1/2]

void ebml::_parseFile ( ioBase file,
ebmlID_t ebmlID,
unsigned char &  ebmlIDWidth,
size_t &  dataSize,
unsigned char &  sizeWidth 
)

◆ _parseFile() [2/2]

void ebml::_parseFile ( ioBase file,
off_t  offset,
ebmlID_t ebmlID,
unsigned char &  ebmlIDWidth,
size_t &  dataSize,
unsigned char &  sizeWidth 
)

◆ _parseString()

void ebml::_parseString ( const char *  data,
size_t  size,
ebmlID_t ebmlID,
unsigned char &  ebmlIDWidth,
size_t &  dataSize,
unsigned char &  sizeWidth 
)

◆ _reverse()

void ebml::_reverse ( char *  s,
unsigned int  j,
unsigned int  k 
)
inline

Reverses the contents of a character array between indices [j, k].

This helper function is used internally to swap the bytes of a raw data representation.

Parameters
sPointer to the character array.
jThe starting index.
kThe ending index.

◆ _size_utf8()

size_t ebml::_size_utf8 ( const std::wstring &  value)

◆ _unpack_utf8()

std::wstring ebml::_unpack_utf8 ( const char *  src,
size_t  size 
)

◆ data() [1/4]

template<typename T >
template double & ebml::data< double > ( const ebmlElement_sp elem)

◆ data() [2/4]

template<typename T >
template const double & ebml::data< double > ( const c_ebmlElement_sp elem)

◆ data() [3/4]

template<typename T >
T ebml::data ( const const_slot_t slot)

◆ data() [4/4]

template<typename T >
T& ebml::data ( slot_t slot)

◆ DEF_PACK() [1/2]

ebml::DEF_PACK ( long long  )

◆ DEF_PACK() [2/2]

ebml::DEF_PACK ( unsigned long  long)

◆ DEF_PACK_ALT() [1/2]

ebml::DEF_PACK_ALT ( float  )

◆ DEF_PACK_ALT() [2/2]

ebml::DEF_PACK_ALT ( double  )

◆ DEF_SIZE() [1/2]

ebml::DEF_SIZE ( long long  )

◆ DEF_SIZE() [2/2]

ebml::DEF_SIZE ( unsigned long  long)

◆ DEF_UNPACK() [1/4]

ebml::DEF_UNPACK ( float  )

◆ DEF_UNPACK() [2/4]

ebml::DEF_UNPACK ( unsigned long  long)

◆ DEF_UNPACK() [3/4]

ebml::DEF_UNPACK ( double  )

◆ DEF_UNPACK() [4/4]

ebml::DEF_UNPACK ( long long  )

◆ detect_overlong_encode()

bool ebml::detect_overlong_encode ( const char *  src,
const unsigned char *  masks 
)
inline

◆ in_multrange() [1/2]

bool ebml::in_multrange ( const std::map< char16_t, char16_t > &  d,
char16_t  c 
)

◆ in_multrange() [2/2]

bool ebml::in_multrange ( const std::map< wchar_t, wchar_t > &  d,
wchar_t  c 
)

◆ make_exc_msg()

std::string ebml::make_exc_msg ( const char *  msg,
unsigned int  lineno,
const char *  file 
)

◆ pack() [1/7]

size_t ebml::pack ( const std::string &  value,
size_t  size,
char *  dest 
)
inline

◆ pack() [2/7]

size_t ebml::pack ( const std::wstring &  value,
size_t  size,
char *  dest 
)
inline

◆ pack() [3/7]

size_t ebml::pack ( const timepoint_t value,
size_t  size,
char *  dest 
)
inline

◆ pack() [4/7]

size_t ebml::pack ( const std::string &  value,
char *  dest 
)
inline

◆ pack() [5/7]

template<typename T >
size_t ebml::pack ( const T &  value,
char *  dest 
)
inline

Packs the given value into a raw data buffer.

This function writes the encoded representation of the given value into the destination buffer pointed by dest, and returns the number of bytes written.

Template Parameters
TThe type of the value to encode.
Parameters
valueThe value to be encoded.
destPointer to the destination buffer to hold the encoded bytes.
Returns
The number of bytes that were written into the buffer.
Exceptions
ebml::ebmlEncodeErrorIf the encoding fails. (Only exceptions of type ebml::ebmlEncodeError should be thrown.)

◆ pack() [6/7]

template<typename T >
size_t ebml::pack ( const T &  value,
size_t  size,
char *  dest 
)
inline

Packs the given value into a raw data buffer with a size constraint.

This function writes the encoded representation of value into the buffer dest. If the number of bytes required to encode the value exceeds the provided size, then an ebml::ebmlEncodeError is thrown.

Template Parameters
TThe type of the value to encode.
Parameters
valueThe value to be encoded.
sizeThe maximum number of bytes available in the destination buffer.
destPointer to the destination buffer.
Returns
The number of bytes written into the buffer.
Exceptions
ebml::ebmlEncodeErrorIf the packed data size exceeds the provided buffer size. (Only exceptions of type ebml::ebmlEncodeError should be thrown.)

◆ pack() [7/7]

template<typename T >
std::string ebml::pack ( const T &  value)
inline

Packs the given value into a std::string.

This function creates a std::string whose contents represent the encoded form of the provided value.

Template Parameters
TThe type of the value to encode.
Parameters
valueThe value to be encoded.
Returns
A std::string containing the encoded data.
Exceptions
ebml::ebmlEncodeErrorIf the encoding fails. (Only exceptions of type ebml::ebmlEncodeError should be thrown.)

◆ packVint() [1/2]

void ebml::packVint ( unsigned long long  n,
unsigned char  size,
char *  dest 
)
inline

Encodes an unsigned long long as a variable-length integer (vint) with a specified width.

This function encodes the given number into the vint format using the provided width.

Parameters
nThe number to encode.
sizeThe desired width (in bytes) for the encoded vint.
destPointer to the destination buffer where the encoded vint will be stored.
Exceptions
std::invalid_argumentif the provided width is not within the valid range [1, 8].
std::overflow_errorif the number is too large to fit within the provided width.

◆ packVint() [2/2]

unsigned char ebml::packVint ( unsigned long long  n,
char *  dest 
)
inline

Encodes an unsigned long long as a variable-length integer (vint) by automatically determining the required width.

This wrapper function calculates the minimal width needed to represent the number as a vint, then encodes the number to the destination buffer.

Parameters
nThe number to encode.
destPointer to the destination buffer where the encoded vint will be stored.
Returns
The width (in bytes) used to encode the number.

◆ parseFile::unpack< std::string >()

template std::string ebml::parseFile::unpack< std::string > ( ) const

◆ parseFile::unpack< std::wstring >()

template std::wstring ebml::parseFile::unpack< std::wstring > ( ) const

◆ repr() [1/11]

template<typename T >
std::wstring ebml::repr ( const std::shared_ptr< T > &  obj)

◆ repr() [2/11]

template<typename T >
std::wstring ebml::repr ( const T &  obj)

◆ repr() [3/11]

template<typename T >
std::wstring ebml::repr ( T *const  obj)

◆ repr() [4/11]

std::wstring ebml::repr ( const std::string &  str)

◆ repr() [5/11]

std::wstring ebml::repr ( const std::wstring &  str)

◆ repr() [6/11]

std::wstring ebml::repr ( unsigned long long  n)

◆ repr() [7/11]

std::wstring ebml::repr ( unsigned long  n)

◆ repr() [8/11]

std::wstring ebml::repr ( long long  z)

◆ repr() [9/11]

std::wstring ebml::repr ( long  z)

◆ repr() [10/11]

std::wstring ebml::repr ( double  x)

◆ repr() [11/11]

std::wstring ebml::repr ( timepoint_t  t)

◆ size() [1/4]

size_t ebml::size ( const std::string &  value)
inline

◆ size() [2/4]

size_t ebml::size ( const std::wstring &  value)
inline

◆ size() [3/4]

size_t ebml::size ( const timepoint_t value)
inline

◆ size() [4/4]

template<typename T >
size_t ebml::size ( const T &  value)
inline

Computes the size in bytes required to encode the given value.

This function should return the number of bytes that will be used to encode the provided value into a raw data format.

Template Parameters
TThe type of the value to encode.
Parameters
valueThe value to be encoded.
Returns
The number of bytes required for the encoded representation.
Exceptions
ebml::ebmlEncodeErrorIf the value cannot be encoded. (Note: Only exceptions of type ebml::ebmlEncodeError should be thrown.)

◆ typeof() [1/2]

template<typename T >
std::string ebml::typeof ( const T *  inst)
inline

◆ typeof() [2/2]

template<typename T >
std::string ebml::typeof ( )
inline

◆ unpack() [1/2]

template<typename T >
T ebml::unpack ( const char *  src,
size_t  size 
)
inline

Unpacks a value of type T from a raw data buffer.

This function converts the raw bytes (provided by pointer src with length size) into a value of type T.

Template Parameters
TThe type to decode.
Parameters
srcPointer to the raw data buffer.
sizeThe size of the data in bytes.
Returns
The decoded value of type T.
Exceptions
ebml::ebmlDecodeErrorIf decoding fails. (Only exceptions of type ebml::ebmlDecodeError should be thrown.)

◆ unpack() [2/2]

template<typename T >
T ebml::unpack ( const std::string &  str)
inline

Unpacks a value of type T from a std::string.

This function decodes the contents of the provided std::string into a value of type T.

Template Parameters
TThe type to decode.
Parameters
strThe std::string containing the encoded data.
Returns
The decoded value of type T.
Exceptions
ebml::ebmlDecodeErrorIf decoding fails. (Only exceptions of type ebml::ebmlDecodeError should be thrown.)

◆ unpack< std::string >()

template<>
std::string ebml::unpack< std::string > ( const char *  src,
size_t  size 
)
inline

◆ unpack< std::wstring >()

template<>
std::wstring ebml::unpack< std::wstring > ( const char *  src,
size_t  size 
)
inline

◆ unpack< timepoint_t >()

template<>
timepoint_t ebml::unpack< timepoint_t > ( const char *  src,
size_t  size 
)
inline

◆ unpackVint() [1/5]

unsigned long long ebml::unpackVint ( const char *  data,
size_t  dataSize,
unsigned char &  vintw 
)

Decodes a vint from a byte array of known size.

This function is used when the data buffer size is known. It will throw an exception if the data is insufficient.

Parameters
dataPointer to the byte array containing the encoded vint.
dataSizeSize of the data buffer in bytes.
vintwReference to an unsigned char where the detected width of the vint will be stored.
Returns
The decoded unsigned long long value.
Exceptions
ebmlUnexpectedEndOfDataif there is no data or if the data is incomplete.

◆ unpackVint() [2/5]

unsigned long long ebml::unpackVint ( ioBase file,
unsigned char &  vintw 
)

Decodes a vint from an I/O stream.

Reads a vint from the provided file stream. The detected width of the vint is stored in vintw.

Parameters
fileReference to the I/O file stream.
vintwReference to an unsigned char in which the width of the decoded vint will be stored.
Returns
The decoded unsigned long long value. If no data is available, returns 0 and sets vintw to 0.
Exceptions
ebmlInvalidVintor ebmlUnexpectedEndOfData on errors.

◆ unpackVint() [3/5]

unsigned long long ebml::unpackVint ( ioBase file,
off_t  offset,
unsigned char &  vintw 
)

Decodes a vint from an I/O stream starting at a specified offset.

Reads a vint from the provided file stream beginning at the specified offset. The detected width of the vint is stored in vintw.

Parameters
fileReference to the I/O file stream.
offsetThe offset (in bytes) from which to start reading.
vintwReference to an unsigned char in which the width of the decoded vint will be stored.
Returns
The decoded unsigned long long value. If no data is available, returns 0 and sets vintw to 0.
Exceptions
ebmlInvalidVintor ebmlUnexpectedEndOfData on errors.

◆ unpackVint() [4/5]

unsigned long long ebml::unpackVint ( const char *  data,
unsigned char  size 
)
inline

Decodes a variable-length integer (vint) from a byte array with a given size.

This function unpacks the vint from the provided data buffer. It masks out the marker bits that indicate the width.

Parameters
dataPointer to the byte array containing the encoded vint.
sizeThe size (width) of the vint in bytes.
Returns
The decoded unsigned long long value.
Note
If the unpacked value equals the maximum representable value for the width, the function returns 0xffffffffffffffffULL.

◆ unpackVint() [5/5]

unsigned long long ebml::unpackVint ( const char *  data)
inline

Automatically detects the vint width and decodes the variable-length integer.

This function inspects the first byte, determines the full length of the vint, and then calls the appropriate unpacking routine.

Parameters
dataPointer to the byte array containing the encoded vint.
Returns
The decoded unsigned long long value.

◆ utf8_char_width()

unsigned char ebml::utf8_char_width ( unsigned char  d)
inline

◆ vintWidth()

unsigned char ebml::vintWidth ( char  b)
inline

Determines the width (in bytes) of a variable-length integer (vint) based on its first byte.

This function inspects the first byte of a vint and returns the number of bytes that make up the entire vint. It examines the leading bits and uses them as a mask to determine the length.

Parameters
bThe first byte of the vint.
Returns
The width (number of bytes) of the encoded vint.
Exceptions
ebmlInvalidVintif the integer starts with a null byte.

◆ widthAsVint()

unsigned char ebml::widthAsVint ( unsigned long long  n)
inline

Computes the minimal width (in bytes) required to encode an unsigned long long as a vint.

This function calculates how many bytes are needed to represent the given number in the variable-length integer format used in EBML.

Parameters
nThe number to encode.
Returns
The minimal width in bytes required to represent the number.
Exceptions
std::overflow_errorif the number is too large to encode.

Variable Documentation

◆ __one

unsigned long long ebml::__one = 1

◆ _is_littleendian

bool ebml::_is_littleendian = (((char*)&__one)[0] == 1)

◆ childHelper

childElemHelper_t ebml::childHelper

◆ DocType

const ebmlBinaryType ebml::DocType = ebmlBinaryType("\x42\x82", L"DocType")

◆ DocTypeReadVersion

const ebmlUnsignedIntegerType ebml::DocTypeReadVersion = ebmlUnsignedIntegerType("\x42\x85", L"DocTypeReadVersion", 1)

◆ DocTypeVersion

const ebmlUnsignedIntegerType ebml::DocTypeVersion = ebmlUnsignedIntegerType("\x42\x87", L"DocTypeVersion", 1)

◆ EBMLHead

const ebmlStructType ebml::EBMLHead
Initial value:
= ebmlStructType("\x1a\x45\xdf\xa3", L"EBMLHead", {
{"ebmlVersion", {{&EBMLVersion, 1, 1}}},
{"ebmlReadVersion", {{&EBMLReadVersion, 1, 1}}},
{"ebmlMaxIDLength", {{&EBMLMaxIDLength, 1, 1}}},
{"ebmlMaxSizeLength", {{&EBMLMaxSizeLength, 1, 1}}},
{"docType", {{&DocType, 1, 1}}},
{"docTypeVersion", {{&DocTypeVersion, 1, 1}}},
{"docTypeReadVersion", {{&DocTypeReadVersion, 1, 1}}}
})
const ebmlUnsignedIntegerType EBMLVersion
Definition: ebmlHead.cpp:7
const ebmlUnsignedIntegerType DocTypeVersion
Definition: ebmlHead.cpp:12
const ebmlUnsignedIntegerType EBMLReadVersion
Definition: ebmlHead.cpp:8
const ebmlUnsignedIntegerType DocTypeReadVersion
Definition: ebmlHead.cpp:13
const ebmlBinaryType DocType
Definition: ebmlHead.cpp:11
const ebmlUnsignedIntegerType EBMLMaxSizeLength
Definition: ebmlHead.cpp:10
const ebmlUnsignedIntegerType EBMLMaxIDLength
Definition: ebmlHead.cpp:9

◆ EBMLMaxIDLength

const ebmlUnsignedIntegerType ebml::EBMLMaxIDLength = ebmlUnsignedIntegerType("\x42\xf2", L"EBMLMaxIDLength", 4)

◆ EBMLMaxSizeLength

const ebmlUnsignedIntegerType ebml::EBMLMaxSizeLength = ebmlUnsignedIntegerType("\x42\xf3", L"EBMLMaxSizeLength", 8)

◆ EBMLReadVersion

const ebmlUnsignedIntegerType ebml::EBMLReadVersion = ebmlUnsignedIntegerType("\x42\xf7", L"EBMLReadVersion", 1)

◆ EBMLVersion

const ebmlUnsignedIntegerType ebml::EBMLVersion = ebmlUnsignedIntegerType("\x42\x86", L"EBMLVersion", 1)

◆ epoch

const timepoint_t ebml::epoch = timepoint_t(std::chrono::duration<long long, std::nano>(978307200000000000LL))

◆ fcm

const unsigned char ebml::fcm[4] = {0x80, 0xE0, 0xF0, 0xF8}
static

◆ fcp

const unsigned char ebml::fcp[4] = {0x00, 0xC0, 0xE0, 0xF0}
static

◆ has_cinit

template<typename ebmlinst_t , typename parse_t >
concept ebml::has_cinit
Initial value:
= requires(ebmlinst_t& instance, const parse_t& parsed) {
{ instance._cinit(parsed) };
}

◆ has_clone_method

template<typename ebmlinst_t >
concept ebml::has_clone_method
Initial value:
= requires(ebmlinst_t& instance, ebmlinst_t& orig) {
{ instance._clone(orig) };
}

◆ has_constructor

template<typename ebmlinst_t , typename... Args>
concept ebml::has_constructor
Initial value:
= requires(Args&&... args) {
{ new ebmlinst_t(std::forward<Args>(args)...) };
}

◆ has_init

template<typename ebmlinst_t , typename parse_t >
concept ebml::has_init
Initial value:
= requires(ebmlinst_t& instance, const parse_t& parsed) {
{ instance._init(parsed) };
}

◆ overlong

const unsigned char ebml::overlong[4][3]
static
Initial value:
= {
{0x00},
{0x1E, 0x00},
{0x0F, 0x20, 0x00},
{0x07, 0x30, 0x00},
}

◆ seekHelper

seekHelper_t ebml::seekHelper

◆ sizes

const unsigned long long ebml::sizes[4] = {1LL << 7, 1LL << 11, 1LL << 16, 1LL << 21}
static

◆ special

const std::unordered_map<char, std::wstring> ebml::special = {{0x27, L"\\'"}, {0x09, L"\\t"}, {0x10, L"\\n"}, {0x13, L"\\r"}, {0x92, L"\\\\"}}
static

◆ special_unicode

const std::unordered_map<wchar_t, std::wstring> ebml::special_unicode = {{0x27, L"\\'"}, {0x09, L"\\t"}, {0x10, L"\\n"}, {0x13, L"\\r"}, {0x92, L"\\\\"}}
static

◆ u_ranges

const std::map<wchar_t, wchar_t> ebml::u_ranges
static

◆ U_ranges

const std::map<wchar_t, wchar_t> ebml::U_ranges
static

◆ UNKNOWN

const size_t ebml::UNKNOWN = 0xffffffffffffffffULL

Special constant representing an unknown or maximum value.

◆ Void

ebmlVoidType ebml::Void

◆ x_ranges

const std::map<char16_t, char16_t> ebml::x_ranges
static
Initial value:
= {
{0x00, 0x20},
{0x7f, 0x0100}
}

◆ x_ranges_unicode

const std::map<wchar_t, wchar_t> ebml::x_ranges_unicode
static
Initial value:
= {
{0x00, 0x20},
{0x7f, 0xa1},
{0xad, 0xae}
}