[SOLVED] JSON Serializing and Deserializing C++



    FString FilePath = "C:\\Users\\<YOUR_USER>\\Desktop\\Person.json";
    FString FileData = "";
    if (!FPlatformFileManager::Get().GetPlatformFile().FileExists(*FilePath))
    {
        UE_LOG(LogTemp, Warning, TEXT("DID NOT FIND FILE"));
        return;
    }

    FPerson PersonJSON;
    FFileHelper::LoadFileToString(FileData, *FilePath);

    UE_LOG(LogTemp, Warning, TEXT("%s"), *FileData);

    if (FJsonObjectConverter::JsonObjectStringToUStruct(FileData, &PersonJSON, 0, 0))
    {
        UE_LOG(LogTemp, Warning, TEXT("CONVERTED"));
        UE_LOG(LogTemp, Warning, TEXT("Name: %s Age: %d Occupation: %s"), *PersonJSON.Name, 
            PersonJSON.Age, *PersonJSON.Occupation);
    }


Just for persons needing a reference, this works out very well ^_^! able to get everything correct :D! Thank you again @**Zeblote !!! **

6 Likes