Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsArraySerializer.cpp
Go to the documentation of this file.
1 
14 #include "WsArraySerializer.h"
15 using namespace Json;
16 
18  m_array(vect)
19 {
20 }
21 
23 {
24  /* Serialize each item of the vector */
25  int i = 0;
26  for (set<string>::iterator it = m_array.begin(); it != m_array.end(); ++it, ++i) {
27  m_root["array"][i] = *it;
28  }
29  return ErrorCode::Success;
30 }
31 
33 {
34  return m_root.toStyledString();
35 }
int serialize()
serializes the directory
Serializes the array.
std::set< std::string > m_array
The array to serialize.
const std::string getSerializedForm()
returns the serailized form of the directory
Json::Value m_root
the root of the Json tree
const int Success
WsArraySerializer(std::set< std::string > &vect)
Constructor.