// GNU Lesser General Public License v3.0 // Copyright (c) 2023 Bart Beumer // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License v3.0 as published by // the Free Software Foundation. // #include "bmrshared/to_tuple.hpp" #include #include #include namespace bmrshared { std::vector detail::GetKeysMissing(const std::vector& allKeys, const std::string* const dataBegin, std::size_t arraySize) { const std::string* const dataEnd = (dataBegin + arraySize); std::vector keysMissing; for (const std::string* iter = dataBegin; iter != dataEnd; ++iter) { auto iterFound = std::find(allKeys.begin(), allKeys.end(), *iter); if (iterFound == allKeys.end()) { keysMissing.push_back(*iter); } } return keysMissing; } std::vector detail::GetKeysNotUsed(const std::vector& allKeys, const std::string* const dataBegin, std::size_t arraySize) { const std::string* const dataEnd = (dataBegin + arraySize); std::vector keysNotUsed; for (const auto& key : allKeys) { auto iterFound = std::find(dataBegin, dataEnd, key); if (iterFound == dataEnd) { keysNotUsed.push_back(key); } } return keysNotUsed; } } // namespace bmrshared