16 DEFINE_PTR_TYPE( ChunkRepr );
26 FRIEND_CLASS_TESTER(
HCF );
29 ChunkReprPtr m_chunkPtr;
33 explicit Chunk () =
default;
34 explicit Chunk ( ChunkReprPtr chunkRepr );
64 bool Fill (
const DataPtr data, Size dataSize );
84 template<
typename AttributeStruct >
89 template<
typename AttributeStruct >
96 bool operator== (
Chunk other )
const;
106 template<
typename AttributeStruct >
110 return m_chunkPtr->AddAttribute( type, (
const DataPtr)&content,
sizeof( AttributeStruct ) );
116 template<
typename AttributeStruct >
120 return AddAttribute( GetAttributeTypeID< AttributeStruct >(), content );
Chunk ParentChunk()
Get Chunks parent.
Definition: Chunk.cpp:59
Chunk FirstChild()
Gets first child chunk of this chunk.
Definition: Chunk.cpp:41
DataPack AccessData()
Returns chunk's data.
Definition: Chunk.cpp:95
Definition: Exception.h:11
Data pointer and it's size. This struct is used to transfer ownership of pointer. ...
Definition: AttributeTypes.h:34
Represents memory chunk in file.
Definition: Chunk.h:24
Main class for loading and writing HCF files.
Definition: HCF.h:34
Plik zawiera definicje podstawowych typów zmiennych.
bool HasChildren()
Check if you should call FirstChild or AccessData.
Definition: Chunk.cpp:50
Attribute AddAttribute(AttributeType type, const DataPtr data, Size dataSize)
Adds attribute and fills it with data.
Definition: Chunk.cpp:68
Data pointer and it's size.
Definition: AttributeTypes.h:19
Chunk NextChunk()
Gets next chunk on the same nesting level.
Definition: Chunk.cpp:32
bool Fill(const DataPtr data, Size dataSize)
Fills chunk with data. You can fill only chunks without children. One filled chunk, can't add children anymore.
Definition: Chunk.cpp:77
Definition: Attribute.h:21
bool IsValid() const
Checks if you can use this attribute properly.
Definition: Chunk.cpp:104
Chunk CreateChunk()
Create child chunk.
Definition: Chunk.cpp:23
DataUPack StealData()
Returns chunk's data and transfers ownership to caller.
Definition: Chunk.cpp:86