-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHive.cpp
More file actions
31 lines (25 loc) · 711 Bytes
/
Hive.cpp
File metadata and controls
31 lines (25 loc) · 711 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
#include <map>
#include <cassert>
#include <stdio.h>
#include "Hive.h"
using libreg::Hive;
static const std::map<Hive, std::string> mappings
{
{Hive::Root, "HKEY_CLASSES_ROOT"},
{Hive::LocalMachine, "HKEY_LOCAL_MACHINE"},
{Hive::Users, "HKEY_USERS"},
{Hive::CurrentUser, "HKEY_CURRENT_USER"},
{Hive::CurrentConfig, "HKEY_CURRENT_CONFIG"},
};
std::ostream& libreg::operator<<(std::ostream& stream, Hive hive)
{
auto it = mappings.find(hive);
assert(it != mappings.end());
return (stream << it->second.c_str());
}
std::wostream& libreg::operator<<(std::wostream& stream, Hive hive)
{
auto it = mappings.find(hive);
assert(it != mappings.end());
return (stream << it->second.c_str());
}