diff --git a/src/Store/Store.cpp b/src/Store/Store.cpp index d08a5ef..2eaade9 100644 --- a/src/Store/Store.cpp +++ b/src/Store/Store.cpp @@ -1,6 +1,6 @@ #include "Store.h" -using namespace ToolFramework; +namespace ToolFramework { Store::Store(){} @@ -211,3 +211,17 @@ bool Store::Destring(std::string key){ return true; } + +std::ostream& operator<<(std::ostream& stream, const Store& s){ + stream<<"{"; + bool first=true; + for(auto it=s.m_variables.begin(); it!=s.m_variables.end(); ++it){ + if (!first) stream<<", "; + stream<<"\""<first<<"\":"<< it->second; + first=false; + } + stream<<"}"; + return stream; +} + +} diff --git a/src/Store/Store.h b/src/Store/Store.h index 696ca64..49526cc 100644 --- a/src/Store/Store.h +++ b/src/Store/Store.h @@ -204,8 +204,8 @@ namespace ToolFramework{ stream<<"{"; bool first=true; for (std::map::iterator it=m_variables.begin(); it!=m_variables.end(); ++it){ - if (!first) stream<<","; - stream<<"\""<first<<"\":"<< it->second<<" "; + if (!first) stream<<", "; + stream<<"\""<first<<"\":"<< it->second; first=false; } @@ -215,6 +215,8 @@ namespace ToolFramework{ } + friend std::ostream& operator<<(std::ostream &stream, const Store &s); + std::map::iterator begin() { return m_variables.begin(); } std::map::iterator end() { return m_variables.end(); } @@ -227,6 +229,7 @@ namespace ToolFramework{ }; -} +} // end ToolFramework namespace + #endif