Add set, get and listkeys -sdltool CLI commands
[ric-plt/sdl.git] / include / private / cli / common.hpp
1 #ifndef SHAREDDATALAYER_CLI_COMMON_HPP
2 #define SHAREDDATALAYER_CLI_COMMON_HPP
3
4 #include <functional>
5 #include <iostream>
6 #include <sdl/syncstorage.hpp>
7
8 namespace shareddatalayer
9 {
10     namespace cli
11     {
12         inline std::ostream& operator<<(std::ostream &out, const SyncStorage::Data &data)
13         {
14             for (const auto& d : data)
15                 out << d;
16             return out;
17         }
18
19         inline std::ostream& operator<<(std::ostream& out, const SyncStorage::DataMap& dataMap)
20         {
21             for (const auto& d : dataMap)
22                 out << d.first << " " << d.second;
23             return out;
24         }
25     }
26 }
27 #endif