File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,63 +59,6 @@ int main()
5959 catalog.cars .push_back (car);
6060 }
6161
62- #if 0
63- // To/from file XML
64- {
65- const std::filesystem::path filepath = "catalog.xml";
66-
67- // Serialize to file
68- {
69- const auto& [success, msg] = gpds::to_file<gpds::archiver_xml>(filepath, catalog);
70- if (!success) {
71- std::cerr << "could not store 'catalog' in file: " << msg << std::endl;
72- return EXIT_FAILURE;
73- }
74-
75- std::cout << "successfully serialized 'catalog' to file: " << filepath << std::endl;
76- }
77-
78- // Deserialize from file
79- {
80- car_catalog catalog1;
81- const auto& [success, msg] = gpds::from_file<gpds::archiver_xml>(filepath, catalog1);
82- if (!success) {
83- std::cerr << "could not load `catalog` from file: " << msg << std::endl;
84- return EXIT_FAILURE;
85- }
86-
87- std::cout << "successfully deserialized 'catalog' from file: " << filepath << std::endl;
88- }
89- }
90-
91- // To/from file YAML
92- {
93- const std::filesystem::path filepath = "catalog.yaml";
94-
95- // Serialize to file
96- {
97- const auto& [success, msg] = gpds::to_file<gpds::archiver_yaml>(filepath, catalog);
98- if (!success) {
99- std::cerr << "could not store 'catalog' in file: " << msg << std::endl;
100- return EXIT_FAILURE;
101- }
102-
103- std::cout << "successfully serialized 'catalog' to file: " << filepath << std::endl;
104- }
105-
106- // Deserialize from file
107- {
108- car_catalog catalog1;
109- const auto& [success, msg] = gpds::from_file<gpds::archiver_yaml>(filepath, catalog1);
110- if (!success) {
111- std::cerr << "could not load `catalog` from file: " << msg << std::endl;
112- return EXIT_FAILURE;
113- }
114-
115- std::cout << "successfully deserialized 'catalog' from file: " << filepath << std::endl;
116- }
117- }
118- #endif
11962 // To/from string XML
12063 #if GPDS_ENABLE_XML
12164 {
You can’t perform that action at this time.
0 commit comments