Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Store/Store.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Store.h"

using namespace ToolFramework;
namespace ToolFramework {

Store::Store(){}

Expand Down Expand Up @@ -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<<"\""<<it->first<<"\":"<< it->second;
first=false;
}
stream<<"}";
return stream;
}

}
9 changes: 6 additions & 3 deletions src/Store/Store.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ namespace ToolFramework{
stream<<"{";
bool first=true;
for (std::map<std::string,std::string>::iterator it=m_variables.begin(); it!=m_variables.end(); ++it){
if (!first) stream<<",";
stream<<"\""<<it->first<<"\":"<< it->second<<" ";
if (!first) stream<<", ";
stream<<"\""<<it->first<<"\":"<< it->second;

first=false;
}
Expand All @@ -215,6 +215,8 @@ namespace ToolFramework{

}

friend std::ostream& operator<<(std::ostream &stream, const Store &s);

std::map<std::string, std::string>::iterator begin() { return m_variables.begin(); }
std::map<std::string, std::string>::iterator end() { return m_variables.end(); }

Expand All @@ -227,6 +229,7 @@ namespace ToolFramework{

};

}
} // end ToolFramework namespace


#endif
Loading