Sleeping Wombat Common Library  0.50.0
swCommonLibrary
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sw::ChunkRepr Class Reference
Inheritance diagram for sw::ChunkRepr:

Public Member Functions

Chunk CreateChunk ()
 
Chunk NextChunk ()
 Gets next chunk on the same nesting level. More...
 
Chunk FirstChild ()
 Gets first child chunk of this chunk. More...
 
bool HasChildren () const
 Check if you should call FirstChild or AccessData.
 
Chunk ParentChunk ()
 Get Chunks parent. More...
 
Attribute AddAttribute (AttributeType type, const DataPtr data, Size dataSize)
 
bool Fill (const DataPtr data, Size dataSize)
 
DataUPack StealData ()
 Returns chunk's data and transfers ownership to caller.
 
DataPack AccessData ()
 Returns chunk's data.
 
void AddNextChunk (ChunkReprPtr &newChunk)
 
bool CheckValidity () const
 

Static Public Member Functions

static ChunkReprPtr CreateFromFile (ImplHCF *hcf, ChunkReprPtr parent, Size fileOffset)
 
static ChunkReprPtr Create (ImplHCF *hcf, ChunkReprPtr parent)
 

Private Member Functions

 FRIEND_CLASS_TESTER (HCF)
 
 FRIEND_CLASS_TESTER (ChunkRepr)
 
 ChunkRepr (ImplHCF *hcf, ChunkReprPtr &parent)
 Write only constructor.
 
 ChunkRepr (ImplHCF *hcf, ChunkReprPtr &parent, Size fileOffset)
 Read constructor.
 
bool CanAddAttribute () const
 
bool CanCreateChunk () const
 
bool CanFillData () const
 
bool CanLoadData () const
 
void WriteHeader (Size revertOffset)
 
void LoadHeader (Size revertOffset)
 
void UpdateHeader ()
 Updates header in file using current info from m_header field.
 
DataUPack LoadData ()
 

Private Attributes

ImplHCFm_hcf
 
ChunkHeader m_header
 
Size m_absolutOffset
 Offset from beginning of file.
 
ChunkReprWPtr m_parent
 Parent chunk.
 
ChunkReprPtr m_nextChunk
 Next chunk on the same nesting level.
 
ChunkReprPtr m_childChunk
 First child chunk.
 
AttributeReprPtr m_firstAttrib
 Attributes list.
 
DataUPack m_data
 Contains chunk's data.
 

Member Function Documentation

Chunk sw::ChunkRepr::FirstChild ( )

Gets first child chunk of this chunk.

Returns
Returns invalid chunk if there's no children.
Chunk sw::ChunkRepr::NextChunk ( )

Gets next chunk on the same nesting level.

Returns
Returns invalid chunk if there's no next chunk.
Chunk sw::ChunkRepr::ParentChunk ( )

Get Chunks parent.

Returns
Returned chunk can be invalid if this chunk is invalid or there's no parent.

The documentation for this class was generated from the following files: