Add set, get and listkeys -sdltool CLI commands
Added new sdltool CLI commands:
listkeys to list keys matching search pattern under the namespace.
get to read data from storage under the namespace.
set to write data to storage under the namespace.
Release version 1.5.1
Issue-Id: RIC-110
Change-Id: I6ce4b355e8a1d62e30bd4ffa79216318669915f8
Signed-off-by: Petri Ovaska <petri.ovaska@nokia.com>
diff --git a/include/private/cli/common.hpp b/include/private/cli/common.hpp
new file mode 100644
index 0000000..e213b41
--- /dev/null
+++ b/include/private/cli/common.hpp
@@ -0,0 +1,27 @@
+#ifndef SHAREDDATALAYER_CLI_COMMON_HPP
+#define SHAREDDATALAYER_CLI_COMMON_HPP
+
+#include <functional>
+#include <iostream>
+#include <sdl/syncstorage.hpp>
+
+namespace shareddatalayer
+{
+ namespace cli
+ {
+ inline std::ostream& operator<<(std::ostream &out, const SyncStorage::Data &data)
+ {
+ for (const auto& d : data)
+ out << d;
+ return out;
+ }
+
+ inline std::ostream& operator<<(std::ostream& out, const SyncStorage::DataMap& dataMap)
+ {
+ for (const auto& d : dataMap)
+ out << d.first << " " << d.second;
+ return out;
+ }
+ }
+}
+#endif