Sleeping Wombat Common Library  0.50.0
swCommonLibrary
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

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.
 
Attributes manipulation
Attribute AddAttribute (AttributeType type, const DataPtr data, Size dataSize)
 Adds attribute and fills it with data.
 
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.
 

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.

Member Function Documentation

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.
bool sw::HCF::WriteFile ( const filesystem::Path filePath)

Saves content to file.

See also
HCF::OpenFile

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