diff --git a/CLC-qthing/SiliconTorch/NVSExplorer.cpp b/CLC-qthing/SiliconTorch/NVSExplorer.cpp index dfaf3df4005b91d6a19eafe5e1ce2442f4e8a374..cac14fb8db7faa59acf481db0574226a8c44412b 100644 --- a/CLC-qthing/SiliconTorch/NVSExplorer.cpp +++ b/CLC-qthing/SiliconTorch/NVSExplorer.cpp @@ -1183,6 +1183,53 @@ namespace SiliconTorch { } + + bool NVSExplorer::copyKey(const str& nameSpace, const str& keyFrom, const str& keyTo) { + + return false; // TODO: implementation! + + } + + bool NVSExplorer::copyKey(const str& nsFrom, const str& keyFrom, const str& nsTo, const str& keyTo) { + + nvs_type_t entryType = getType(nsFrom, keyFrom); + + if (entryType == NVS_TYPE_ANY) // key not found + return false; + + if (entryType == NVS_TYPE_BLOB) // BLOBs are currently unsupported + return false; + + + u64 intStorage = 0; + str strStorage = ""; + + + return false; + + } + + + bool NVSExplorer::moveKey(const str& nameSpace, const str& keyFrom, const str& keyTo) { + + if ( ! copyKey(nameSpace, keyFrom, keyTo) ) + return false; + + return removeKey(nameSpace, keyFrom); + } + + bool NVSExplorer::moveKey(const str& nsFrom, const str& keyFrom, const str& nsTo, const str& keyTo) { + + if ( ! copyKey(nsFrom, keyFrom, nsTo, keyTo) ) + return false; + + return removeKey(nsFrom, keyFrom); + } + + + + + str NVSExplorer::deviceTopic(const str& suffix) { return str(DEVICE_NAMESPACE + "NVS/") + suffix; } diff --git a/CLC-qthing/SiliconTorch/NVSExplorer.hpp b/CLC-qthing/SiliconTorch/NVSExplorer.hpp index 593801bb776747727ec9e76833e8dcd48acd16de..c163447bbdabf43443272f313de666953fec81d8 100644 --- a/CLC-qthing/SiliconTorch/NVSExplorer.hpp +++ b/CLC-qthing/SiliconTorch/NVSExplorer.hpp @@ -87,6 +87,13 @@ namespace SiliconTorch { bool setString(const str& nameSpace, const str& key, const str& value); + /* TODO: implement! */ bool copyKey(const str& nameSpace, const str& keyFrom, const str& keyTo); // copies key inside namespace + /* TODO: implement! */ bool copyKey(const str& nsFrom, const str& keyFrom, const str& nsTo, const str& keyTo); // copies key to another namespace + + /* TODO: test thoroughly! */ bool moveKey(const str& nameSpace, const str& keyFrom, const str& keyTo); // moves key inside namespace + /* TODO: test thoroughly! */ bool moveKey(const str& nsFrom, const str& keyFrom, const str& nsTo, const str& keyTo); // moves key to another namespace + + str type2str(nvs_type_t typ); nvs_type_t getType(const str& nameSpace, const str& key); str getTypeStr(const str& nameSpace, const str& key);