2023-12-16 17:10:45 +01:00
|
|
|
#include <wups/config/WUPSConfigItem.h>
|
|
|
|
#include <wups/config_api.h>
|
|
|
|
|
|
|
|
WUPSConfigItem::~WUPSConfigItem() {
|
2024-12-30 14:15:28 +01:00
|
|
|
releaseHandle();
|
|
|
|
}
|
|
|
|
|
|
|
|
WUPSConfigItem::WUPSConfigItem(WUPSConfigItem &&src) noexcept {
|
|
|
|
releaseHandle();
|
|
|
|
this->mHandle = src.mHandle;
|
|
|
|
src.mHandle = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
WUPSConfigItem &WUPSConfigItem::operator=(WUPSConfigItem &&src) noexcept {
|
|
|
|
if (this != &src) {
|
|
|
|
releaseHandle();
|
|
|
|
this->mHandle = src.mHandle;
|
|
|
|
src.mHandle = {};
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void WUPSConfigItem::releaseHandle() noexcept {
|
2023-12-16 17:10:45 +01:00
|
|
|
if (mHandle.handle != nullptr) {
|
|
|
|
WUPSConfigAPI_Item_Destroy(mHandle);
|
2024-12-30 14:15:28 +01:00
|
|
|
mHandle.handle = nullptr;
|
2023-12-16 17:10:45 +01:00
|
|
|
}
|
2024-12-30 14:15:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const WUPSConfigItemHandle &WUPSConfigItem::getHandle() const {
|
|
|
|
return mHandle;
|
|
|
|
}
|
|
|
|
|
|
|
|
void WUPSConfigItem::release() {
|
|
|
|
mHandle = {};
|
2023-12-16 17:10:45 +01:00
|
|
|
}
|