From a9e6c7579822bb2eb3c2962cb1eedde1210925a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Patrick=20Urbanke=20=28=E5=8A=89=E8=87=AA=E6=88=90?= =?UTF-8?q?=29?= Date: Sun, 7 Sep 2025 15:28:52 +0200 Subject: [PATCH] Better CSV example in README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cc244ab..eca7201d 100644 --- a/README.md +++ b/README.md @@ -249,8 +249,17 @@ std::cout << "Hello, my name is " << homer2.first_name() << " " reflect-cpp also supports tabular data formats, like CSV or Parquet: ```cpp +#include #include +struct Person { + std::string first_name; + std::string last_name = "Simpson"; + std::string town = "Springfield"; + int age; + rfl::Email email; +}; + const auto people = std::vector({Person{.first_name = "Bart", .birthday = "1987-04-19", @@ -276,7 +285,7 @@ const auto bytestring = rfl::parquet::write(people); This will resulting CSV will look like this: ``` -"first_name";"last_name";"town";"birthday";"age";"email" +"first_name","last_name","town","birthday","age","email" "Bart";"Simpson";"Springfield";1987-04-19;10;"bart@simpson.com" "Lisa";"Simpson";"Springfield";1987-04-19;8;"lisa@simpson.com" "Maggie";"Simpson";"Springfield";1987-04-19;0;"maggie@simpson.com"