LibCppBinary
Modern cross-platform C++ binary parsing library
Loading...
Searching...
No Matches
Binary::ChunkHeader Struct Reference

Represents the header of a binary data chunk. More...

#include <ChunkHeader.h>

Inheritance diagram for Binary::ChunkHeader:
Binary::DataStructure

Public Member Functions

std::vector< DataField * > Fields () override
 Provides a vector of raw pointers to the structure's fields.
std::vector< const DataField * > Fields () const override
 Provides a vector of raw pointers to the structure's fields.
size_t Size () const override
 Gets the total size of all fields in the structure.
ChunkHeaderoperator= (const ChunkHeader &other)
 Assignment operator for ChunkHeader.

Public Attributes

StringField id { chunkIDSize }
 The ID of the chunk.
UInt32Field dataSize
 The size of the chunk's data.

Detailed Description

Represents the header of a binary data chunk.

Member Function Documentation

◆ Fields() [1/2]

std::vector< const DataField * > Binary::ChunkHeader::Fields ( ) const
overridevirtual

Provides a vector of raw pointers to the structure's fields.

This method is primarily intended for use by Binary::Stream and its derivatives for reading the fields from and to those streams. Access the fields directly rather than via this method.

Returns
A vector containing raw pointers to fields owned by this structure.
Postcondition
Returned pointers remain valid while this structure exists.

Implements Binary::DataStructure.

◆ Fields() [2/2]

std::vector< DataField * > Binary::ChunkHeader::Fields ( )
overridevirtual

Provides a vector of raw pointers to the structure's fields.

This method is primarily intended for use by Binary::Stream and its derivatives for reading the fields from and to those streams. Access the fields directly rather than via this method.

Returns
A vector containing raw pointers to fields owned by this structure.
Postcondition
Returned pointers remain valid while this structure exists.

Implements Binary::DataStructure.

◆ operator=()

ChunkHeader & Binary::ChunkHeader::operator= ( const ChunkHeader & other)

Assignment operator for ChunkHeader.

Copies the values of all fields from another ChunkHeader instance.

Parameters
otherThe ChunkHeader to copy from.
Returns
Reference to this ChunkHeader after assignment.

◆ Size()

size_t Binary::ChunkHeader::Size ( ) const
overridevirtual

Gets the total size of all fields in the structure.

Returns
The total size of the structure.

Implements Binary::DataStructure.

Member Data Documentation

◆ dataSize

UInt32Field Binary::ChunkHeader::dataSize

The size of the chunk's data.

◆ id

StringField Binary::ChunkHeader::id { chunkIDSize }

The ID of the chunk.


The documentation for this struct was generated from the following file: