crocuis / RapidJsonPlugin

RapidJson Plugin for UnrealEngine 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RapidJsonPlugin

RapidJson Plugin for UnrealEngine 4

RapidJson is A fast JSON parser for C++. The purpose of this plug-in is to make RapidJson easy and simple to use, inspired by msgpack-c. This was implemented using template and MACRO, using better-enums to help stringify enum.

Example

JSON_MAKE_ENUM(Word, int, Hello, World);
JSON_EXTERNAL_DEFINE(FVector, X, Y, Z);

struct Sample_member_struct
{
  TArray<int32> Arr;
  TArray<FVector> Arr2;
  Word Word;
    
  JSON_DEFINE(Arr, Arr2, Word);
};

struct Sample_struct
{
  int32 TestInt;
  FString TestStr;
  sample_member_struct My_struct;

  JSON_DEFINE(TestInt, TestStr, My_struct)
};

Sample_member_struct member;
member.Arr = { 1,2,3,4,5 };
member.Arr2 = { FVector(1,2,3), FVector(2,3,4) };
member.Word = Word::World;
Sample_struct sample = { 1, TEXT("HELLO"), member };

auto json = Json::SerializeToJson(sample);
auto sample2 = Json::DeserializeFromJson<Sample_struct>(json);

sample == sample2

About

RapidJson Plugin for UnrealEngine 4


Languages

Language:C++ 98.1%Language:C# 1.9%