20 DEFINE_PTR_TYPE( ChunkRepr );
21 DEFINE_WPTR_TYPE( ChunkRepr );
27 class ChunkRepr :
public std::enable_shared_from_this< ChunkRepr >
29 FRIEND_CLASS_TESTER(
HCF );
53 static ChunkReprPtr CreateFromFile (
ImplHCF* hcf, ChunkReprPtr parent, Size fileOffset );
54 static ChunkReprPtr Create (
ImplHCF* hcf, ChunkReprPtr parent );
75 Attribute AddAttribute ( AttributeType type,
const DataPtr data, Size dataSize );
76 bool Fill (
const DataPtr data, Size dataSize );
84 void AddNextChunk ( ChunkReprPtr& newChunk );
87 bool CheckValidity ()
const;
90 bool CanAddAttribute ()
const;
91 bool CanCreateChunk ()
const;
92 bool CanFillData ()
const;
93 bool CanLoadData ()
const;
95 void WriteHeader ( Size revertOffset );
96 void LoadHeader ( Size revertOffset );
Size m_absolutOffset
Offset from beginning of file.
Definition: ChunkRepr.h:36
Definition: ChunkRepr.h:27
ChunkReprPtr m_childChunk
First child chunk.
Definition: ChunkRepr.h:40
Definition: Exception.h:11
ChunkReprWPtr m_parent
Parent chunk.
Definition: ChunkRepr.h:38
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
DataUPack m_data
Contains chunk's data.
Definition: ChunkRepr.h:44
Plik zawiera definicje podstawowych typów zmiennych.
Chunk ParentChunk()
Get Chunks parent.
Definition: ChunkRepr.cpp:130
ChunkRepr(ImplHCF *hcf, ChunkReprPtr &parent)
Write only constructor.
Definition: ChunkRepr.cpp:19
DataPack AccessData()
Returns chunk's data.
Definition: ChunkRepr.cpp:205
Data pointer and it's size.
Definition: AttributeTypes.h:19
Definition: Attribute.h:21
ChunkReprPtr m_nextChunk
Next chunk on the same nesting level.
Definition: ChunkRepr.h:39
void UpdateHeader()
Updates header in file using current info from m_header field.
Definition: ChunkRepr.cpp:350
DataUPack StealData()
Returns chunk's data and transfers ownership to caller.
Definition: ChunkRepr.cpp:193
bool HasChildren() const
Check if you should call FirstChild or AccessData.
Definition: ChunkRepr.cpp:123
Chunk FirstChild()
Gets first child chunk of this chunk.
Definition: ChunkRepr.cpp:101
AttributeReprPtr m_firstAttrib
Attributes list.
Definition: ChunkRepr.h:42
Chunk NextChunk()
Gets next chunk on the same nesting level.
Definition: ChunkRepr.cpp:82