-
Notifications
You must be signed in to change notification settings - Fork 0
/
UDF.hpp
62 lines (45 loc) · 917 Bytes
/
UDF.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "Tag.hpp"
class AVDP;
class Tag;
class PrimaryVDesc;
class PartitionDescriptor;
class LogicalVolumeDescriptor;
class UnallocSpaceDesc;
class UDF {
public:
struct Info {
std::string volume_id;
Timestamp record_time;
std::string version;
uint32_t block_size;
uint32_t nb_block;
long double free_size;
};
private:
int fd;
AVDP *avdp;
PrimaryVDesc *pvd;
PartitionDescriptor *pd;
LogicalVolumeDescriptor *lvd;
UnallocSpaceDesc *usd;
bool debug;
Tag getTagSector(int type);
public:
UDF(int fd);
bool isValid();
template <typename T>
T *loadDescriptor(Tag::Type type);
bool loadAVDP();
Info *loadInfo();
bool loadPVD();
bool loadPD();
bool loadLVD();
bool loadUSD();
void listPartition();
void listMVDS();
void listVDS(const extend_ad &ext);
const extend_ad &getPartition();
int getSizeBlock();
~UDF();
};