Last active
March 3, 2021 19:39
-
-
Save Loki-Astari/d0c0abd877dea82ee1af0c4114e92446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See Simple Example https://github.com/Loki-Astari/ThorsSerializer/blob/master/doc/example1.md | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
#include "ThorSerialize/Traits.h" | |
#include "ThorSerialize/JsonThor.h" | |
#include "ThorSerialize/SerUtil.h" | |
struct Data | |
{ | |
std::string id; | |
}; | |
// Declare the traits. | |
ThorsAnvil_MakeTrait(Data, id); | |
int main() | |
{ | |
using ThorsAnvil::Serialize::jsonImporter; | |
std::ifstream file("input.json"); | |
std::vecotr<Data> value | |
input >> jsonImporter(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment