-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyNotFoundException.cpp
More file actions
42 lines (33 loc) · 1012 Bytes
/
KeyNotFoundException.cpp
File metadata and controls
42 lines (33 loc) · 1012 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
40
41
42
#include <sstream>
#include "KeyNotFoundException.h"
using libreg::KeyNotFoundException;
using libreg::MultiString;
using libreg::SyscallFailure;
KeyNotFoundException::KeyNotFoundException(libreg::Hive hive, const MultiString& path, const SyscallFailure& inner)
: _hive(hive), _path(path), _inner(inner), _message(BuildMessage(hive, path, inner))
{
}
const char* KeyNotFoundException::what() const noexcept
{
return _message.c_str();
}
const MultiString& KeyNotFoundException::Path() const
{
return _path;
}
libreg::Hive KeyNotFoundException::Hive() const
{
return _hive;
}
const SyscallFailure& KeyNotFoundException::Inner() const
{
return _inner;
}
std::string KeyNotFoundException::BuildMessage(libreg::Hive hive,
const MultiString& path,
const SyscallFailure& inner)
{
std::stringstream str;
str << "Key: \"" << hive << "\\" << path << " not found. " << inner.what();
return str.str();
}