From 0ec913edac211bbf751a85b0f51c8b3d0fd19fc9 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Wed, 31 Jan 2024 14:55:25 +0300 Subject: [PATCH] Added `operator=` for DSC --- src/KKdLib/dsc.cpp | 9 +++++++++ src/KKdLib/dsc.hpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/KKdLib/dsc.cpp b/src/KKdLib/dsc.cpp index 29928445..9436bba5 100644 --- a/src/KKdLib/dsc.cpp +++ b/src/KKdLib/dsc.cpp @@ -3283,6 +3283,15 @@ bool dsc::load_file(void* data, const char* path, const char* file, uint32_t has return ret; } +dsc& dsc::operator=(const dsc& d) { + type = d.type; + signature = d.signature; + id = d.id; + data.assign(d.data.begin(), d.data.end()); + data_buffer.assign(d.data_buffer.begin(), d.data_buffer.end()); + return *this; +} + dsc_replace::dsc_replace(dsc_type src_type, dsc_type dst_type, bool dst_has_perf_id) : src_type(DSC_FT), dst_type(DSC_FT), replace_data() { diff --git a/src/KKdLib/dsc.hpp b/src/KKdLib/dsc.hpp index dfad43b5..56e531f2 100644 --- a/src/KKdLib/dsc.hpp +++ b/src/KKdLib/dsc.hpp @@ -309,6 +309,8 @@ struct dsc { static int32_t calculate_target_flying_time(int32_t bpm, int32_t time_signature); static bool load_file(void* data, const char* path, const char* file, uint32_t hash); + + dsc& operator=(const dsc& d); }; struct dsc_replace_data {