12 #include <boost/algorithm/string.hpp> 13 #include <boost/foreach.hpp> 41 if (library_entry->getType() != Element::map) {
43 " one or more entries in the hooks-libraries list is not" 44 " a map (" << library_entry->getPosition() <<
")");
49 bool lib_found =
false;
57 BOOST_FOREACH(
auto entry_item, library_entry->mapValue()) {
58 if (entry_item.first ==
"library") {
59 if (entry_item.second->getType() != Element::string) {
61 " error: value of 'library' element is not a string" 62 " giving the path to a hooks library (" <<
63 entry_item.second->getPosition() <<
")");
68 libname = (entry_item.second)->stringValue();
72 boost::erase_all(libname,
"\"");
74 if (libname.empty()) {
76 " error: value of 'library' element must not be" 78 entry_item.second->getPosition() <<
")");
87 if (entry_item.first ==
"parameters") {
88 parameters = entry_item.second;
94 << entry_item.first <<
"(" 95 << library_entry->getPosition() <<
")");
100 " one or more hooks-libraries elements are missing the" 101 " name of the library" <<
102 " (" << library_entry->getPosition() <<
")");
105 libraries.
add(libname, parameters);
Wrapper class that holds hooks libraries configuration.
void clear()
Removes all configured hooks libraries.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
To be removed. Please use ConfigError instead.
boost::shared_ptr< const Element > ConstElementPtr
Defines the logger used by the top-level component of kea-lfc.
void add(std::string libname, isc::data::ConstElementPtr parameters)
Adds additional hooks libraries.
string trim(const string &instring)
Trim Leading and Trailing Spaces.