zengine-old/engine/3rdparty/zlib/include/refl/detail/convert.h
2024-06-14 22:24:52 +08:00

18 lines
523 B
C++

#pragma once
#include "any.h"
#include <unordered_map>
namespace refl {
using ConvertFunc = bool (*)(Any&, const Any&);
using ConvertMap = std::unordered_map<const UClass*, ConvertFunc>;
class Convert {
protected:
static ConvertMap BuildClassMap();
public:
static bool ToInt32(Any& dst, const Any& src);
static bool ToFloat(Any& dst, const Any& src);
static bool ToString(Any& dst,const Any& src);
static bool Construct(Any& dst, const Any& src);
inline static ConvertMap ClassMap = BuildClassMap();
};
}