103 namespace serialization_xml
106 template <
typename T>
107 IGL_INLINE typename std::enable_if<std::is_fundamental<T>::value>::type
serialize(
const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
108 template <
typename T>
109 IGL_INLINE typename std::enable_if<std::is_fundamental<T>::value>::type
deserialize(T& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
112 IGL_INLINE void serialize(
const std::string& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
113 IGL_INLINE void deserialize(std::string& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
116 template <
typename T>
117 IGL_INLINE typename std::enable_if<std::is_base_of<XMLSerializableBase,T>::value>::type
serialize(
const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
118 template <
typename T>
119 IGL_INLINE typename std::enable_if<std::is_base_of<XMLSerializableBase,T>::value>::type
deserialize(T& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
122 template <
typename T1,
typename T2>
123 IGL_INLINE void serialize(
const std::pair<T1,T2>& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
124 template <
typename T1,
typename T2>
125 IGL_INLINE void deserialize(std::pair<T1,T2>& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
127 template <
typename T1,
typename T2>
128 IGL_INLINE void serialize(
const std::vector<T1,T2>& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
129 template <
typename T1,
typename T2>
130 IGL_INLINE void deserialize(std::vector<T1,T2>& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
132 template <
typename T>
133 IGL_INLINE void serialize(
const std::set<T>& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
134 template <
typename T>
135 IGL_INLINE void deserialize(std::set<T>& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
137 template <
typename T1,
typename T2>
138 IGL_INLINE void serialize(
const std::map<T1,T2>& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
139 template <
typename T1,
typename T2>
140 IGL_INLINE void deserialize(std::map<T1,T2>& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
155 template<
typename T,
int R,
int C,
int P,
int MR,
int MC>
157 const Eigen::Matrix<T,R,C,P,MR,MC>& obj,
158 const std::string& name,
159 const std::function<std::string(
const T &) >& to_string,
160 tinyxml2::XMLDocument* doc,
161 tinyxml2::XMLElement* element);
172 template<
typename T,
int R,
int C,
int P,
int MR,
int MC>
174 const tinyxml2::XMLDocument* doc,
175 const tinyxml2::XMLElement* element,
176 const std::string& name,
177 const std::function<
void(
const std::string &,T &)> & from_string,
178 Eigen::Matrix<T,R,C,P,MR,MC>& obj);
181 template<
typename T,
int R,
int C,
int P,
int MR,
int MC>
183 const Eigen::Matrix<T,R,C,P,MR,MC>& obj,
184 tinyxml2::XMLDocument* doc,
185 tinyxml2::XMLElement* element,
186 const std::string& name);
187 template<
typename T,
int R,
int C,
int P,
int MR,
int MC>
189 Eigen::Matrix<T,R,C,P,MR,MC>& obj,
190 const tinyxml2::XMLDocument* doc,
191 const tinyxml2::XMLElement* element,
192 const std::string& name);
194 template<
typename T,
int P,
typename I>
195 IGL_INLINE void serialize(
const Eigen::SparseMatrix<T,P,I>& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
196 template<
typename T,
int P,
typename I>
197 IGL_INLINE void deserialize(Eigen::SparseMatrix<T,P,I>& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
200 template <
typename T>
201 IGL_INLINE typename std::enable_if<std::is_pointer<T>::value>::type
serialize(
const T& obj,tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
202 template <
typename T>
203 IGL_INLINE typename std::enable_if<std::is_pointer<T>::value>::type
deserialize(T& obj,
const tinyxml2::XMLDocument* doc,
const tinyxml2::XMLElement* element,
const std::string& name);
206 tinyxml2::XMLElement*
getElement(tinyxml2::XMLDocument* doc,tinyxml2::XMLElement* element,
const std::string& name);
213 IGL_INLINE typename std::enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value>::type
getAttribute(
const char* src,T& dest);
215 IGL_INLINE typename std::enable_if<std::is_integral<T>::value && !std::is_unsigned<T>::value>::type
getAttribute(
const char* src,T& dest);
223 template <
typename T>
225 template <
typename T1,
typename T2>
227 template <
typename T1,
typename T2>
229 template <
typename T>
231 template <
typename T1,
typename T2>
234 template <
typename T>
236 template <
typename T,
int R,
int C,
int P,
int MR,
int MC>
238 template <
typename T,
int P,
typename I>
241 template <
typename T>
243 using T0 =
typename std::remove_pointer<T>::type;
244 static const bool value = std::is_fundamental<T0>::value || std::is_same<std::string,T0>::value || std::is_base_of<XMLSerializableBase,T0>::value