Sleeping Wombat GUI  0.100
swGUI
HCF.h
Go to the documentation of this file.
1 #pragma once
2 
10 
13 
14 #include "Chunk.h"
15 #include "Attribute.h"
16 
17 #include <string>
18 
19 
20 namespace sw
21 {
22 
23 class ImplHCF;
24 
25 
34 class HCF
35 {
37 public:
38 
40  {
43  };
44 
45  const static bool READ_ONLY = true;
46  const static bool READ_WRITE = false;
47  const static Size UserDefinedAttributes = 0xFFFFFFFFFFFF0000;
48 
49 private:
51 
52 protected:
53 public:
54  explicit HCF ();
55  ~HCF () = default;
56 
59  bool LoadFile ( const filesystem::Path& filePath, bool readOnly );
60  bool Load ( DataPtr data, Size size );
61 
64  bool WriteFile ( const filesystem::Path& filePath );
65 
68  bool OpenFile ( const filesystem::Path& filePath, WriteMode mode );
70 
73 
76 
77  Attribute AddAttribute ( AttributeType type, const DataPtr data, Size dataSize );
78 
82  template< typename AttributeStruct >
83  Attribute AddAttribute ( AttributeType type, const AttributeStruct& content );
84 
87  template< typename AttributeStruct >
88  Attribute AddAttribute ( const AttributeStruct& content );
90 
91 };
92 
93 
94 
95 } // sw
96 
98 template< typename AttributeStruct >
100 
101 
102 #include "HCF.inl"
bool Load(DataPtr data, Size size)
Definition: HCF.cpp:34
bool OpenFile(const filesystem::Path &filePath, WriteMode mode)
Opens file for writing. This functions allows to use WriteMode::DirectToFile. If you use Indirect mod...
Definition: HCF.cpp:48
sw::AttributeType GetAttributeTypeID()
Override this funtion for your attribute atructure.
FRIEND_CLASS_TESTER(HCF)
Definition: Path.h:22
uint64 AttributeType
Definition: AttributeTypes.h:12
Chunk CreateRootChunk()
Definition: HCF.cpp:62
HCF()
Definition: HCF.cpp:22
WriteMode
Definition: HCF.h:39
Definition: DirectInputModule.cpp:11
Definition: ImplHCF.h:28
static const Size UserDefinedAttributes
Definition: HCF.h:47
bool WriteFile(const filesystem::Path &filePath)
Saves content to file.
Definition: HCF.cpp:41
~HCF()=default
Represents memory chunk in file.
Definition: Chunk.h:24
Main class for loading and writing HCF files.
Definition: HCF.h:34
DataUnderlayingType * DataPtr
Definition: AttributeTypes.h:14
Definition: HCF.h:41
Chunk GetRootChunk()
Definition: HCF.cpp:55
Plik zawiera definicje podstawowych typów zmiennych.
ImplHCF m_impl
Definition: HCF.h:50
size_t Size
Definition: TypesDefinitions.h:35
uint8_t uint8
Definition: TypesDefinitions.h:27
static const bool READ_WRITE
Definition: HCF.h:46
Definition: Attribute.h:21
bool LoadFile(const filesystem::Path &filePath, bool readOnly)
Definition: HCF.cpp:27
Definition: HCF.h:42
static const bool READ_ONLY
Definition: HCF.h:45
Attribute AddAttribute(AttributeType type, const DataPtr data, Size dataSize)
Adds attribute and fills it with data.
Definition: HCF.cpp:69