-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdatastore_access.cpp
More file actions
47 lines (40 loc) · 1.03 KB
/
datastore_access.cpp
File metadata and controls
47 lines (40 loc) · 1.03 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
42
43
44
45
46
47
/*
* Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
* Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
*
* Written by Václav Kubernát <kubervac@fit.cvut.cz>
*
*/
#include "datastore_access.hpp"
DatastoreError::DatastoreError(const std::string& message, const std::optional<std::string>& xpath)
: message(message)
, xpath(xpath)
{
}
DatastoreAccess::~DatastoreAccess() = default;
DatastoreException::DatastoreException(const std::vector<DatastoreError>& errors)
{
m_what = "The following errors occured:\n";
for (const auto& it : errors) {
m_what += " Message: ";
m_what += it.message;
m_what += "\n";
if (it.xpath) {
m_what += " XPath: ";
m_what += it.xpath.value();
m_what += "\n";
}
}
}
DatastoreTarget DatastoreAccess::target() const
{
return m_target;
}
void DatastoreAccess::setTarget(const DatastoreTarget target)
{
m_target = target;
}
const char* DatastoreException::what() const noexcept
{
return m_what.c_str();
}