53 lines
997 B
C++
53 lines
997 B
C++
#define ZLIB_API
|
|
#define CORE_API
|
|
#define CORE_API_VAL
|
|
#include "archive/pch.h"
|
|
#include "pmr/memory.h"
|
|
#include "test_refl.h"
|
|
using namespace api;
|
|
using namespace std;
|
|
using namespace refl;
|
|
int main() {
|
|
//Guid g1(123, 0.456);
|
|
//auto text = TextSerialize(g1);
|
|
//TextDeserialize<Guid>(text, 0, (float)0.0);
|
|
{
|
|
using T = Guid;
|
|
T a(1,1.0);
|
|
a.view = "hello";
|
|
auto text = TextSerialize(a);
|
|
auto b = TextDeserialize<T>(text);
|
|
if (b) {
|
|
auto c = b.value();
|
|
}
|
|
}
|
|
{
|
|
using T = Guid;
|
|
T a(1, 1.0);
|
|
a.view = "hello";
|
|
auto text = JsonSerialize(a);
|
|
auto b = JsonDeserialize<T>(text);
|
|
if (b) {
|
|
auto c = b.value();
|
|
}
|
|
}
|
|
{
|
|
using T = std::basic_string<char>;
|
|
T a = "123456";
|
|
auto text = TextSerialize(a);
|
|
auto b = TextDeserialize<T>(text);
|
|
if (b) {
|
|
auto c = b.value();
|
|
}
|
|
}
|
|
{
|
|
using T = int;
|
|
T a = 123456;
|
|
auto text = TextSerialize(a);
|
|
auto b = TextDeserialize<T>(text);
|
|
if (b) {
|
|
auto c = b.value();
|
|
}
|
|
}
|
|
std::cout << "hello world" << std::endl;
|
|
} |