-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFAT.h
More file actions
executable file
·39 lines (31 loc) · 846 Bytes
/
FAT.h
File metadata and controls
executable file
·39 lines (31 loc) · 846 Bytes
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
#ifndef LIBFAT_HUMAN68K_FAT_H_
#define LIBFAT_HUMAN68K_FAT_H_
#include <stdint.h>
#include <functional>
#include <vector>
namespace libFAT {
namespace Human68k {
/* @brief Internal representation of a FAT
*
* The FAT class represents a File Allocation Table from the disk image
* internally. It provides accessors to traverse the FAT and modifiers to insert
* new entries into the FAT.
*/
class FAT {
public:
using uint12_t = uint16_t;
enum FATType {
FAT12,
FAT16,
};
FAT(FATType type, const void* buffer, size_t fat_size);
const uint12_t GetEntry(size_t cluster);
const uint12_t GetNextFreeEntry();
void DebugPrint() const;
private:
std::vector<uint12_t> entries_;
FATType type_;
};
} // namespace Human68k
} // namespace libFAT
#endif // LIBFAT_HUMAN68K_FAT_H_