-
Notifications
You must be signed in to change notification settings - Fork 0
/
Info.hpp
63 lines (53 loc) · 1.25 KB
/
Info.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
63
#pragma once
#include <Boot/Data.hpp>
#include <Boot/File.hpp>
#define CONFIG_PATH L"\\EFI\\Boot\\Config.ini"
namespace QuantumNEC::Boot {
typedef struct KvTable
{
CHAR8 *Key;
CHAR8 *Value;
KvTable *Next;
} _packed KvTable;
typedef struct
{
UINT32 Count;
KvTable *Kvs;
} _packed IniConfig;
typedef struct
{
IniConfig ini;
auto set( VOID ) -> VOID {
}
auto put( VOID ) -> VOID {
}
} _packed Config;
class BootServiceInfo : protected BootServiceDataManage< Config >
{
private:
enum class InfoCur {
KEY = 0x0,
VALUE = 0x1,
COMMENT = 0x2,
};
public:
explicit BootServiceInfo( IN Config * );
virtual ~BootServiceInfo( VOID ) = default;
private:
auto iniParseLine( IN IniConfig *, IN CHAR8 * ) -> decltype( auto );
auto iniGet( IniConfig *ini, CHAR8 *key ) -> decltype( auto );
auto iniLoad( IN wchar_t * ) -> decltype( auto );
public:
auto configGetString( IN CHAR8 *Name ) -> decltype( auto ) {
return this->iniGetString( Name );
}
private:
auto iniGetString( IN CHAR8 *Name ) -> wchar_t *;
private:
EFI_PHYSICAL_ADDRESS iniBuffer { };
private:
EFI_FILE_PROTOCOL *file { };
private:
BootServiceFile fileUtils;
};
} // namespace QuantumNEC::Boot