12#include <boost/algorithm/string.hpp>
38 for (
auto const& library_entry : value->listValue()) {
44 " one or more entries in the hooks-libraries list is not"
45 " a map (" << library_entry->getPosition() <<
")");
50 bool lib_found =
false;
58 for (
auto const& entry_item : library_entry->mapValue()) {
59 if (entry_item.first ==
"library") {
62 " error: value of 'library' element is not a string"
63 " giving the path to a hooks library (" <<
64 entry_item.second->getPosition() <<
")");
69 libname = (entry_item.second)->stringValue();
73 boost::erase_all(libname,
"\"");
75 if (libname.empty()) {
77 " error: value of 'library' element must not be"
79 entry_item.second->getPosition() <<
")");
83 if (libname.find(
"/") == string::npos) {
93 if (entry_item.first ==
"parameters") {
94 parameters = entry_item.second;
100 << entry_item.first <<
"("
101 << library_entry->getPosition() <<
")");
106 " one or more hooks-libraries elements are missing the"
107 " name of the library" <<
108 " (" << library_entry->getPosition() <<
")");
111 libraries.
add(libname, parameters);
To be removed. Please use ConfigError instead.
Wrapper class that holds hooks libraries configuration.
void clear()
Removes all configured hooks libraries.
void add(std::string libname, isc::data::ConstElementPtr parameters)
Adds additional hooks libraries.
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
static std::string default_hooks_path_
The default installation path for hook libraries, used to generate full path if only the hook library...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< const Element > ConstElementPtr
string trim(const string &input)
Trim leading and trailing spaces.
Defines the logger used by the top-level component of kea-lfc.