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