#include "json_cast.hpp" #include #include namespace mature { template void print_type() { std::cout << "unkown" << std::endl; } template<> void print_type() { std::cout << "char" << std::endl; } template<> void print_type() { std::cout << "wchar_t" << std::endl; } template<> void print_type() { std::cout << "UTF8CHAR" << std::endl; } template<> void print_type() { std::cout << "uint16_t" << std::endl; } template<> void print_type() { std::cout << "uint32_t" << std::endl; } FString GetString(const Value& ValueRef) { switch (ValueRef.GetType()) { case mature::Type::kFalseType: return TEXT("false"); case mature::Type::kTrueType: return TEXT("true"); case mature::Type::kNumberType: return FString::SanitizeFloat(mature::GetNumber(ValueRef), 0); case mature::Type::kStringType: return FString(ValueRef.GetString()); } return FString(); } bool GetStringBool(const Value& ValueRef, FString& value) { switch (ValueRef.GetType()) { case mature::Type::kFalseType: value = TEXT("false"); break; case mature::Type::kTrueType: value = TEXT("true"); break; case mature::Type::kNumberType: value = FString::SanitizeFloat(mature::GetNumber(ValueRef), 0); break; case mature::Type::kStringType: value = FString(ValueRef.GetString()); break; default: return false; } return true; } FString GetStringArray(const unsigned int idx, const Array& ArrayRef) { if (ArrayRef.Size() < idx)return FString(); return GetString(ArrayRef[idx]); } }