infrastructure for PBD::Configuration to deliver metadata

This commit is contained in:
Paul Davis
2023-01-24 18:24:50 -07:00
parent 8071a085c4
commit f7387a5d77
4 changed files with 536 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
#include <iostream>
#include "pbd/compose.h"
#include "pbd/configuration.h"
#include "pbd/configuration_variable.h"
#include "pbd/debug.h"
@@ -109,3 +110,17 @@ ConfigVariableBase::miss ()
// placeholder for any debugging desired when a config variable
// is set but to the same value as it already has
}
Configuration::Metadata const *
Configuration::get_metadata (std::string const & name) const
{
auto i = all_metadata.find (name);
if (i != all_metadata.end()) {
/* Only return actual, useful metadata */
if (!i->second.empty() && !i->second.front().empty()) {
return &i->second;
}
}
return 0;
}