diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-02-20 23:59:24 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-02-21 00:36:06 +0000 |
commit | a142b8da33e6c6657a7aa529ddf0f1c0882ff0d5 (patch) | |
tree | 77a5a26bb7d9cd4c3560ea1502b2d117adb40e3d | |
parent | Allow override member variable names and selection helper when mapping member... (diff) | |
download | ilt-a142b8da33e6c6657a7aa529ddf0f1c0882ff0d5.tar.bz2 ilt-a142b8da33e6c6657a7aa529ddf0f1c0882ff0d5.tar.xz ilt-a142b8da33e6c6657a7aa529ddf0f1c0882ff0d5.zip |
Accept a CSV for glm::vec data
-rw-r--r-- | lib/persistence.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/persistence.h b/lib/persistence.h index e1f7605..01b2a7e 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -6,6 +6,7 @@ #include <map> #include <memory> #include <special_members.hpp> +#include <sstream> #include <stack> #include <stdexcept> #include <string> @@ -187,6 +188,17 @@ namespace Persistence { }; using SelectionV<V>::SelectionV; + using SelectionV<V>::setValue; + + void + setValue(std::string && s) override + { + std::stringstream ss {std::move(s)}; + for (glm::length_t n = 0; n < L; n += 1) { + ss >> this->v[n]; + ss.get(); + } + } void beginArray(Stack & stk) override |