#pragma once
#include "type.h"
namespace YAML
{
	template<typename T>
	struct TextSerialize {
		static string Serialize(const Any& any);
		static bool Unserialize(const string& val, const Any& any);
	};
	using StringFuncs = std::pair<string(*)(const Any&), bool(*)(const string&, const Any& any)>;
	using StringFuncMap = std::unordered_map<const refl::UClass*, StringFuncs>;
	class TextArchive{
		static StringFuncMap BuildStringMap();
	public:
		inline static StringFuncMap FuncMap = BuildStringMap();
		template<typename T>
		static void Register();
		static Node Serialize(const Any& any);
		static bool Unserialize(const Node& res, const Any& any);
	};
}
