00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TO_XML_H
00014 #define TO_XML_H
00015
00016 #include <iostream>
00017
00018 template<typename T>
00019 inline void to_xml(const T& obj, const char* name = NULL, std::ostream& out = std::cout) {
00020 out << (to_string(obj));
00021 }
00022
00023 template<typename T>
00024 inline const char* to_string(const T& obj) {
00025 return "unknown data type";
00026 }
00027
00028 template<typename T>
00029 inline T from_string(const char* c) {
00030 return T();
00031 }
00032
00033 #endif //TO_XML_H