summaryrefslogtreecommitdiffhomepage
path: root/Private/StorageKit/StorageCore.inl
blob: 235486a6f7da18ebbbdcce3a05322a76822c52fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 *	========================================================
 *
 *	HCore
 * 	Copyright Mahrouss Logic, all rights reserved.
 *
 * 	========================================================
 */

#ifndef __STORAGEKIT_STORAGECORE_INL__
#define __STORAGEKIT_STORAGECORE_INL__

#include <NewKit/Defines.hpp>

/// @file StorageCore.inl
/// @brief Storage Management API.

namespace HCore {
typedef Char* SKStr;

///! @brief Storage context, reads and write file according to the descriptor
///! layout.
class StorageContext {
 public:
  explicit StorageContext() = default;
  ~StorageContext() = default;

  StorageContext& operator=(const StorageContext&) = default;
  StorageContext(const StorageContext&) = default;

 public:
  bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor);

  struct PacketDescriptor final {
    VoidPtr fFilePtr;
    SizeT fFilePtrSz;
  };

  PacketDescriptor* Read(const SKStr name);
  Int32 Write(PacketDescriptor* packet, const SKStr name);
};
}  // namespace HCore

#endif /* ifndef __STORAGEKIT_STORAGECORE_INL__ */