Sleeping Wombat GUI  0.100
swGUI
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members

Main class for loading and writing HCF files. More...

#include <HCF.h>

Public Types

enum  WriteMode : uint8 { DirectToFile, Indirect }
 

Public Member Functions

 HCF ()
 
 ~HCF ()=default
 
Chunk GetRootChunk ()
 
Chunk CreateRootChunk ()
 
Loading and saving
bool LoadFile (const filesystem::Path &filePath, bool readOnly)
 
bool Load (DataPtr data, Size size)
 
bool WriteFile (const filesystem::Path &filePath)
 Saves content to file. More...
 
bool OpenFile (const filesystem::Path &filePath, WriteMode mode)
 Opens file for writing. This functions allows to use WriteMode::DirectToFile. If you use Indirect mode, there's no need to call this function. More...
 
Attributes manipulation
Attribute AddAttribute (AttributeType type, const DataPtr data, Size dataSize)
 Adds attribute and fills it with data. More...
 
template<typename AttributeStruct >
Attribute AddAttribute (AttributeType type, const AttributeStruct &content)
 Adds attribute and creates content from POD structure. More...
 
template<typename AttributeStruct >
Attribute AddAttribute (const AttributeStruct &content)
 Adds attribute and creates content from POD structure. Attribute type will be taken from struct. Specialize GetAttributeTypeID template. More...
 

Static Public Attributes

static const bool READ_ONLY = true
 
static const bool READ_WRITE = false
 
static const Size UserDefinedAttributes = 0xFFFFFFFFFFFF0000
 

Private Member Functions

 FRIEND_CLASS_TESTER (HCF)
 

Private Attributes

ImplHCF m_impl
 

Detailed Description

Main class for loading and writing HCF files.

Constructor & Destructor Documentation

sw::HCF::HCF ( )
explicit
sw::HCF::~HCF ( )
default

Member Function Documentation

Attribute sw::HCF::AddAttribute ( AttributeType  type,
const DataPtr  data,
Size  dataSize 
)

Adds attribute and fills it with data.

template<typename AttributeStruct >
Attribute sw::HCF::AddAttribute ( AttributeType  type,
const AttributeStruct &  content 
)
inline

Adds attribute and creates content from POD structure.

Parameters
[in]typeYou must provide type of attribute by yourself. Use second spetialization if struct defines attribute type getter.
template<typename AttributeStruct >
Attribute sw::HCF::AddAttribute ( const AttributeStruct &  content)
inline

Adds attribute and creates content from POD structure. Attribute type will be taken from struct. Specialize GetAttributeTypeID template.

Chunk sw::HCF::CreateRootChunk ( )
sw::HCF::FRIEND_CLASS_TESTER ( HCF  )
private
Chunk sw::HCF::GetRootChunk ( )
bool sw::HCF::Load ( DataPtr  data,
Size  size 
)
bool sw::HCF::LoadFile ( const filesystem::Path filePath,
bool  readOnly 
)
bool sw::HCF::OpenFile ( const filesystem::Path filePath,
WriteMode  mode 
)

Opens file for writing. This functions allows to use WriteMode::DirectToFile. If you use Indirect mode, there's no need to call this function.

bool sw::HCF::WriteFile ( const filesystem::Path filePath)

Saves content to file.

See also
HCF::OpenFile

Member Data Documentation

ImplHCF sw::HCF::m_impl
private
const bool sw::HCF::READ_ONLY = true
static
const bool sw::HCF::READ_WRITE = false
static
const Size sw::HCF::UserDefinedAttributes = 0xFFFFFFFFFFFF0000
static

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