-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAccessDeniedException.cpp
More file actions
39 lines (31 loc) · 953 Bytes
/
AccessDeniedException.cpp
File metadata and controls
39 lines (31 loc) · 953 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
#include <sstream>
#include "AccessDeniedException.h"
using libreg::AccessDeniedException;
using libreg::MultiString;
using libreg::SyscallFailure;
AccessDeniedException::AccessDeniedException(libreg::Hive hive, const MultiString& path, const SyscallFailure& inner)
: _hive(hive), _path(path), _inner(inner), _message(BuildMessage(hive, path, inner))
{
}
const char* AccessDeniedException::what() const noexcept
{
return _message.c_str();
}
const MultiString& AccessDeniedException::Path() const
{
return _path;
}
libreg::Hive AccessDeniedException::Hive() const
{
return _hive;
}
const SyscallFailure& AccessDeniedException::Inner() const
{
return _inner;
}
std::string AccessDeniedException::BuildMessage(libreg::Hive hive, const MultiString& path, const SyscallFailure& inner)
{
std::stringstream str;
str << "Access denied when accessing key: \"" << hive << "\\" << path << ", details: " << inner.what();
return str.str();
}