mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-20 19:03:56 +02:00
Add serialization support for plugin configuration
This commit is contained in:
@@ -21,8 +21,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
|
#include <bitsery/ext/std_optional.h>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
|
#include "bitsery/ext/boost-path.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An object that's used to provide plugin-specific configuration. Right now
|
* An object that's used to provide plugin-specific configuration. Right now
|
||||||
* this is only used to declare plugin groups. A plugin group is a set of
|
* this is only used to declare plugin groups. A plugin group is a set of
|
||||||
@@ -86,4 +89,14 @@ class Configuration {
|
|||||||
* The matched glob pattern in the above configuration file.
|
* The matched glob pattern in the above configuration file.
|
||||||
*/
|
*/
|
||||||
std::optional<std::string> matched_pattern;
|
std::optional<std::string> matched_pattern;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.ext(group, bitsery::ext::StdOptional(),
|
||||||
|
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||||
|
s.ext(matched_file, bitsery::ext::StdOptional(),
|
||||||
|
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath()); });
|
||||||
|
s.ext(matched_pattern, bitsery::ext::StdOptional(),
|
||||||
|
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user