Also do the comperty comparison in C++

This commit is contained in:
Olivier Goffart 2020-10-31 14:36:38 +01:00
parent 2ece3817cc
commit 1eb7203ec8
6 changed files with 82 additions and 4 deletions

View file

@ -17,12 +17,19 @@ namespace sixtyfps {
struct Resource
{
public:
using Tag = cbindgen_private::types::Resource::Tag;
Resource() : data(Data::None()) { }
Resource(const SharedString &file_path) : data(Data::AbsoluteFilePath(file_path)) { }
friend bool operator==(const Resource &a, const Resource &b) {
return a.data == b.data;
}
friend bool operator!=(const Resource &a, const Resource &b) {
return a.data != b.data;
}
private:
using Tag = cbindgen_private::types::Resource::Tag;
using Data = cbindgen_private::types::Resource;
Data data;
};