WiP: write GeneralSettings to YAML
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
|
||||
#include "yaml_ops.h"
|
||||
#include <algorithm>
|
||||
|
||||
YAML::Node operator >> (const YAML::Node& node, const YamlLookupTable& lut)
|
||||
{
|
||||
@@ -54,3 +53,21 @@ void operator >> (const YAML::Node& node, bool& value)
|
||||
value = node.as<int>();
|
||||
}
|
||||
}
|
||||
|
||||
namespace YAML {
|
||||
|
||||
Node operator << (const YamlLookupTable& lut, const int& value)
|
||||
{
|
||||
const auto& it =
|
||||
find_if(lut.begin(), lut.end(), [=](const YamlLookupTableElmt& elmt) {
|
||||
if (elmt.first == value) return true;
|
||||
return false;
|
||||
});
|
||||
|
||||
if (it != lut.end()) {
|
||||
return Node(it->second);
|
||||
}
|
||||
return Node();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user