Make it possible to use a string binding for Path commands

This was requested a few days ago in the chat and might also present an alternative for #754
This commit is contained in:
Simon Hausmann 2022-01-04 14:16:01 +01:00 committed by Simon Hausmann
parent ac031a45f8
commit 36e07b8801
11 changed files with 139 additions and 111 deletions

View file

@ -37,6 +37,11 @@ public:
{
}
PathData(const SharedString &commands)
: data(cbindgen_private::types::PathData::Commands(commands))
{
}
friend bool operator==(const PathData &a, const PathData &b)
{
if (a.data.tag != b.data.tag)
@ -46,6 +51,8 @@ public:
return a.data.elements._0 == b.data.elements._0;
case cbindgen_private::types::PathData::Tag::Events:
return a.data.events._0 == b.data.events._0 && b.data.events._0 == b.data.events._0;
case cbindgen_private::types::PathData::Tag::Commands:
return a.data.commands._0 == b.data.commands._0;
case cbindgen_private::types::PathData::Tag::None:
return true;
}