#pragma once #ifndef LIBALMOND_SERIALIZE_H #define LIBALMOND_SERIALIZE_H #include #include "Gradient.h" #include namespace tinyxml2 { class XMLElement; class XMLDocument; } namespace alm { struct ImageView; template void serialize(tinyxml2::XMLElement* elem, const T&); template std::string toXml(const T&); template T deserialize(tinyxml2::XMLElement* xml); template T fromXml(const std::string& xml); // specializations template<> void serialize(tinyxml2::XMLElement* elem, const Gradient&); template<> Gradient deserialize(tinyxml2::XMLElement* xml); template<> std::string toXml(const Gradient&); template<> Gradient fromXml(const std::string& xml); template<> void serialize(tinyxml2::XMLElement* elem, const mnd::MandelViewport&); template<> mnd::MandelViewport deserialize(tinyxml2::XMLElement* xml); template<> void serialize(tinyxml2::XMLElement* elem, const mnd::MandelInfo&); template<> mnd::MandelInfo deserialize(tinyxml2::XMLElement* xml); template<> void serialize(tinyxml2::XMLElement* elem, const ImageView&); template<> ImageView deserialize(tinyxml2::XMLElement* xml); template<> std::string toXml(const ImageView&); template<> ImageView fromXml(const std::string& xml); } struct alm::ImageView { mnd::MandelInfo view; Gradient gradient; }; #endif // LIBALMOND_SERIALIZE_H