Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sw::ChunkRepr Class Reference

#include <ChunkRepr.h>

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. More...
 
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. More...
 
DataPack AccessData ()
 Returns chunk's data. More...
 
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. More...
 
 ChunkRepr (ImplHCF *hcf, ChunkReprPtr &parent, Size fileOffset)
 Read constructor. More...
 
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. More...
 
DataUPack LoadData ()
 

Private Attributes

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

Constructor & Destructor Documentation

sw::ChunkRepr::ChunkRepr ( ImplHCF hcf,
ChunkReprPtr &  parent 
)
private

Write only constructor.

sw::ChunkRepr::ChunkRepr ( ImplHCF hcf,
ChunkReprPtr &  parent,
Size  fileOffset 
)
private

Read constructor.

Member Function Documentation

DataPack sw::ChunkRepr::AccessData ( )

Returns chunk's data.

Attribute sw::ChunkRepr::AddAttribute ( AttributeType  type,
const DataPtr  data,
Size  dataSize 
)
void sw::ChunkRepr::AddNextChunk ( ChunkReprPtr &  newChunk)
bool sw::ChunkRepr::CanAddAttribute ( ) const
private
bool sw::ChunkRepr::CanCreateChunk ( ) const
private
bool sw::ChunkRepr::CanFillData ( ) const
private
bool sw::ChunkRepr::CanLoadData ( ) const
private
bool sw::ChunkRepr::CheckValidity ( ) const
ChunkReprPtr sw::ChunkRepr::Create ( ImplHCF hcf,
ChunkReprPtr  parent 
)
static
Chunk sw::ChunkRepr::CreateChunk ( )
ChunkReprPtr sw::ChunkRepr::CreateFromFile ( ImplHCF hcf,
ChunkReprPtr  parent,
Size  fileOffset 
)
static
bool sw::ChunkRepr::Fill ( const DataPtr  data,
Size  dataSize 
)
Chunk sw::ChunkRepr::FirstChild ( )

Gets first child chunk of this chunk.

Returns
Returns invalid chunk if there's no children.
sw::ChunkRepr::FRIEND_CLASS_TESTER ( HCF  )
private
sw::ChunkRepr::FRIEND_CLASS_TESTER ( ChunkRepr  )
private
bool sw::ChunkRepr::HasChildren ( ) const

Check if you should call FirstChild or AccessData.

DataUPack sw::ChunkRepr::LoadData ( )
private
void sw::ChunkRepr::LoadHeader ( Size  revertOffset)
private
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.
DataUPack sw::ChunkRepr::StealData ( )

Returns chunk's data and transfers ownership to caller.

void sw::ChunkRepr::UpdateHeader ( )
private

Updates header in file using current info from m_header field.

void sw::ChunkRepr::WriteHeader ( Size  revertOffset)
private

Member Data Documentation

Size sw::ChunkRepr::m_absolutOffset
private

Offset from beginning of file.

ChunkReprPtr sw::ChunkRepr::m_childChunk
private

First child chunk.

DataUPack sw::ChunkRepr::m_data
private

Contains chunk's data.

AttributeReprPtr sw::ChunkRepr::m_firstAttrib
private

Attributes list.

ImplHCF* sw::ChunkRepr::m_hcf
private
ChunkHeader sw::ChunkRepr::m_header
private
ChunkReprPtr sw::ChunkRepr::m_nextChunk
private

Next chunk on the same nesting level.

ChunkReprWPtr sw::ChunkRepr::m_parent
private

Parent chunk.


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