1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-01-23 16:16:16 +00:00

Extends Reflection::Struct slightly to capture the lengths of arrays.

This commit is contained in:
Thomas Harte
2020-05-14 22:59:44 -04:00
parent 8b76d4007e
commit 4481386a3d
2 changed files with 33 additions and 4 deletions

View File

@@ -56,6 +56,14 @@ class MultiStruct: public Reflection::Struct {
return nullptr;
}
size_t count_of(const std::string &name) const final {
for(auto &options: options_) {
auto info = options->type_of(name);
if(info) return options->count_of(name);
}
return 0;
}
const void *get(const std::string &name) const final {
for(auto &options: options_) {
auto value = options->get(name);