Add set, get and listkeys -sdltool CLI commands
[ric-plt/sdl.git] / include / private / cli / common.hpp
diff --git a/include/private/cli/common.hpp b/include/private/cli/common.hpp
new file mode 100644 (file)
index 0000000..e213b41
--- /dev/null
@@ -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