Test case
1 generated file · +10 −9test/inputs/graphql/github1.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+10 −9
| @@ -154,18 +154,19 @@ namespace quicktype { | ||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | namespace quicktype { |
| 157 | - void from_json(const json & j, User & x); | |
| 158 | - void to_json(json & j, const User & x); | |
| 157 | +void from_json(const json & j, User & x); | |
| 158 | +void to_json(json & j, const User & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, Data & x); | |
| 161 | - void to_json(json & j, const Data & x); | |
| 160 | +void from_json(const json & j, Data & x); | |
| 161 | +void to_json(json & j, const Data & x); | |
| 162 | 162 | |
| 163 | - void from_json(const json & j, Error & x); | |
| 164 | - void to_json(json & j, const Error & x); | |
| 165 | - | |
| 166 | - void from_json(const json & j, TopLevel & x); | |
| 167 | - void to_json(json & j, const TopLevel & x); | |
| 163 | +void from_json(const json & j, Error & x); | |
| 164 | +void to_json(json & j, const Error & x); | |
| 168 | 165 | |
| 166 | +void from_json(const json & j, TopLevel & x); | |
| 167 | +void to_json(json & j, const TopLevel & x); | |
| 168 | +} | |
| 169 | +namespace quicktype { | |
| 169 | 170 | inline void from_json(const json & j, User& x) { |
| 170 | 171 | x.set_login(j.at("login").get<std::string>()); |
| 171 | 172 | x.set_real_name(get_stack_optional<std::string>(j, "realName")); |
Test case
1 generated file · +14 −13test/inputs/graphql/github2.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+14 −13
| @@ -187,24 +187,25 @@ namespace quicktype { | ||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | namespace quicktype { |
| 190 | - void from_json(const json & j, Repository & x); | |
| 191 | - void to_json(json & j, const Repository & x); | |
| 190 | +void from_json(const json & j, Repository & x); | |
| 191 | +void to_json(json & j, const Repository & x); | |
| 192 | 192 | |
| 193 | - void from_json(const json & j, RepositoryConnection & x); | |
| 194 | - void to_json(json & j, const RepositoryConnection & x); | |
| 193 | +void from_json(const json & j, RepositoryConnection & x); | |
| 194 | +void to_json(json & j, const RepositoryConnection & x); | |
| 195 | 195 | |
| 196 | - void from_json(const json & j, User & x); | |
| 197 | - void to_json(json & j, const User & x); | |
| 196 | +void from_json(const json & j, User & x); | |
| 197 | +void to_json(json & j, const User & x); | |
| 198 | 198 | |
| 199 | - void from_json(const json & j, Data & x); | |
| 200 | - void to_json(json & j, const Data & x); | |
| 199 | +void from_json(const json & j, Data & x); | |
| 200 | +void to_json(json & j, const Data & x); | |
| 201 | 201 | |
| 202 | - void from_json(const json & j, Error & x); | |
| 203 | - void to_json(json & j, const Error & x); | |
| 204 | - | |
| 205 | - void from_json(const json & j, TopLevel & x); | |
| 206 | - void to_json(json & j, const TopLevel & x); | |
| 202 | +void from_json(const json & j, Error & x); | |
| 203 | +void to_json(json & j, const Error & x); | |
| 207 | 204 | |
| 205 | +void from_json(const json & j, TopLevel & x); | |
| 206 | +void to_json(json & j, const TopLevel & x); | |
| 207 | +} | |
| 208 | +namespace quicktype { | |
| 208 | 209 | inline void from_json(const json & j, Repository& x) { |
| 209 | 210 | x.set_name(j.at("name").get<std::string>()); |
| 210 | 211 | } |
Test case
1 generated file · +18 −17test/inputs/graphql/github3.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+18 −17
| @@ -197,30 +197,31 @@ namespace quicktype { | ||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | namespace quicktype { |
| 200 | - void from_json(const json & j, PullRequest & x); | |
| 201 | - void to_json(json & j, const PullRequest & x); | |
| 200 | +void from_json(const json & j, PullRequest & x); | |
| 201 | +void to_json(json & j, const PullRequest & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, PullRequestConnection & x); | |
| 204 | - void to_json(json & j, const PullRequestConnection & x); | |
| 203 | +void from_json(const json & j, PullRequestConnection & x); | |
| 204 | +void to_json(json & j, const PullRequestConnection & x); | |
| 205 | 205 | |
| 206 | - void from_json(const json & j, Repository & x); | |
| 207 | - void to_json(json & j, const Repository & x); | |
| 206 | +void from_json(const json & j, Repository & x); | |
| 207 | +void to_json(json & j, const Repository & x); | |
| 208 | 208 | |
| 209 | - void from_json(const json & j, User & x); | |
| 210 | - void to_json(json & j, const User & x); | |
| 209 | +void from_json(const json & j, User & x); | |
| 210 | +void to_json(json & j, const User & x); | |
| 211 | 211 | |
| 212 | - void from_json(const json & j, Data & x); | |
| 213 | - void to_json(json & j, const Data & x); | |
| 212 | +void from_json(const json & j, Data & x); | |
| 213 | +void to_json(json & j, const Data & x); | |
| 214 | 214 | |
| 215 | - void from_json(const json & j, Error & x); | |
| 216 | - void to_json(json & j, const Error & x); | |
| 215 | +void from_json(const json & j, Error & x); | |
| 216 | +void to_json(json & j, const Error & x); | |
| 217 | 217 | |
| 218 | - void from_json(const json & j, TopLevel & x); | |
| 219 | - void to_json(json & j, const TopLevel & x); | |
| 220 | - | |
| 221 | - void from_json(const json & j, PullRequestState & x); | |
| 222 | - void to_json(json & j, const PullRequestState & x); | |
| 218 | +void from_json(const json & j, TopLevel & x); | |
| 219 | +void to_json(json & j, const TopLevel & x); | |
| 223 | 220 | |
| 221 | +void from_json(const json & j, PullRequestState & x); | |
| 222 | +void to_json(json & j, const PullRequestState & x); | |
| 223 | +} | |
| 224 | +namespace quicktype { | |
| 224 | 225 | inline void from_json(const json & j, PullRequest& x) { |
| 225 | 226 | x.set_state(j.at("state").get<PullRequestState>()); |
| 226 | 227 | } |
Test case
1 generated file · +18 −17test/inputs/graphql/github4.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+18 −17
| @@ -201,30 +201,31 @@ namespace quicktype { | ||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | namespace quicktype { |
| 204 | - void from_json(const json & j, PullRequest & x); | |
| 205 | - void to_json(json & j, const PullRequest & x); | |
| 204 | +void from_json(const json & j, PullRequest & x); | |
| 205 | +void to_json(json & j, const PullRequest & x); | |
| 206 | 206 | |
| 207 | - void from_json(const json & j, PullRequestConnection & x); | |
| 208 | - void to_json(json & j, const PullRequestConnection & x); | |
| 207 | +void from_json(const json & j, PullRequestConnection & x); | |
| 208 | +void to_json(json & j, const PullRequestConnection & x); | |
| 209 | 209 | |
| 210 | - void from_json(const json & j, Repository & x); | |
| 211 | - void to_json(json & j, const Repository & x); | |
| 210 | +void from_json(const json & j, Repository & x); | |
| 211 | +void to_json(json & j, const Repository & x); | |
| 212 | 212 | |
| 213 | - void from_json(const json & j, User & x); | |
| 214 | - void to_json(json & j, const User & x); | |
| 213 | +void from_json(const json & j, User & x); | |
| 214 | +void to_json(json & j, const User & x); | |
| 215 | 215 | |
| 216 | - void from_json(const json & j, Data & x); | |
| 217 | - void to_json(json & j, const Data & x); | |
| 216 | +void from_json(const json & j, Data & x); | |
| 217 | +void to_json(json & j, const Data & x); | |
| 218 | 218 | |
| 219 | - void from_json(const json & j, Error & x); | |
| 220 | - void to_json(json & j, const Error & x); | |
| 219 | +void from_json(const json & j, Error & x); | |
| 220 | +void to_json(json & j, const Error & x); | |
| 221 | 221 | |
| 222 | - void from_json(const json & j, TopLevel & x); | |
| 223 | - void to_json(json & j, const TopLevel & x); | |
| 224 | - | |
| 225 | - void from_json(const json & j, PullRequestState & x); | |
| 226 | - void to_json(json & j, const PullRequestState & x); | |
| 222 | +void from_json(const json & j, TopLevel & x); | |
| 223 | +void to_json(json & j, const TopLevel & x); | |
| 227 | 224 | |
| 225 | +void from_json(const json & j, PullRequestState & x); | |
| 226 | +void to_json(json & j, const PullRequestState & x); | |
| 227 | +} | |
| 228 | +namespace quicktype { | |
| 228 | 229 | inline void from_json(const json & j, PullRequest& x) { |
| 229 | 230 | x.set_state(j.at("state").get<PullRequestState>()); |
| 230 | 231 | } |
Test case
1 generated file · +10 −9test/inputs/graphql/github5.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+10 −9
| @@ -154,18 +154,19 @@ namespace quicktype { | ||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | namespace quicktype { |
| 157 | - void from_json(const json & j, User & x); | |
| 158 | - void to_json(json & j, const User & x); | |
| 157 | +void from_json(const json & j, User & x); | |
| 158 | +void to_json(json & j, const User & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, Data & x); | |
| 161 | - void to_json(json & j, const Data & x); | |
| 160 | +void from_json(const json & j, Data & x); | |
| 161 | +void to_json(json & j, const Data & x); | |
| 162 | 162 | |
| 163 | - void from_json(const json & j, Error & x); | |
| 164 | - void to_json(json & j, const Error & x); | |
| 165 | - | |
| 166 | - void from_json(const json & j, TopLevel & x); | |
| 167 | - void to_json(json & j, const TopLevel & x); | |
| 163 | +void from_json(const json & j, Error & x); | |
| 164 | +void to_json(json & j, const Error & x); | |
| 168 | 165 | |
| 166 | +void from_json(const json & j, TopLevel & x); | |
| 167 | +void to_json(json & j, const TopLevel & x); | |
| 168 | +} | |
| 169 | +namespace quicktype { | |
| 169 | 170 | inline void from_json(const json & j, User& x) { |
| 170 | 171 | x.set_login(j.at("login").get<std::string>()); |
| 171 | 172 | x.set_name(get_stack_optional<std::string>(j, "name")); |
Test case
1 generated file · +10 −9test/inputs/graphql/github6.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+10 −9
| @@ -154,18 +154,19 @@ namespace quicktype { | ||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | namespace quicktype { |
| 157 | - void from_json(const json & j, UniformResourceLocatable & x); | |
| 158 | - void to_json(json & j, const UniformResourceLocatable & x); | |
| 157 | +void from_json(const json & j, UniformResourceLocatable & x); | |
| 158 | +void to_json(json & j, const UniformResourceLocatable & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, Data & x); | |
| 161 | - void to_json(json & j, const Data & x); | |
| 160 | +void from_json(const json & j, Data & x); | |
| 161 | +void to_json(json & j, const Data & x); | |
| 162 | 162 | |
| 163 | - void from_json(const json & j, Error & x); | |
| 164 | - void to_json(json & j, const Error & x); | |
| 165 | - | |
| 166 | - void from_json(const json & j, TopLevel & x); | |
| 167 | - void to_json(json & j, const TopLevel & x); | |
| 163 | +void from_json(const json & j, Error & x); | |
| 164 | +void to_json(json & j, const Error & x); | |
| 168 | 165 | |
| 166 | +void from_json(const json & j, TopLevel & x); | |
| 167 | +void to_json(json & j, const TopLevel & x); | |
| 168 | +} | |
| 169 | +namespace quicktype { | |
| 169 | 170 | inline void from_json(const json & j, UniformResourceLocatable& x) { |
| 170 | 171 | x.set_url(j.at("url").get<std::string>()); |
| 171 | 172 | x.set_login(get_stack_optional<std::string>(j, "login")); |
Test case
1 generated file · +18 −17test/inputs/graphql/github7.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+18 −17
| @@ -234,30 +234,31 @@ namespace quicktype { | ||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | namespace quicktype { |
| 237 | - void from_json(const json & j, Connection & x); | |
| 238 | - void to_json(json & j, const Connection & x); | |
| 237 | +void from_json(const json & j, Connection & x); | |
| 238 | +void to_json(json & j, const Connection & x); | |
| 239 | 239 | |
| 240 | - void from_json(const json & j, Repository & x); | |
| 241 | - void to_json(json & j, const Repository & x); | |
| 240 | +void from_json(const json & j, Repository & x); | |
| 241 | +void to_json(json & j, const Repository & x); | |
| 242 | 242 | |
| 243 | - void from_json(const json & j, RepositoryEdge & x); | |
| 244 | - void to_json(json & j, const RepositoryEdge & x); | |
| 243 | +void from_json(const json & j, RepositoryEdge & x); | |
| 244 | +void to_json(json & j, const RepositoryEdge & x); | |
| 245 | 245 | |
| 246 | - void from_json(const json & j, RepositoryConnection & x); | |
| 247 | - void to_json(json & j, const RepositoryConnection & x); | |
| 246 | +void from_json(const json & j, RepositoryConnection & x); | |
| 247 | +void to_json(json & j, const RepositoryConnection & x); | |
| 248 | 248 | |
| 249 | - void from_json(const json & j, User & x); | |
| 250 | - void to_json(json & j, const User & x); | |
| 249 | +void from_json(const json & j, User & x); | |
| 250 | +void to_json(json & j, const User & x); | |
| 251 | 251 | |
| 252 | - void from_json(const json & j, Data & x); | |
| 253 | - void to_json(json & j, const Data & x); | |
| 252 | +void from_json(const json & j, Data & x); | |
| 253 | +void to_json(json & j, const Data & x); | |
| 254 | 254 | |
| 255 | - void from_json(const json & j, Error & x); | |
| 256 | - void to_json(json & j, const Error & x); | |
| 257 | - | |
| 258 | - void from_json(const json & j, TopLevel & x); | |
| 259 | - void to_json(json & j, const TopLevel & x); | |
| 255 | +void from_json(const json & j, Error & x); | |
| 256 | +void to_json(json & j, const Error & x); | |
| 260 | 257 | |
| 258 | +void from_json(const json & j, TopLevel & x); | |
| 259 | +void to_json(json & j, const TopLevel & x); | |
| 260 | +} | |
| 261 | +namespace quicktype { | |
| 261 | 262 | inline void from_json(const json & j, Connection& x) { |
| 262 | 263 | x.set_total_count(j.at("totalCount").get<int64_t>()); |
| 263 | 264 | } |
Test case
1 generated file · +14 −13test/inputs/graphql/github8.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+14 −13
| @@ -183,24 +183,25 @@ namespace quicktype { | ||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | namespace quicktype { |
| 186 | - void from_json(const json & j, IssueOrPullRequest & x); | |
| 187 | - void to_json(json & j, const IssueOrPullRequest & x); | |
| 186 | +void from_json(const json & j, IssueOrPullRequest & x); | |
| 187 | +void to_json(json & j, const IssueOrPullRequest & x); | |
| 188 | 188 | |
| 189 | - void from_json(const json & j, Repository & x); | |
| 190 | - void to_json(json & j, const Repository & x); | |
| 189 | +void from_json(const json & j, Repository & x); | |
| 190 | +void to_json(json & j, const Repository & x); | |
| 191 | 191 | |
| 192 | - void from_json(const json & j, Data & x); | |
| 193 | - void to_json(json & j, const Data & x); | |
| 192 | +void from_json(const json & j, Data & x); | |
| 193 | +void to_json(json & j, const Data & x); | |
| 194 | 194 | |
| 195 | - void from_json(const json & j, Error & x); | |
| 196 | - void to_json(json & j, const Error & x); | |
| 195 | +void from_json(const json & j, Error & x); | |
| 196 | +void to_json(json & j, const Error & x); | |
| 197 | 197 | |
| 198 | - void from_json(const json & j, TopLevel & x); | |
| 199 | - void to_json(json & j, const TopLevel & x); | |
| 200 | - | |
| 201 | - void from_json(const json & j, IssueState & x); | |
| 202 | - void to_json(json & j, const IssueState & x); | |
| 198 | +void from_json(const json & j, TopLevel & x); | |
| 199 | +void to_json(json & j, const TopLevel & x); | |
| 203 | 200 | |
| 201 | +void from_json(const json & j, IssueState & x); | |
| 202 | +void to_json(json & j, const IssueState & x); | |
| 203 | +} | |
| 204 | +namespace quicktype { | |
| 204 | 205 | inline void from_json(const json & j, IssueOrPullRequest& x) { |
| 205 | 206 | x.set_title(get_stack_optional<std::string>(j, "title")); |
| 206 | 207 | x.set_state(get_stack_optional<IssueState>(j, "state")); |
Test case
1 generated file · +16 −15test/inputs/graphql/github9.graphql
Mgraphql-cplusplusdefault / quicktype.hpp+16 −15
| @@ -192,27 +192,28 @@ namespace quicktype { | ||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | namespace quicktype { |
| 195 | - void from_json(const json & j, Reaction & x); | |
| 196 | - void to_json(json & j, const Reaction & x); | |
| 195 | +void from_json(const json & j, Reaction & x); | |
| 196 | +void to_json(json & j, const Reaction & x); | |
| 197 | 197 | |
| 198 | - void from_json(const json & j, Reactable & x); | |
| 199 | - void to_json(json & j, const Reactable & x); | |
| 198 | +void from_json(const json & j, Reactable & x); | |
| 199 | +void to_json(json & j, const Reactable & x); | |
| 200 | 200 | |
| 201 | - void from_json(const json & j, AddReactionPayload & x); | |
| 202 | - void to_json(json & j, const AddReactionPayload & x); | |
| 201 | +void from_json(const json & j, AddReactionPayload & x); | |
| 202 | +void to_json(json & j, const AddReactionPayload & x); | |
| 203 | 203 | |
| 204 | - void from_json(const json & j, Data & x); | |
| 205 | - void to_json(json & j, const Data & x); | |
| 204 | +void from_json(const json & j, Data & x); | |
| 205 | +void to_json(json & j, const Data & x); | |
| 206 | 206 | |
| 207 | - void from_json(const json & j, Error & x); | |
| 208 | - void to_json(json & j, const Error & x); | |
| 207 | +void from_json(const json & j, Error & x); | |
| 208 | +void to_json(json & j, const Error & x); | |
| 209 | 209 | |
| 210 | - void from_json(const json & j, TopLevel & x); | |
| 211 | - void to_json(json & j, const TopLevel & x); | |
| 212 | - | |
| 213 | - void from_json(const json & j, ReactionContent & x); | |
| 214 | - void to_json(json & j, const ReactionContent & x); | |
| 210 | +void from_json(const json & j, TopLevel & x); | |
| 211 | +void to_json(json & j, const TopLevel & x); | |
| 215 | 212 | |
| 213 | +void from_json(const json & j, ReactionContent & x); | |
| 214 | +void to_json(json & j, const ReactionContent & x); | |
| 215 | +} | |
| 216 | +namespace quicktype { | |
| 216 | 217 | inline void from_json(const json & j, Reaction& x) { |
| 217 | 218 | x.set_content(j.at("content").get<ReactionContent>()); |
| 218 | 219 | } |
Test case
1 generated file · +28 −27test/inputs/json/misc/00ec5.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -303,45 +303,46 @@ namespace quicktype { | ||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | namespace quicktype { |
| 306 | - void from_json(const json & j, Property & x); | |
| 307 | - void to_json(json & j, const Property & x); | |
| 306 | +void from_json(const json & j, Property & x); | |
| 307 | +void to_json(json & j, const Property & x); | |
| 308 | 308 | |
| 309 | - void from_json(const json & j, Provider & x); | |
| 310 | - void to_json(json & j, const Provider & x); | |
| 309 | +void from_json(const json & j, Provider & x); | |
| 310 | +void to_json(json & j, const Provider & x); | |
| 311 | 311 | |
| 312 | - void from_json(const json & j, Definitions & x); | |
| 313 | - void to_json(json & j, const Definitions & x); | |
| 312 | +void from_json(const json & j, Definitions & x); | |
| 313 | +void to_json(json & j, const Definitions & x); | |
| 314 | 314 | |
| 315 | - void from_json(const json & j, Info & x); | |
| 316 | - void to_json(json & j, const Info & x); | |
| 315 | +void from_json(const json & j, Info & x); | |
| 316 | +void to_json(json & j, const Info & x); | |
| 317 | 317 | |
| 318 | - void from_json(const json & j, Parameter & x); | |
| 319 | - void to_json(json & j, const Parameter & x); | |
| 318 | +void from_json(const json & j, Parameter & x); | |
| 319 | +void to_json(json & j, const Parameter & x); | |
| 320 | 320 | |
| 321 | - void from_json(const json & j, Schema & x); | |
| 322 | - void to_json(json & j, const Schema & x); | |
| 321 | +void from_json(const json & j, Schema & x); | |
| 322 | +void to_json(json & j, const Schema & x); | |
| 323 | 323 | |
| 324 | - void from_json(const json & j, The200 & x); | |
| 325 | - void to_json(json & j, const The200 & x); | |
| 324 | +void from_json(const json & j, The200 & x); | |
| 325 | +void to_json(json & j, const The200 & x); | |
| 326 | 326 | |
| 327 | - void from_json(const json & j, Responses & x); | |
| 328 | - void to_json(json & j, const Responses & x); | |
| 327 | +void from_json(const json & j, Responses & x); | |
| 328 | +void to_json(json & j, const Responses & x); | |
| 329 | 329 | |
| 330 | - void from_json(const json & j, Get & x); | |
| 331 | - void to_json(json & j, const Get & x); | |
| 330 | +void from_json(const json & j, Get & x); | |
| 331 | +void to_json(json & j, const Get & x); | |
| 332 | 332 | |
| 333 | - void from_json(const json & j, BusinessServiceProvidersSearch & x); | |
| 334 | - void to_json(json & j, const BusinessServiceProvidersSearch & x); | |
| 333 | +void from_json(const json & j, BusinessServiceProvidersSearch & x); | |
| 334 | +void to_json(json & j, const BusinessServiceProvidersSearch & x); | |
| 335 | 335 | |
| 336 | - void from_json(const json & j, Paths & x); | |
| 337 | - void to_json(json & j, const Paths & x); | |
| 336 | +void from_json(const json & j, Paths & x); | |
| 337 | +void to_json(json & j, const Paths & x); | |
| 338 | 338 | |
| 339 | - void from_json(const json & j, TopLevel & x); | |
| 340 | - void to_json(json & j, const TopLevel & x); | |
| 341 | - | |
| 342 | - void from_json(const json & j, Type & x); | |
| 343 | - void to_json(json & j, const Type & x); | |
| 339 | +void from_json(const json & j, TopLevel & x); | |
| 340 | +void to_json(json & j, const TopLevel & x); | |
| 344 | 341 | |
| 342 | +void from_json(const json & j, Type & x); | |
| 343 | +void to_json(json & j, const Type & x); | |
| 344 | +} | |
| 345 | +namespace quicktype { | |
| 345 | 346 | inline void from_json(const json & j, Property& x) { |
| 346 | 347 | x.set_description(j.at("description").get<std::string>()); |
| 347 | 348 | x.set_type(j.at("type").get<Type>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/010b1.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/016af.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/033b1.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +22 −21test/inputs/json/misc/050b0.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -229,36 +229,37 @@ namespace quicktype { | ||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | namespace quicktype { |
| 232 | - void from_json(const json & j, Identifier & x); | |
| 233 | - void to_json(json & j, const Identifier & x); | |
| 232 | +void from_json(const json & j, Identifier & x); | |
| 233 | +void to_json(json & j, const Identifier & x); | |
| 234 | 234 | |
| 235 | - void from_json(const json & j, Link & x); | |
| 236 | - void to_json(json & j, const Link & x); | |
| 235 | +void from_json(const json & j, Link & x); | |
| 236 | +void to_json(json & j, const Link & x); | |
| 237 | 237 | |
| 238 | - void from_json(const json & j, OtherName & x); | |
| 239 | - void to_json(json & j, const OtherName & x); | |
| 238 | +void from_json(const json & j, OtherName & x); | |
| 239 | +void to_json(json & j, const OtherName & x); | |
| 240 | 240 | |
| 241 | - void from_json(const json & j, Text & x); | |
| 242 | - void to_json(json & j, const Text & x); | |
| 241 | +void from_json(const json & j, Text & x); | |
| 242 | +void to_json(json & j, const Text & x); | |
| 243 | 243 | |
| 244 | - void from_json(const json & j, TopLevelElement & x); | |
| 245 | - void to_json(json & j, const TopLevelElement & x); | |
| 244 | +void from_json(const json & j, TopLevelElement & x); | |
| 245 | +void to_json(json & j, const TopLevelElement & x); | |
| 246 | 246 | |
| 247 | - void from_json(const json & j, Scheme & x); | |
| 248 | - void to_json(json & j, const Scheme & x); | |
| 247 | +void from_json(const json & j, Scheme & x); | |
| 248 | +void to_json(json & j, const Scheme & x); | |
| 249 | 249 | |
| 250 | - void from_json(const json & j, Keyword & x); | |
| 251 | - void to_json(json & j, const Keyword & x); | |
| 250 | +void from_json(const json & j, Keyword & x); | |
| 251 | +void to_json(json & j, const Keyword & x); | |
| 252 | 252 | |
| 253 | - void from_json(const json & j, Note & x); | |
| 254 | - void to_json(json & j, const Note & x); | |
| 253 | +void from_json(const json & j, Note & x); | |
| 254 | +void to_json(json & j, const Note & x); | |
| 255 | 255 | |
| 256 | - void from_json(const json & j, MediaType & x); | |
| 257 | - void to_json(json & j, const MediaType & x); | |
| 258 | - | |
| 259 | - void from_json(const json & j, Title & x); | |
| 260 | - void to_json(json & j, const Title & x); | |
| 256 | +void from_json(const json & j, MediaType & x); | |
| 257 | +void to_json(json & j, const MediaType & x); | |
| 261 | 258 | |
| 259 | +void from_json(const json & j, Title & x); | |
| 260 | +void to_json(json & j, const Title & x); | |
| 261 | +} | |
| 262 | +namespace quicktype { | |
| 262 | 263 | inline void from_json(const json & j, Identifier& x) { |
| 263 | 264 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 264 | 265 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +20 −19test/inputs/json/misc/06bee.json
Mcplusplusdefault / quicktype.hpp+20 −19
| @@ -156,33 +156,34 @@ namespace quicktype { | ||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | namespace quicktype { |
| 159 | - void from_json(const json & j, Identifier & x); | |
| 160 | - void to_json(json & j, const Identifier & x); | |
| 159 | +void from_json(const json & j, Identifier & x); | |
| 160 | +void to_json(json & j, const Identifier & x); | |
| 161 | 161 | |
| 162 | - void from_json(const json & j, Link & x); | |
| 163 | - void to_json(json & j, const Link & x); | |
| 162 | +void from_json(const json & j, Link & x); | |
| 163 | +void to_json(json & j, const Link & x); | |
| 164 | 164 | |
| 165 | - void from_json(const json & j, Text & x); | |
| 166 | - void to_json(json & j, const Text & x); | |
| 165 | +void from_json(const json & j, Text & x); | |
| 166 | +void to_json(json & j, const Text & x); | |
| 167 | 167 | |
| 168 | - void from_json(const json & j, TopLevelElement & x); | |
| 169 | - void to_json(json & j, const TopLevelElement & x); | |
| 168 | +void from_json(const json & j, TopLevelElement & x); | |
| 169 | +void to_json(json & j, const TopLevelElement & x); | |
| 170 | 170 | |
| 171 | - void from_json(const json & j, Scheme & x); | |
| 172 | - void to_json(json & j, const Scheme & x); | |
| 171 | +void from_json(const json & j, Scheme & x); | |
| 172 | +void to_json(json & j, const Scheme & x); | |
| 173 | 173 | |
| 174 | - void from_json(const json & j, Keyword & x); | |
| 175 | - void to_json(json & j, const Keyword & x); | |
| 174 | +void from_json(const json & j, Keyword & x); | |
| 175 | +void to_json(json & j, const Keyword & x); | |
| 176 | 176 | |
| 177 | - void from_json(const json & j, Note & x); | |
| 178 | - void to_json(json & j, const Note & x); | |
| 177 | +void from_json(const json & j, Note & x); | |
| 178 | +void to_json(json & j, const Note & x); | |
| 179 | 179 | |
| 180 | - void from_json(const json & j, MediaType & x); | |
| 181 | - void to_json(json & j, const MediaType & x); | |
| 182 | - | |
| 183 | - void from_json(const json & j, Title & x); | |
| 184 | - void to_json(json & j, const Title & x); | |
| 180 | +void from_json(const json & j, MediaType & x); | |
| 181 | +void to_json(json & j, const MediaType & x); | |
| 185 | 182 | |
| 183 | +void from_json(const json & j, Title & x); | |
| 184 | +void to_json(json & j, const Title & x); | |
| 185 | +} | |
| 186 | +namespace quicktype { | |
| 186 | 187 | inline void from_json(const json & j, Identifier& x) { |
| 187 | 188 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 188 | 189 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/07540.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -57,12 +57,13 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, Cookies & x); | |
| 61 | - void to_json(json & j, const Cookies & x); | |
| 62 | - | |
| 63 | - void from_json(const json & j, TopLevel & x); | |
| 64 | - void to_json(json & j, const TopLevel & x); | |
| 60 | +void from_json(const json & j, Cookies & x); | |
| 61 | +void to_json(json & j, const Cookies & x); | |
| 65 | 62 | |
| 63 | +void from_json(const json & j, TopLevel & x); | |
| 64 | +void to_json(json & j, const TopLevel & x); | |
| 65 | +} | |
| 66 | +namespace quicktype { | |
| 66 | 67 | inline void from_json(const json & j, Cookies& x) { |
| 67 | 68 | (void)j; |
| 68 | 69 | (void)x; |
Test case
1 generated file · +10 −9test/inputs/json/misc/0779f.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/07c75.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -146,18 +146,19 @@ namespace quicktype { | ||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | namespace quicktype { |
| 149 | - void from_json(const json & j, Identifier & x); | |
| 150 | - void to_json(json & j, const Identifier & x); | |
| 149 | +void from_json(const json & j, Identifier & x); | |
| 150 | +void to_json(json & j, const Identifier & x); | |
| 151 | 151 | |
| 152 | - void from_json(const json & j, Link & x); | |
| 153 | - void to_json(json & j, const Link & x); | |
| 152 | +void from_json(const json & j, Link & x); | |
| 153 | +void to_json(json & j, const Link & x); | |
| 154 | 154 | |
| 155 | - void from_json(const json & j, Text & x); | |
| 156 | - void to_json(json & j, const Text & x); | |
| 157 | - | |
| 158 | - void from_json(const json & j, TopLevelElement & x); | |
| 159 | - void to_json(json & j, const TopLevelElement & x); | |
| 155 | +void from_json(const json & j, Text & x); | |
| 156 | +void to_json(json & j, const Text & x); | |
| 160 | 157 | |
| 158 | +void from_json(const json & j, TopLevelElement & x); | |
| 159 | +void to_json(json & j, const TopLevelElement & x); | |
| 160 | +} | |
| 161 | +namespace quicktype { | |
| 161 | 162 | inline void from_json(const json & j, Identifier& x) { |
| 162 | 163 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 163 | 164 | x.set_scheme(j.at("scheme").get<std::string>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/09f54.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -100,15 +100,16 @@ namespace quicktype { | ||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | namespace quicktype { |
| 103 | - void from_json(const json & j, Datum & x); | |
| 104 | - void to_json(json & j, const Datum & x); | |
| 103 | +void from_json(const json & j, Datum & x); | |
| 104 | +void to_json(json & j, const Datum & x); | |
| 105 | 105 | |
| 106 | - void from_json(const json & j, Description & x); | |
| 107 | - void to_json(json & j, const Description & x); | |
| 108 | - | |
| 109 | - void from_json(const json & j, TopLevel & x); | |
| 110 | - void to_json(json & j, const TopLevel & x); | |
| 106 | +void from_json(const json & j, Description & x); | |
| 107 | +void to_json(json & j, const Description & x); | |
| 111 | 108 | |
| 109 | +void from_json(const json & j, TopLevel & x); | |
| 110 | +void to_json(json & j, const TopLevel & x); | |
| 111 | +} | |
| 112 | +namespace quicktype { | |
| 112 | 113 | inline void from_json(const json & j, Datum& x) { |
| 113 | 114 | x.set_anomaly(j.at("anomaly").get<std::string>()); |
| 114 | 115 | x.set_value(j.at("value").get<std::string>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/0a358.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -126,15 +126,16 @@ namespace quicktype { | ||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | namespace quicktype { |
| 129 | - void from_json(const json & j, Facets & x); | |
| 130 | - void to_json(json & j, const Facets & x); | |
| 129 | +void from_json(const json & j, Facets & x); | |
| 130 | +void to_json(json & j, const Facets & x); | |
| 131 | 131 | |
| 132 | - void from_json(const json & j, Result & x); | |
| 133 | - void to_json(json & j, const Result & x); | |
| 134 | - | |
| 135 | - void from_json(const json & j, TopLevel & x); | |
| 136 | - void to_json(json & j, const TopLevel & x); | |
| 132 | +void from_json(const json & j, Result & x); | |
| 133 | +void to_json(json & j, const Result & x); | |
| 137 | 134 | |
| 135 | +void from_json(const json & j, TopLevel & x); | |
| 136 | +void to_json(json & j, const TopLevel & x); | |
| 137 | +} | |
| 138 | +namespace quicktype { | |
| 138 | 139 | inline void from_json(const json & j, Facets& x) { |
| 139 | 140 | (void)j; |
| 140 | 141 | (void)x; |
Test case
1 generated file · +28 −27test/inputs/json/misc/0a91a.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -1096,45 +1096,46 @@ namespace quicktype { | ||
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | namespace quicktype { |
| 1099 | - void from_json(const json & j, Actor & x); | |
| 1100 | - void to_json(json & j, const Actor & x); | |
| 1099 | +void from_json(const json & j, Actor & x); | |
| 1100 | +void to_json(json & j, const Actor & x); | |
| 1101 | 1101 | |
| 1102 | - void from_json(const json & j, Author & x); | |
| 1103 | - void to_json(json & j, const Author & x); | |
| 1102 | +void from_json(const json & j, Author & x); | |
| 1103 | +void to_json(json & j, const Author & x); | |
| 1104 | 1104 | |
| 1105 | - void from_json(const json & j, Commit & x); | |
| 1106 | - void to_json(json & j, const Commit & x); | |
| 1105 | +void from_json(const json & j, Commit & x); | |
| 1106 | +void to_json(json & j, const Commit & x); | |
| 1107 | 1107 | |
| 1108 | - void from_json(const json & j, MergedBy & x); | |
| 1109 | - void to_json(json & j, const MergedBy & x); | |
| 1108 | +void from_json(const json & j, MergedBy & x); | |
| 1109 | +void to_json(json & j, const MergedBy & x); | |
| 1110 | 1110 | |
| 1111 | - void from_json(const json & j, BaseRepo & x); | |
| 1112 | - void to_json(json & j, const BaseRepo & x); | |
| 1111 | +void from_json(const json & j, BaseRepo & x); | |
| 1112 | +void to_json(json & j, const BaseRepo & x); | |
| 1113 | 1113 | |
| 1114 | - void from_json(const json & j, Base & x); | |
| 1115 | - void to_json(json & j, const Base & x); | |
| 1114 | +void from_json(const json & j, Base & x); | |
| 1115 | +void to_json(json & j, const Base & x); | |
| 1116 | 1116 | |
| 1117 | - void from_json(const json & j, Comments & x); | |
| 1118 | - void to_json(json & j, const Comments & x); | |
| 1117 | +void from_json(const json & j, Comments & x); | |
| 1118 | +void to_json(json & j, const Comments & x); | |
| 1119 | 1119 | |
| 1120 | - void from_json(const json & j, Links & x); | |
| 1121 | - void to_json(json & j, const Links & x); | |
| 1120 | +void from_json(const json & j, Links & x); | |
| 1121 | +void to_json(json & j, const Links & x); | |
| 1122 | 1122 | |
| 1123 | - void from_json(const json & j, PullRequest & x); | |
| 1124 | - void to_json(json & j, const PullRequest & x); | |
| 1123 | +void from_json(const json & j, PullRequest & x); | |
| 1124 | +void to_json(json & j, const PullRequest & x); | |
| 1125 | 1125 | |
| 1126 | - void from_json(const json & j, Payload & x); | |
| 1127 | - void to_json(json & j, const Payload & x); | |
| 1126 | +void from_json(const json & j, Payload & x); | |
| 1127 | +void to_json(json & j, const Payload & x); | |
| 1128 | 1128 | |
| 1129 | - void from_json(const json & j, TopLevelRepo & x); | |
| 1130 | - void to_json(json & j, const TopLevelRepo & x); | |
| 1129 | +void from_json(const json & j, TopLevelRepo & x); | |
| 1130 | +void to_json(json & j, const TopLevelRepo & x); | |
| 1131 | 1131 | |
| 1132 | - void from_json(const json & j, TopLevelElement & x); | |
| 1133 | - void to_json(json & j, const TopLevelElement & x); | |
| 1134 | - | |
| 1135 | - void from_json(const json & j, Type & x); | |
| 1136 | - void to_json(json & j, const Type & x); | |
| 1132 | +void from_json(const json & j, TopLevelElement & x); | |
| 1133 | +void to_json(json & j, const TopLevelElement & x); | |
| 1137 | 1134 | |
| 1135 | +void from_json(const json & j, Type & x); | |
| 1136 | +void to_json(json & j, const Type & x); | |
| 1137 | +} | |
| 1138 | +namespace quicktype { | |
| 1138 | 1139 | inline void from_json(const json & j, Actor& x) { |
| 1139 | 1140 | x.set_avatar_url(j.at("avatar_url").get<std::string>()); |
| 1140 | 1141 | x.set_display_login(get_stack_optional<std::string>(j, "display_login")); |
Test case
1 generated file · +14 −13test/inputs/json/misc/0b91a.json
Mcplusplusdefault / quicktype.hpp+14 −13
| @@ -217,24 +217,25 @@ namespace quicktype { | ||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | namespace quicktype { |
| 220 | - void from_json(const json & j, ResponseInfo & x); | |
| 221 | - void to_json(json & j, const ResponseInfo & x); | |
| 220 | +void from_json(const json & j, ResponseInfo & x); | |
| 221 | +void to_json(json & j, const ResponseInfo & x); | |
| 222 | 222 | |
| 223 | - void from_json(const json & j, Resultset & x); | |
| 224 | - void to_json(json & j, const Resultset & x); | |
| 223 | +void from_json(const json & j, Resultset & x); | |
| 224 | +void to_json(json & j, const Resultset & x); | |
| 225 | 225 | |
| 226 | - void from_json(const json & j, Metadata & x); | |
| 227 | - void to_json(json & j, const Metadata & x); | |
| 226 | +void from_json(const json & j, Metadata & x); | |
| 227 | +void to_json(json & j, const Metadata & x); | |
| 228 | 228 | |
| 229 | - void from_json(const json & j, Component & x); | |
| 230 | - void to_json(json & j, const Component & x); | |
| 229 | +void from_json(const json & j, Component & x); | |
| 230 | +void to_json(json & j, const Component & x); | |
| 231 | 231 | |
| 232 | - void from_json(const json & j, Result & x); | |
| 233 | - void to_json(json & j, const Result & x); | |
| 234 | - | |
| 235 | - void from_json(const json & j, TopLevel & x); | |
| 236 | - void to_json(json & j, const TopLevel & x); | |
| 232 | +void from_json(const json & j, Result & x); | |
| 233 | +void to_json(json & j, const Result & x); | |
| 237 | 234 | |
| 235 | +void from_json(const json & j, TopLevel & x); | |
| 236 | +void to_json(json & j, const TopLevel & x); | |
| 237 | +} | |
| 238 | +namespace quicktype { | |
| 238 | 239 | inline void from_json(const json & j, ResponseInfo& x) { |
| 239 | 240 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 240 | 241 | x.set_status(j.at("status").get<int64_t>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/0cffa.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -566,45 +566,46 @@ namespace quicktype { | ||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | namespace quicktype { |
| 569 | - void from_json(const json & j, The480_WStill & x); | |
| 570 | - void to_json(json & j, const The480_WStill & x); | |
| 569 | +void from_json(const json & j, The480_WStill & x); | |
| 570 | +void to_json(json & j, const The480_WStill & x); | |
| 571 | 571 | |
| 572 | - void from_json(const json & j, DownsizedSmall & x); | |
| 573 | - void to_json(json & j, const DownsizedSmall & x); | |
| 572 | +void from_json(const json & j, DownsizedSmall & x); | |
| 573 | +void to_json(json & j, const DownsizedSmall & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, FixedHeight & x); | |
| 576 | - void to_json(json & j, const FixedHeight & x); | |
| 575 | +void from_json(const json & j, FixedHeight & x); | |
| 576 | +void to_json(json & j, const FixedHeight & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, Looping & x); | |
| 579 | - void to_json(json & j, const Looping & x); | |
| 578 | +void from_json(const json & j, Looping & x); | |
| 579 | +void to_json(json & j, const Looping & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Images & x); | |
| 582 | - void to_json(json & j, const Images & x); | |
| 581 | +void from_json(const json & j, Images & x); | |
| 582 | +void to_json(json & j, const Images & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, User & x); | |
| 585 | - void to_json(json & j, const User & x); | |
| 584 | +void from_json(const json & j, User & x); | |
| 585 | +void to_json(json & j, const User & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, Datum & x); | |
| 588 | - void to_json(json & j, const Datum & x); | |
| 587 | +void from_json(const json & j, Datum & x); | |
| 588 | +void to_json(json & j, const Datum & x); | |
| 589 | 589 | |
| 590 | - void from_json(const json & j, Meta & x); | |
| 591 | - void to_json(json & j, const Meta & x); | |
| 590 | +void from_json(const json & j, Meta & x); | |
| 591 | +void to_json(json & j, const Meta & x); | |
| 592 | 592 | |
| 593 | - void from_json(const json & j, Pagination & x); | |
| 594 | - void to_json(json & j, const Pagination & x); | |
| 593 | +void from_json(const json & j, Pagination & x); | |
| 594 | +void to_json(json & j, const Pagination & x); | |
| 595 | 595 | |
| 596 | - void from_json(const json & j, TopLevel & x); | |
| 597 | - void to_json(json & j, const TopLevel & x); | |
| 596 | +void from_json(const json & j, TopLevel & x); | |
| 597 | +void to_json(json & j, const TopLevel & x); | |
| 598 | 598 | |
| 599 | - void from_json(const json & j, Rating & x); | |
| 600 | - void to_json(json & j, const Rating & x); | |
| 599 | +void from_json(const json & j, Rating & x); | |
| 600 | +void to_json(json & j, const Rating & x); | |
| 601 | 601 | |
| 602 | - void from_json(const json & j, Type & x); | |
| 603 | - void to_json(json & j, const Type & x); | |
| 604 | - | |
| 605 | - void from_json(const json & j, Username & x); | |
| 606 | - void to_json(json & j, const Username & x); | |
| 602 | +void from_json(const json & j, Type & x); | |
| 603 | +void to_json(json & j, const Type & x); | |
| 607 | 604 | |
| 605 | +void from_json(const json & j, Username & x); | |
| 606 | +void to_json(json & j, const Username & x); | |
| 607 | +} | |
| 608 | +namespace quicktype { | |
| 608 | 609 | inline void from_json(const json & j, The480_WStill& x) { |
| 609 | 610 | x.set_height(j.at("height").get<std::string>()); |
| 610 | 611 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +24 −23test/inputs/json/misc/0e0c2.json
Mcplusplusdefault / quicktype.hpp+24 −23
| @@ -391,39 +391,40 @@ namespace quicktype { | ||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | namespace quicktype { |
| 394 | - void from_json(const json & j, Collection & x); | |
| 395 | - void to_json(json & j, const Collection & x); | |
| 394 | +void from_json(const json & j, Collection & x); | |
| 395 | +void to_json(json & j, const Collection & x); | |
| 396 | 396 | |
| 397 | - void from_json(const json & j, Detail & x); | |
| 398 | - void to_json(json & j, const Detail & x); | |
| 397 | +void from_json(const json & j, Detail & x); | |
| 398 | +void to_json(json & j, const Detail & x); | |
| 399 | 399 | |
| 400 | - void from_json(const json & j, FavMovie & x); | |
| 401 | - void to_json(json & j, const FavMovie & x); | |
| 400 | +void from_json(const json & j, FavMovie & x); | |
| 401 | +void to_json(json & j, const FavMovie & x); | |
| 402 | 402 | |
| 403 | - void from_json(const json & j, Image & x); | |
| 404 | - void to_json(json & j, const Image & x); | |
| 403 | +void from_json(const json & j, Image & x); | |
| 404 | +void to_json(json & j, const Image & x); | |
| 405 | 405 | |
| 406 | - void from_json(const json & j, Video & x); | |
| 407 | - void to_json(json & j, const Video & x); | |
| 406 | +void from_json(const json & j, Video & x); | |
| 407 | +void to_json(json & j, const Video & x); | |
| 408 | 408 | |
| 409 | - void from_json(const json & j, VoteScore & x); | |
| 410 | - void to_json(json & j, const VoteScore & x); | |
| 409 | +void from_json(const json & j, VoteScore & x); | |
| 410 | +void to_json(json & j, const VoteScore & x); | |
| 411 | 411 | |
| 412 | - void from_json(const json & j, Result & x); | |
| 413 | - void to_json(json & j, const Result & x); | |
| 412 | +void from_json(const json & j, Result & x); | |
| 413 | +void to_json(json & j, const Result & x); | |
| 414 | 414 | |
| 415 | - void from_json(const json & j, TopLevel & x); | |
| 416 | - void to_json(json & j, const TopLevel & x); | |
| 415 | +void from_json(const json & j, TopLevel & x); | |
| 416 | +void to_json(json & j, const TopLevel & x); | |
| 417 | 417 | |
| 418 | - void from_json(const json & j, DetailLanguage & x); | |
| 419 | - void to_json(json & j, const DetailLanguage & x); | |
| 418 | +void from_json(const json & j, DetailLanguage & x); | |
| 419 | +void to_json(json & j, const DetailLanguage & x); | |
| 420 | 420 | |
| 421 | - void from_json(const json & j, Type & x); | |
| 422 | - void to_json(json & j, const Type & x); | |
| 423 | - | |
| 424 | - void from_json(const json & j, ResultLanguage & x); | |
| 425 | - void to_json(json & j, const ResultLanguage & x); | |
| 421 | +void from_json(const json & j, Type & x); | |
| 422 | +void to_json(json & j, const Type & x); | |
| 426 | 423 | |
| 424 | +void from_json(const json & j, ResultLanguage & x); | |
| 425 | +void to_json(json & j, const ResultLanguage & x); | |
| 426 | +} | |
| 427 | +namespace quicktype { | |
| 427 | 428 | inline void from_json(const json & j, Collection& x) { |
| 428 | 429 | x.set_id(j.at("id").get<int64_t>()); |
| 429 | 430 | x.set_movies(j.at("movies").get<std::vector<int64_t>>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/0fecf.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_countries(j.at("countries").get<std::vector<std::string>>()); |
| 55 | 56 | } |
Test case
1 generated file · +22 −21test/inputs/json/misc/10be4.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -229,36 +229,37 @@ namespace quicktype { | ||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | namespace quicktype { |
| 232 | - void from_json(const json & j, Identifier & x); | |
| 233 | - void to_json(json & j, const Identifier & x); | |
| 232 | +void from_json(const json & j, Identifier & x); | |
| 233 | +void to_json(json & j, const Identifier & x); | |
| 234 | 234 | |
| 235 | - void from_json(const json & j, Link & x); | |
| 236 | - void to_json(json & j, const Link & x); | |
| 235 | +void from_json(const json & j, Link & x); | |
| 236 | +void to_json(json & j, const Link & x); | |
| 237 | 237 | |
| 238 | - void from_json(const json & j, OtherName & x); | |
| 239 | - void to_json(json & j, const OtherName & x); | |
| 238 | +void from_json(const json & j, OtherName & x); | |
| 239 | +void to_json(json & j, const OtherName & x); | |
| 240 | 240 | |
| 241 | - void from_json(const json & j, Text & x); | |
| 242 | - void to_json(json & j, const Text & x); | |
| 241 | +void from_json(const json & j, Text & x); | |
| 242 | +void to_json(json & j, const Text & x); | |
| 243 | 243 | |
| 244 | - void from_json(const json & j, TopLevelElement & x); | |
| 245 | - void to_json(json & j, const TopLevelElement & x); | |
| 244 | +void from_json(const json & j, TopLevelElement & x); | |
| 245 | +void to_json(json & j, const TopLevelElement & x); | |
| 246 | 246 | |
| 247 | - void from_json(const json & j, Scheme & x); | |
| 248 | - void to_json(json & j, const Scheme & x); | |
| 247 | +void from_json(const json & j, Scheme & x); | |
| 248 | +void to_json(json & j, const Scheme & x); | |
| 249 | 249 | |
| 250 | - void from_json(const json & j, Keyword & x); | |
| 251 | - void to_json(json & j, const Keyword & x); | |
| 250 | +void from_json(const json & j, Keyword & x); | |
| 251 | +void to_json(json & j, const Keyword & x); | |
| 252 | 252 | |
| 253 | - void from_json(const json & j, Note & x); | |
| 254 | - void to_json(json & j, const Note & x); | |
| 253 | +void from_json(const json & j, Note & x); | |
| 254 | +void to_json(json & j, const Note & x); | |
| 255 | 255 | |
| 256 | - void from_json(const json & j, MediaType & x); | |
| 257 | - void to_json(json & j, const MediaType & x); | |
| 258 | - | |
| 259 | - void from_json(const json & j, Title & x); | |
| 260 | - void to_json(json & j, const Title & x); | |
| 256 | +void from_json(const json & j, MediaType & x); | |
| 257 | +void to_json(json & j, const MediaType & x); | |
| 261 | 258 | |
| 259 | +void from_json(const json & j, Title & x); | |
| 260 | +void to_json(json & j, const Title & x); | |
| 261 | +} | |
| 262 | +namespace quicktype { | |
| 262 | 263 | inline void from_json(const json & j, Identifier& x) { |
| 263 | 264 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 264 | 265 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/112b5.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -101,15 +101,16 @@ namespace quicktype { | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | namespace quicktype { |
| 104 | - void from_json(const json & j, Args & x); | |
| 105 | - void to_json(json & j, const Args & x); | |
| 104 | +void from_json(const json & j, Args & x); | |
| 105 | +void to_json(json & j, const Args & x); | |
| 106 | 106 | |
| 107 | - void from_json(const json & j, Headers & x); | |
| 108 | - void to_json(json & j, const Headers & x); | |
| 109 | - | |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 107 | +void from_json(const json & j, Headers & x); | |
| 108 | +void to_json(json & j, const Headers & x); | |
| 112 | 109 | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, Args& x) { |
| 114 | 115 | (void)j; |
| 115 | 116 | (void)x; |
Test case
1 generated file · +28 −27test/inputs/json/misc/127a1.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -566,45 +566,46 @@ namespace quicktype { | ||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | namespace quicktype { |
| 569 | - void from_json(const json & j, The480_WStill & x); | |
| 570 | - void to_json(json & j, const The480_WStill & x); | |
| 569 | +void from_json(const json & j, The480_WStill & x); | |
| 570 | +void to_json(json & j, const The480_WStill & x); | |
| 571 | 571 | |
| 572 | - void from_json(const json & j, DownsizedSmall & x); | |
| 573 | - void to_json(json & j, const DownsizedSmall & x); | |
| 572 | +void from_json(const json & j, DownsizedSmall & x); | |
| 573 | +void to_json(json & j, const DownsizedSmall & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, FixedHeight & x); | |
| 576 | - void to_json(json & j, const FixedHeight & x); | |
| 575 | +void from_json(const json & j, FixedHeight & x); | |
| 576 | +void to_json(json & j, const FixedHeight & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, Looping & x); | |
| 579 | - void to_json(json & j, const Looping & x); | |
| 578 | +void from_json(const json & j, Looping & x); | |
| 579 | +void to_json(json & j, const Looping & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Images & x); | |
| 582 | - void to_json(json & j, const Images & x); | |
| 581 | +void from_json(const json & j, Images & x); | |
| 582 | +void to_json(json & j, const Images & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, User & x); | |
| 585 | - void to_json(json & j, const User & x); | |
| 584 | +void from_json(const json & j, User & x); | |
| 585 | +void to_json(json & j, const User & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, Datum & x); | |
| 588 | - void to_json(json & j, const Datum & x); | |
| 587 | +void from_json(const json & j, Datum & x); | |
| 588 | +void to_json(json & j, const Datum & x); | |
| 589 | 589 | |
| 590 | - void from_json(const json & j, Meta & x); | |
| 591 | - void to_json(json & j, const Meta & x); | |
| 590 | +void from_json(const json & j, Meta & x); | |
| 591 | +void to_json(json & j, const Meta & x); | |
| 592 | 592 | |
| 593 | - void from_json(const json & j, Pagination & x); | |
| 594 | - void to_json(json & j, const Pagination & x); | |
| 593 | +void from_json(const json & j, Pagination & x); | |
| 594 | +void to_json(json & j, const Pagination & x); | |
| 595 | 595 | |
| 596 | - void from_json(const json & j, TopLevel & x); | |
| 597 | - void to_json(json & j, const TopLevel & x); | |
| 596 | +void from_json(const json & j, TopLevel & x); | |
| 597 | +void to_json(json & j, const TopLevel & x); | |
| 598 | 598 | |
| 599 | - void from_json(const json & j, Rating & x); | |
| 600 | - void to_json(json & j, const Rating & x); | |
| 599 | +void from_json(const json & j, Rating & x); | |
| 600 | +void to_json(json & j, const Rating & x); | |
| 601 | 601 | |
| 602 | - void from_json(const json & j, Type & x); | |
| 603 | - void to_json(json & j, const Type & x); | |
| 604 | - | |
| 605 | - void from_json(const json & j, Username & x); | |
| 606 | - void to_json(json & j, const Username & x); | |
| 602 | +void from_json(const json & j, Type & x); | |
| 603 | +void to_json(json & j, const Type & x); | |
| 607 | 604 | |
| 605 | +void from_json(const json & j, Username & x); | |
| 606 | +void to_json(json & j, const Username & x); | |
| 607 | +} | |
| 608 | +namespace quicktype { | |
| 608 | 609 | inline void from_json(const json & j, The480_WStill& x) { |
| 609 | 610 | x.set_height(j.at("height").get<std::string>()); |
| 610 | 611 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +10 −9test/inputs/json/misc/13d8d.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -151,18 +151,19 @@ namespace quicktype { | ||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | namespace quicktype { |
| 154 | - void from_json(const json & j, Street & x); | |
| 155 | - void to_json(json & j, const Street & x); | |
| 154 | +void from_json(const json & j, Street & x); | |
| 155 | +void to_json(json & j, const Street & x); | |
| 156 | 156 | |
| 157 | - void from_json(const json & j, Location & x); | |
| 158 | - void to_json(json & j, const Location & x); | |
| 157 | +void from_json(const json & j, Location & x); | |
| 158 | +void to_json(json & j, const Location & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, OutcomeStatus & x); | |
| 161 | - void to_json(json & j, const OutcomeStatus & x); | |
| 162 | - | |
| 163 | - void from_json(const json & j, TopLevelElement & x); | |
| 164 | - void to_json(json & j, const TopLevelElement & x); | |
| 160 | +void from_json(const json & j, OutcomeStatus & x); | |
| 161 | +void to_json(json & j, const OutcomeStatus & x); | |
| 165 | 162 | |
| 163 | +void from_json(const json & j, TopLevelElement & x); | |
| 164 | +void to_json(json & j, const TopLevelElement & x); | |
| 165 | +} | |
| 166 | +namespace quicktype { | |
| 166 | 167 | inline void from_json(const json & j, Street& x) { |
| 167 | 168 | x.set_id(j.at("id").get<int64_t>()); |
| 168 | 169 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/14d38.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, Headers & x); | |
| 80 | - void to_json(json & j, const Headers & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, TopLevel & x); | |
| 83 | - void to_json(json & j, const TopLevel & x); | |
| 79 | +void from_json(const json & j, Headers & x); | |
| 80 | +void to_json(json & j, const Headers & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, TopLevel & x); | |
| 83 | +void to_json(json & j, const TopLevel & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, Headers& x) { |
| 86 | 87 | x.set_accept_encoding(j.at("Accept-Encoding").get<std::string>()); |
| 87 | 88 | x.set_connection(j.at("Connection").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/167d6.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/16bc5.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +12 −11test/inputs/json/misc/176f1.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -205,21 +205,22 @@ namespace quicktype { | ||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | namespace quicktype { |
| 208 | - void from_json(const json & j, Footnote & x); | |
| 209 | - void to_json(json & j, const Footnote & x); | |
| 208 | +void from_json(const json & j, Footnote & x); | |
| 209 | +void to_json(json & j, const Footnote & x); | |
| 210 | 210 | |
| 211 | - void from_json(const json & j, Datum & x); | |
| 212 | - void to_json(json & j, const Datum & x); | |
| 211 | +void from_json(const json & j, Datum & x); | |
| 212 | +void to_json(json & j, const Datum & x); | |
| 213 | 213 | |
| 214 | - void from_json(const json & j, Series & x); | |
| 215 | - void to_json(json & j, const Series & x); | |
| 214 | +void from_json(const json & j, Series & x); | |
| 215 | +void to_json(json & j, const Series & x); | |
| 216 | 216 | |
| 217 | - void from_json(const json & j, Results & x); | |
| 218 | - void to_json(json & j, const Results & x); | |
| 219 | - | |
| 220 | - void from_json(const json & j, TopLevel & x); | |
| 221 | - void to_json(json & j, const TopLevel & x); | |
| 217 | +void from_json(const json & j, Results & x); | |
| 218 | +void to_json(json & j, const Results & x); | |
| 222 | 219 | |
| 220 | +void from_json(const json & j, TopLevel & x); | |
| 221 | +void to_json(json & j, const TopLevel & x); | |
| 222 | +} | |
| 223 | +namespace quicktype { | |
| 223 | 224 | inline void from_json(const json & j, Footnote& x) { |
| 224 | 225 | x.set_code(get_stack_optional<std::string>(j, "code")); |
| 225 | 226 | x.set_text(get_stack_optional<std::string>(j, "text")); |
Test case
1 generated file · +6 −5test/inputs/json/misc/1a7f5.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/1b28c.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +26 −25test/inputs/json/misc/1b409.json
Mcplusplusdefault / quicktype.hpp+26 −25
| @@ -389,42 +389,43 @@ namespace quicktype { | ||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | namespace quicktype { |
| 392 | - void from_json(const json & j, Meta & x); | |
| 393 | - void to_json(json & j, const Meta & x); | |
| 392 | +void from_json(const json & j, Meta & x); | |
| 393 | +void to_json(json & j, const Meta & x); | |
| 394 | 394 | |
| 395 | - void from_json(const json & j, Extra & x); | |
| 396 | - void to_json(json & j, const Extra & x); | |
| 395 | +void from_json(const json & j, Extra & x); | |
| 396 | +void to_json(json & j, const Extra & x); | |
| 397 | 397 | |
| 398 | - void from_json(const json & j, Person & x); | |
| 399 | - void to_json(json & j, const Person & x); | |
| 398 | +void from_json(const json & j, Person & x); | |
| 399 | +void to_json(json & j, const Person & x); | |
| 400 | 400 | |
| 401 | - void from_json(const json & j, Object & x); | |
| 402 | - void to_json(json & j, const Object & x); | |
| 401 | +void from_json(const json & j, Object & x); | |
| 402 | +void to_json(json & j, const Object & x); | |
| 403 | 403 | |
| 404 | - void from_json(const json & j, TopLevel & x); | |
| 405 | - void to_json(json & j, const TopLevel & x); | |
| 404 | +void from_json(const json & j, TopLevel & x); | |
| 405 | +void to_json(json & j, const TopLevel & x); | |
| 406 | 406 | |
| 407 | - void from_json(const json & j, Party & x); | |
| 408 | - void to_json(json & j, const Party & x); | |
| 407 | +void from_json(const json & j, Party & x); | |
| 408 | +void to_json(json & j, const Party & x); | |
| 409 | 409 | |
| 410 | - void from_json(const json & j, Gender & x); | |
| 411 | - void to_json(json & j, const Gender & x); | |
| 410 | +void from_json(const json & j, Gender & x); | |
| 411 | +void to_json(json & j, const Gender & x); | |
| 412 | 412 | |
| 413 | - void from_json(const json & j, GenderLabel & x); | |
| 414 | - void to_json(json & j, const GenderLabel & x); | |
| 413 | +void from_json(const json & j, GenderLabel & x); | |
| 414 | +void to_json(json & j, const GenderLabel & x); | |
| 415 | 415 | |
| 416 | - void from_json(const json & j, Namemod & x); | |
| 417 | - void to_json(json & j, const Namemod & x); | |
| 416 | +void from_json(const json & j, Namemod & x); | |
| 417 | +void to_json(json & j, const Namemod & x); | |
| 418 | 418 | |
| 419 | - void from_json(const json & j, RoleType & x); | |
| 420 | - void to_json(json & j, const RoleType & x); | |
| 419 | +void from_json(const json & j, RoleType & x); | |
| 420 | +void to_json(json & j, const RoleType & x); | |
| 421 | 421 | |
| 422 | - void from_json(const json & j, RoleTypeLabel & x); | |
| 423 | - void to_json(json & j, const RoleTypeLabel & x); | |
| 424 | - | |
| 425 | - void from_json(const json & j, Title & x); | |
| 426 | - void to_json(json & j, const Title & x); | |
| 422 | +void from_json(const json & j, RoleTypeLabel & x); | |
| 423 | +void to_json(json & j, const RoleTypeLabel & x); | |
| 427 | 424 | |
| 425 | +void from_json(const json & j, Title & x); | |
| 426 | +void to_json(json & j, const Title & x); | |
| 427 | +} | |
| 428 | +namespace quicktype { | |
| 428 | 429 | inline void from_json(const json & j, Meta& x) { |
| 429 | 430 | x.set_limit(j.at("limit").get<int64_t>()); |
| 430 | 431 | x.set_offset(j.at("offset").get<int64_t>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/2465e.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -340,45 +340,46 @@ namespace quicktype { | ||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | namespace quicktype { |
| 343 | - void from_json(const json & j, Annotations & x); | |
| 344 | - void to_json(json & j, const Annotations & x); | |
| 343 | +void from_json(const json & j, Annotations & x); | |
| 344 | +void to_json(json & j, const Annotations & x); | |
| 345 | 345 | |
| 346 | - void from_json(const json & j, Properties & x); | |
| 347 | - void to_json(json & j, const Properties & x); | |
| 346 | +void from_json(const json & j, Properties & x); | |
| 347 | +void to_json(json & j, const Properties & x); | |
| 348 | 348 | |
| 349 | - void from_json(const json & j, Taxonomy & x); | |
| 350 | - void to_json(json & j, const Taxonomy & x); | |
| 349 | +void from_json(const json & j, Taxonomy & x); | |
| 350 | +void to_json(json & j, const Taxonomy & x); | |
| 351 | 351 | |
| 352 | - void from_json(const json & j, Definitions & x); | |
| 353 | - void to_json(json & j, const Definitions & x); | |
| 352 | +void from_json(const json & j, Definitions & x); | |
| 353 | +void to_json(json & j, const Definitions & x); | |
| 354 | 354 | |
| 355 | - void from_json(const json & j, Info & x); | |
| 356 | - void to_json(json & j, const Info & x); | |
| 355 | +void from_json(const json & j, Info & x); | |
| 356 | +void to_json(json & j, const Info & x); | |
| 357 | 357 | |
| 358 | - void from_json(const json & j, Parameter & x); | |
| 359 | - void to_json(json & j, const Parameter & x); | |
| 358 | +void from_json(const json & j, Parameter & x); | |
| 359 | +void to_json(json & j, const Parameter & x); | |
| 360 | 360 | |
| 361 | - void from_json(const json & j, Schema & x); | |
| 362 | - void to_json(json & j, const Schema & x); | |
| 361 | +void from_json(const json & j, Schema & x); | |
| 362 | +void to_json(json & j, const Schema & x); | |
| 363 | 363 | |
| 364 | - void from_json(const json & j, The200 & x); | |
| 365 | - void to_json(json & j, const The200 & x); | |
| 364 | +void from_json(const json & j, The200 & x); | |
| 365 | +void to_json(json & j, const The200 & x); | |
| 366 | 366 | |
| 367 | - void from_json(const json & j, Responses & x); | |
| 368 | - void to_json(json & j, const Responses & x); | |
| 367 | +void from_json(const json & j, Responses & x); | |
| 368 | +void to_json(json & j, const Responses & x); | |
| 369 | 369 | |
| 370 | - void from_json(const json & j, Get & x); | |
| 371 | - void to_json(json & j, const Get & x); | |
| 370 | +void from_json(const json & j, Get & x); | |
| 371 | +void to_json(json & j, const Get & x); | |
| 372 | 372 | |
| 373 | - void from_json(const json & j, ItaTaxonomiesSearch & x); | |
| 374 | - void to_json(json & j, const ItaTaxonomiesSearch & x); | |
| 373 | +void from_json(const json & j, ItaTaxonomiesSearch & x); | |
| 374 | +void to_json(json & j, const ItaTaxonomiesSearch & x); | |
| 375 | 375 | |
| 376 | - void from_json(const json & j, Paths & x); | |
| 377 | - void to_json(json & j, const Paths & x); | |
| 378 | - | |
| 379 | - void from_json(const json & j, TopLevel & x); | |
| 380 | - void to_json(json & j, const TopLevel & x); | |
| 376 | +void from_json(const json & j, Paths & x); | |
| 377 | +void to_json(json & j, const Paths & x); | |
| 381 | 378 | |
| 379 | +void from_json(const json & j, TopLevel & x); | |
| 380 | +void to_json(json & j, const TopLevel & x); | |
| 381 | +} | |
| 382 | +namespace quicktype { | |
| 382 | 383 | inline void from_json(const json & j, Annotations& x) { |
| 383 | 384 | x.set_description(j.at("description").get<std::string>()); |
| 384 | 385 | x.set_type(j.at("type").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/24f52.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +32 −31test/inputs/json/misc/262f0.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -461,51 +461,52 @@ namespace quicktype { | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | namespace quicktype { |
| 464 | - void from_json(const json & j, Astronomy & x); | |
| 465 | - void to_json(json & j, const Astronomy & x); | |
| 464 | +void from_json(const json & j, Astronomy & x); | |
| 465 | +void to_json(json & j, const Astronomy & x); | |
| 466 | 466 | |
| 467 | - void from_json(const json & j, Atmosphere & x); | |
| 468 | - void to_json(json & j, const Atmosphere & x); | |
| 467 | +void from_json(const json & j, Atmosphere & x); | |
| 468 | +void to_json(json & j, const Atmosphere & x); | |
| 469 | 469 | |
| 470 | - void from_json(const json & j, Image & x); | |
| 471 | - void to_json(json & j, const Image & x); | |
| 470 | +void from_json(const json & j, Image & x); | |
| 471 | +void to_json(json & j, const Image & x); | |
| 472 | 472 | |
| 473 | - void from_json(const json & j, Condition & x); | |
| 474 | - void to_json(json & j, const Condition & x); | |
| 473 | +void from_json(const json & j, Condition & x); | |
| 474 | +void to_json(json & j, const Condition & x); | |
| 475 | 475 | |
| 476 | - void from_json(const json & j, Forecast & x); | |
| 477 | - void to_json(json & j, const Forecast & x); | |
| 476 | +void from_json(const json & j, Forecast & x); | |
| 477 | +void to_json(json & j, const Forecast & x); | |
| 478 | 478 | |
| 479 | - void from_json(const json & j, Guid & x); | |
| 480 | - void to_json(json & j, const Guid & x); | |
| 479 | +void from_json(const json & j, Guid & x); | |
| 480 | +void to_json(json & j, const Guid & x); | |
| 481 | 481 | |
| 482 | - void from_json(const json & j, Item & x); | |
| 483 | - void to_json(json & j, const Item & x); | |
| 482 | +void from_json(const json & j, Item & x); | |
| 483 | +void to_json(json & j, const Item & x); | |
| 484 | 484 | |
| 485 | - void from_json(const json & j, Location & x); | |
| 486 | - void to_json(json & j, const Location & x); | |
| 485 | +void from_json(const json & j, Location & x); | |
| 486 | +void to_json(json & j, const Location & x); | |
| 487 | 487 | |
| 488 | - void from_json(const json & j, Units & x); | |
| 489 | - void to_json(json & j, const Units & x); | |
| 488 | +void from_json(const json & j, Units & x); | |
| 489 | +void to_json(json & j, const Units & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, Wind & x); | |
| 492 | - void to_json(json & j, const Wind & x); | |
| 491 | +void from_json(const json & j, Wind & x); | |
| 492 | +void to_json(json & j, const Wind & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Channel & x); | |
| 495 | - void to_json(json & j, const Channel & x); | |
| 494 | +void from_json(const json & j, Channel & x); | |
| 495 | +void to_json(json & j, const Channel & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, Results & x); | |
| 498 | - void to_json(json & j, const Results & x); | |
| 497 | +void from_json(const json & j, Results & x); | |
| 498 | +void to_json(json & j, const Results & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, Query & x); | |
| 501 | - void to_json(json & j, const Query & x); | |
| 500 | +void from_json(const json & j, Query & x); | |
| 501 | +void to_json(json & j, const Query & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, TopLevel & x); | |
| 504 | - void to_json(json & j, const TopLevel & x); | |
| 505 | - | |
| 506 | - void from_json(const json & j, Text & x); | |
| 507 | - void to_json(json & j, const Text & x); | |
| 503 | +void from_json(const json & j, TopLevel & x); | |
| 504 | +void to_json(json & j, const TopLevel & x); | |
| 508 | 505 | |
| 506 | +void from_json(const json & j, Text & x); | |
| 507 | +void to_json(json & j, const Text & x); | |
| 508 | +} | |
| 509 | +namespace quicktype { | |
| 509 | 510 | inline void from_json(const json & j, Astronomy& x) { |
| 510 | 511 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 511 | 512 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +26 −25test/inputs/json/misc/26b49.json
Mcplusplusdefault / quicktype.hpp+26 −25
| @@ -569,42 +569,43 @@ namespace quicktype { | ||
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | namespace quicktype { |
| 572 | - void from_json(const json & j, The480_WStill & x); | |
| 573 | - void to_json(json & j, const The480_WStill & x); | |
| 572 | +void from_json(const json & j, The480_WStill & x); | |
| 573 | +void to_json(json & j, const The480_WStill & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, DownsizedSmall & x); | |
| 576 | - void to_json(json & j, const DownsizedSmall & x); | |
| 575 | +void from_json(const json & j, DownsizedSmall & x); | |
| 576 | +void to_json(json & j, const DownsizedSmall & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, FixedHeight & x); | |
| 579 | - void to_json(json & j, const FixedHeight & x); | |
| 578 | +void from_json(const json & j, FixedHeight & x); | |
| 579 | +void to_json(json & j, const FixedHeight & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Looping & x); | |
| 582 | - void to_json(json & j, const Looping & x); | |
| 581 | +void from_json(const json & j, Looping & x); | |
| 582 | +void to_json(json & j, const Looping & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, Images & x); | |
| 585 | - void to_json(json & j, const Images & x); | |
| 584 | +void from_json(const json & j, Images & x); | |
| 585 | +void to_json(json & j, const Images & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, User & x); | |
| 588 | - void to_json(json & j, const User & x); | |
| 587 | +void from_json(const json & j, User & x); | |
| 588 | +void to_json(json & j, const User & x); | |
| 589 | 589 | |
| 590 | - void from_json(const json & j, Datum & x); | |
| 591 | - void to_json(json & j, const Datum & x); | |
| 590 | +void from_json(const json & j, Datum & x); | |
| 591 | +void to_json(json & j, const Datum & x); | |
| 592 | 592 | |
| 593 | - void from_json(const json & j, Meta & x); | |
| 594 | - void to_json(json & j, const Meta & x); | |
| 593 | +void from_json(const json & j, Meta & x); | |
| 594 | +void to_json(json & j, const Meta & x); | |
| 595 | 595 | |
| 596 | - void from_json(const json & j, Pagination & x); | |
| 597 | - void to_json(json & j, const Pagination & x); | |
| 596 | +void from_json(const json & j, Pagination & x); | |
| 597 | +void to_json(json & j, const Pagination & x); | |
| 598 | 598 | |
| 599 | - void from_json(const json & j, TopLevel & x); | |
| 600 | - void to_json(json & j, const TopLevel & x); | |
| 599 | +void from_json(const json & j, TopLevel & x); | |
| 600 | +void to_json(json & j, const TopLevel & x); | |
| 601 | 601 | |
| 602 | - void from_json(const json & j, Rating & x); | |
| 603 | - void to_json(json & j, const Rating & x); | |
| 604 | - | |
| 605 | - void from_json(const json & j, Type & x); | |
| 606 | - void to_json(json & j, const Type & x); | |
| 602 | +void from_json(const json & j, Rating & x); | |
| 603 | +void to_json(json & j, const Rating & x); | |
| 607 | 604 | |
| 605 | +void from_json(const json & j, Type & x); | |
| 606 | +void to_json(json & j, const Type & x); | |
| 607 | +} | |
| 608 | +namespace quicktype { | |
| 608 | 609 | inline void from_json(const json & j, The480_WStill& x) { |
| 609 | 610 | x.set_height(j.at("height").get<std::string>()); |
| 610 | 611 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +38 −37test/inputs/json/misc/27332.json
Mcplusplusdefault / quicktype.hpp+38 −37
| @@ -689,60 +689,61 @@ namespace quicktype { | ||
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | namespace quicktype { |
| 692 | - void from_json(const json & j, Oembed & x); | |
| 693 | - void to_json(json & j, const Oembed & x); | |
| 692 | +void from_json(const json & j, Oembed & x); | |
| 693 | +void to_json(json & j, const Oembed & x); | |
| 694 | 694 | |
| 695 | - void from_json(const json & j, Media & x); | |
| 696 | - void to_json(json & j, const Media & x); | |
| 695 | +void from_json(const json & j, Media & x); | |
| 696 | +void to_json(json & j, const Media & x); | |
| 697 | 697 | |
| 698 | - void from_json(const json & j, MediaEmbed & x); | |
| 699 | - void to_json(json & j, const MediaEmbed & x); | |
| 698 | +void from_json(const json & j, MediaEmbed & x); | |
| 699 | +void to_json(json & j, const MediaEmbed & x); | |
| 700 | 700 | |
| 701 | - void from_json(const json & j, Source & x); | |
| 702 | - void to_json(json & j, const Source & x); | |
| 701 | +void from_json(const json & j, Source & x); | |
| 702 | +void to_json(json & j, const Source & x); | |
| 703 | 703 | |
| 704 | - void from_json(const json & j, Variants & x); | |
| 705 | - void to_json(json & j, const Variants & x); | |
| 704 | +void from_json(const json & j, Variants & x); | |
| 705 | +void to_json(json & j, const Variants & x); | |
| 706 | 706 | |
| 707 | - void from_json(const json & j, Image & x); | |
| 708 | - void to_json(json & j, const Image & x); | |
| 707 | +void from_json(const json & j, Image & x); | |
| 708 | +void to_json(json & j, const Image & x); | |
| 709 | 709 | |
| 710 | - void from_json(const json & j, Preview & x); | |
| 711 | - void to_json(json & j, const Preview & x); | |
| 710 | +void from_json(const json & j, Preview & x); | |
| 711 | +void to_json(json & j, const Preview & x); | |
| 712 | 712 | |
| 713 | - void from_json(const json & j, ChildData & x); | |
| 714 | - void to_json(json & j, const ChildData & x); | |
| 713 | +void from_json(const json & j, ChildData & x); | |
| 714 | +void to_json(json & j, const ChildData & x); | |
| 715 | 715 | |
| 716 | - void from_json(const json & j, Child & x); | |
| 717 | - void to_json(json & j, const Child & x); | |
| 716 | +void from_json(const json & j, Child & x); | |
| 717 | +void to_json(json & j, const Child & x); | |
| 718 | 718 | |
| 719 | - void from_json(const json & j, TopLevelData & x); | |
| 720 | - void to_json(json & j, const TopLevelData & x); | |
| 719 | +void from_json(const json & j, TopLevelData & x); | |
| 720 | +void to_json(json & j, const TopLevelData & x); | |
| 721 | 721 | |
| 722 | - void from_json(const json & j, TopLevel & x); | |
| 723 | - void to_json(json & j, const TopLevel & x); | |
| 722 | +void from_json(const json & j, TopLevel & x); | |
| 723 | +void to_json(json & j, const TopLevel & x); | |
| 724 | 724 | |
| 725 | - void from_json(const json & j, Domain & x); | |
| 726 | - void to_json(json & j, const Domain & x); | |
| 725 | +void from_json(const json & j, Domain & x); | |
| 726 | +void to_json(json & j, const Domain & x); | |
| 727 | 727 | |
| 728 | - void from_json(const json & j, PostHint & x); | |
| 729 | - void to_json(json & j, const PostHint & x); | |
| 728 | +void from_json(const json & j, PostHint & x); | |
| 729 | +void to_json(json & j, const PostHint & x); | |
| 730 | 730 | |
| 731 | - void from_json(const json & j, Subreddit & x); | |
| 732 | - void to_json(json & j, const Subreddit & x); | |
| 731 | +void from_json(const json & j, Subreddit & x); | |
| 732 | +void to_json(json & j, const Subreddit & x); | |
| 733 | 733 | |
| 734 | - void from_json(const json & j, SubredditId & x); | |
| 735 | - void to_json(json & j, const SubredditId & x); | |
| 734 | +void from_json(const json & j, SubredditId & x); | |
| 735 | +void to_json(json & j, const SubredditId & x); | |
| 736 | 736 | |
| 737 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 738 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 737 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 738 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 739 | 739 | |
| 740 | - void from_json(const json & j, SubredditType & x); | |
| 741 | - void to_json(json & j, const SubredditType & x); | |
| 742 | - | |
| 743 | - void from_json(const json & j, Kind & x); | |
| 744 | - void to_json(json & j, const Kind & x); | |
| 740 | +void from_json(const json & j, SubredditType & x); | |
| 741 | +void to_json(json & j, const SubredditType & x); | |
| 745 | 742 | |
| 743 | +void from_json(const json & j, Kind & x); | |
| 744 | +void to_json(json & j, const Kind & x); | |
| 745 | +} | |
| 746 | +namespace quicktype { | |
| 746 | 747 | inline void from_json(const json & j, Oembed& x) { |
| 747 | 748 | x.set_description(j.at("description").get<std::string>()); |
| 748 | 749 | x.set_height(j.at("height").get<int64_t>()); |
Test case
1 generated file · +34 −33test/inputs/json/misc/2d4e2.json
Mcplusplusdefault / quicktype.hpp+34 −33
| @@ -408,54 +408,55 @@ namespace quicktype { | ||
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | namespace quicktype { |
| 411 | - void from_json(const json & j, Meta & x); | |
| 412 | - void to_json(json & j, const Meta & x); | |
| 411 | +void from_json(const json & j, Meta & x); | |
| 412 | +void to_json(json & j, const Meta & x); | |
| 413 | 413 | |
| 414 | - void from_json(const json & j, Extra & x); | |
| 415 | - void to_json(json & j, const Extra & x); | |
| 414 | +void from_json(const json & j, Extra & x); | |
| 415 | +void to_json(json & j, const Extra & x); | |
| 416 | 416 | |
| 417 | - void from_json(const json & j, Person & x); | |
| 418 | - void to_json(json & j, const Person & x); | |
| 417 | +void from_json(const json & j, Person & x); | |
| 418 | +void to_json(json & j, const Person & x); | |
| 419 | 419 | |
| 420 | - void from_json(const json & j, Object & x); | |
| 421 | - void to_json(json & j, const Object & x); | |
| 420 | +void from_json(const json & j, Object & x); | |
| 421 | +void to_json(json & j, const Object & x); | |
| 422 | 422 | |
| 423 | - void from_json(const json & j, TopLevel & x); | |
| 424 | - void to_json(json & j, const TopLevel & x); | |
| 423 | +void from_json(const json & j, TopLevel & x); | |
| 424 | +void to_json(json & j, const TopLevel & x); | |
| 425 | 425 | |
| 426 | - void from_json(const json & j, Party & x); | |
| 427 | - void to_json(json & j, const Party & x); | |
| 426 | +void from_json(const json & j, Party & x); | |
| 427 | +void to_json(json & j, const Party & x); | |
| 428 | 428 | |
| 429 | - void from_json(const json & j, Gender & x); | |
| 430 | - void to_json(json & j, const Gender & x); | |
| 429 | +void from_json(const json & j, Gender & x); | |
| 430 | +void to_json(json & j, const Gender & x); | |
| 431 | 431 | |
| 432 | - void from_json(const json & j, GenderLabel & x); | |
| 433 | - void to_json(json & j, const GenderLabel & x); | |
| 432 | +void from_json(const json & j, GenderLabel & x); | |
| 433 | +void to_json(json & j, const GenderLabel & x); | |
| 434 | 434 | |
| 435 | - void from_json(const json & j, Namemod & x); | |
| 436 | - void to_json(json & j, const Namemod & x); | |
| 435 | +void from_json(const json & j, Namemod & x); | |
| 436 | +void to_json(json & j, const Namemod & x); | |
| 437 | 437 | |
| 438 | - void from_json(const json & j, RoleType & x); | |
| 439 | - void to_json(json & j, const RoleType & x); | |
| 438 | +void from_json(const json & j, RoleType & x); | |
| 439 | +void to_json(json & j, const RoleType & x); | |
| 440 | 440 | |
| 441 | - void from_json(const json & j, RoleTypeLabel & x); | |
| 442 | - void to_json(json & j, const RoleTypeLabel & x); | |
| 441 | +void from_json(const json & j, RoleTypeLabel & x); | |
| 442 | +void to_json(json & j, const RoleTypeLabel & x); | |
| 443 | 443 | |
| 444 | - void from_json(const json & j, SenatorClass & x); | |
| 445 | - void to_json(json & j, const SenatorClass & x); | |
| 444 | +void from_json(const json & j, SenatorClass & x); | |
| 445 | +void to_json(json & j, const SenatorClass & x); | |
| 446 | 446 | |
| 447 | - void from_json(const json & j, SenatorClassLabel & x); | |
| 448 | - void to_json(json & j, const SenatorClassLabel & x); | |
| 447 | +void from_json(const json & j, SenatorClassLabel & x); | |
| 448 | +void to_json(json & j, const SenatorClassLabel & x); | |
| 449 | 449 | |
| 450 | - void from_json(const json & j, SenatorRank & x); | |
| 451 | - void to_json(json & j, const SenatorRank & x); | |
| 450 | +void from_json(const json & j, SenatorRank & x); | |
| 451 | +void to_json(json & j, const SenatorRank & x); | |
| 452 | 452 | |
| 453 | - void from_json(const json & j, SenatorRankLabel & x); | |
| 454 | - void to_json(json & j, const SenatorRankLabel & x); | |
| 455 | - | |
| 456 | - void from_json(const json & j, Title & x); | |
| 457 | - void to_json(json & j, const Title & x); | |
| 453 | +void from_json(const json & j, SenatorRankLabel & x); | |
| 454 | +void to_json(json & j, const SenatorRankLabel & x); | |
| 458 | 455 | |
| 456 | +void from_json(const json & j, Title & x); | |
| 457 | +void to_json(json & j, const Title & x); | |
| 458 | +} | |
| 459 | +namespace quicktype { | |
| 459 | 460 | inline void from_json(const json & j, Meta& x) { |
| 460 | 461 | x.set_limit(j.at("limit").get<int64_t>()); |
| 461 | 462 | x.set_offset(j.at("offset").get<int64_t>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/31189.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -201,18 +201,19 @@ namespace quicktype { | ||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | namespace quicktype { |
| 204 | - void from_json(const json & j, Rates & x); | |
| 205 | - void to_json(json & j, const Rates & x); | |
| 204 | +void from_json(const json & j, Rates & x); | |
| 205 | +void to_json(json & j, const Rates & x); | |
| 206 | 206 | |
| 207 | - void from_json(const json & j, Period & x); | |
| 208 | - void to_json(json & j, const Period & x); | |
| 207 | +void from_json(const json & j, Period & x); | |
| 208 | +void to_json(json & j, const Period & x); | |
| 209 | 209 | |
| 210 | - void from_json(const json & j, Rate & x); | |
| 211 | - void to_json(json & j, const Rate & x); | |
| 212 | - | |
| 213 | - void from_json(const json & j, TopLevel & x); | |
| 214 | - void to_json(json & j, const TopLevel & x); | |
| 210 | +void from_json(const json & j, Rate & x); | |
| 211 | +void to_json(json & j, const Rate & x); | |
| 215 | 212 | |
| 213 | +void from_json(const json & j, TopLevel & x); | |
| 214 | +void to_json(json & j, const TopLevel & x); | |
| 215 | +} | |
| 216 | +namespace quicktype { | |
| 216 | 217 | inline void from_json(const json & j, Rates& x) { |
| 217 | 218 | x.set_parking(get_stack_optional<double>(j, "parking")); |
| 218 | 219 | x.set_reduced(get_stack_optional<double>(j, "reduced")); |
Test case
1 generated file · +22 −21test/inputs/json/misc/32431.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -351,36 +351,37 @@ namespace quicktype { | ||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | namespace quicktype { |
| 354 | - void from_json(const json & j, Geometry & x); | |
| 355 | - void to_json(json & j, const Geometry & x); | |
| 354 | +void from_json(const json & j, Geometry & x); | |
| 355 | +void to_json(json & j, const Geometry & x); | |
| 356 | 356 | |
| 357 | - void from_json(const json & j, Properties & x); | |
| 358 | - void to_json(json & j, const Properties & x); | |
| 357 | +void from_json(const json & j, Properties & x); | |
| 358 | +void to_json(json & j, const Properties & x); | |
| 359 | 359 | |
| 360 | - void from_json(const json & j, Feature & x); | |
| 361 | - void to_json(json & j, const Feature & x); | |
| 360 | +void from_json(const json & j, Feature & x); | |
| 361 | +void to_json(json & j, const Feature & x); | |
| 362 | 362 | |
| 363 | - void from_json(const json & j, Metadata & x); | |
| 364 | - void to_json(json & j, const Metadata & x); | |
| 363 | +void from_json(const json & j, Metadata & x); | |
| 364 | +void to_json(json & j, const Metadata & x); | |
| 365 | 365 | |
| 366 | - void from_json(const json & j, TopLevel & x); | |
| 367 | - void to_json(json & j, const TopLevel & x); | |
| 366 | +void from_json(const json & j, TopLevel & x); | |
| 367 | +void to_json(json & j, const TopLevel & x); | |
| 368 | 368 | |
| 369 | - void from_json(const json & j, GeometryType & x); | |
| 370 | - void to_json(json & j, const GeometryType & x); | |
| 369 | +void from_json(const json & j, GeometryType & x); | |
| 370 | +void to_json(json & j, const GeometryType & x); | |
| 371 | 371 | |
| 372 | - void from_json(const json & j, MagType & x); | |
| 373 | - void to_json(json & j, const MagType & x); | |
| 372 | +void from_json(const json & j, MagType & x); | |
| 373 | +void to_json(json & j, const MagType & x); | |
| 374 | 374 | |
| 375 | - void from_json(const json & j, Status & x); | |
| 376 | - void to_json(json & j, const Status & x); | |
| 375 | +void from_json(const json & j, Status & x); | |
| 376 | +void to_json(json & j, const Status & x); | |
| 377 | 377 | |
| 378 | - void from_json(const json & j, PropertiesType & x); | |
| 379 | - void to_json(json & j, const PropertiesType & x); | |
| 380 | - | |
| 381 | - void from_json(const json & j, FeatureType & x); | |
| 382 | - void to_json(json & j, const FeatureType & x); | |
| 378 | +void from_json(const json & j, PropertiesType & x); | |
| 379 | +void to_json(json & j, const PropertiesType & x); | |
| 383 | 380 | |
| 381 | +void from_json(const json & j, FeatureType & x); | |
| 382 | +void to_json(json & j, const FeatureType & x); | |
| 383 | +} | |
| 384 | +namespace quicktype { | |
| 384 | 385 | inline void from_json(const json & j, Geometry& x) { |
| 385 | 386 | x.set_coordinates(j.at("coordinates").get<std::vector<double>>()); |
| 386 | 387 | x.set_type(j.at("type").get<GeometryType>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/32d5c.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -139,9 +139,10 @@ namespace quicktype { | ||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | namespace quicktype { |
| 142 | - void from_json(const json & j, TopLevelElement & x); | |
| 143 | - void to_json(json & j, const TopLevelElement & x); | |
| 144 | - | |
| 142 | +void from_json(const json & j, TopLevelElement & x); | |
| 143 | +void to_json(json & j, const TopLevelElement & x); | |
| 144 | +} | |
| 145 | +namespace quicktype { | |
| 145 | 146 | inline void from_json(const json & j, TopLevelElement& x) { |
| 146 | 147 | x.set_birth_date(get_stack_optional<std::string>(j, "BirthDate")); |
| 147 | 148 | x.set_birth_date_is_protected(j.at("BirthDateIsProtected").get<bool>()); |
Test case
1 generated file · +16 −15test/inputs/json/misc/337ed.json
Mcplusplusdefault / quicktype.hpp+16 −15
| @@ -350,27 +350,28 @@ namespace quicktype { | ||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | namespace quicktype { |
| 353 | - void from_json(const json & j, Facets & x); | |
| 354 | - void to_json(json & j, const Facets & x); | |
| 353 | +void from_json(const json & j, Facets & x); | |
| 354 | +void to_json(json & j, const Facets & x); | |
| 355 | 355 | |
| 356 | - void from_json(const json & j, CustomIncome & x); | |
| 357 | - void to_json(json & j, const CustomIncome & x); | |
| 356 | +void from_json(const json & j, CustomIncome & x); | |
| 357 | +void to_json(json & j, const CustomIncome & x); | |
| 358 | 358 | |
| 359 | - void from_json(const json & j, Result & x); | |
| 360 | - void to_json(json & j, const Result & x); | |
| 359 | +void from_json(const json & j, Result & x); | |
| 360 | +void to_json(json & j, const Result & x); | |
| 361 | 361 | |
| 362 | - void from_json(const json & j, TopLevel & x); | |
| 363 | - void to_json(json & j, const TopLevel & x); | |
| 362 | +void from_json(const json & j, TopLevel & x); | |
| 363 | +void to_json(json & j, const TopLevel & x); | |
| 364 | 364 | |
| 365 | - void from_json(const json & j, Status & x); | |
| 366 | - void to_json(json & j, const Status & x); | |
| 365 | +void from_json(const json & j, Status & x); | |
| 366 | +void to_json(json & j, const Status & x); | |
| 367 | 367 | |
| 368 | - void from_json(const json & j, CustomIncomeType & x); | |
| 369 | - void to_json(json & j, const CustomIncomeType & x); | |
| 370 | - | |
| 371 | - void from_json(const json & j, ResultType & x); | |
| 372 | - void to_json(json & j, const ResultType & x); | |
| 368 | +void from_json(const json & j, CustomIncomeType & x); | |
| 369 | +void to_json(json & j, const CustomIncomeType & x); | |
| 373 | 370 | |
| 371 | +void from_json(const json & j, ResultType & x); | |
| 372 | +void to_json(json & j, const ResultType & x); | |
| 373 | +} | |
| 374 | +namespace quicktype { | |
| 374 | 375 | inline void from_json(const json & j, Facets& x) { |
| 375 | 376 | (void)j; |
| 376 | 377 | (void)x; |
Test case
1 generated file · +26 −25test/inputs/json/misc/34702.json
Mcplusplusdefault / quicktype.hpp+26 −25
| @@ -298,42 +298,43 @@ namespace quicktype { | ||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | namespace quicktype { |
| 301 | - void from_json(const json & j, CrsProperties & x); | |
| 302 | - void to_json(json & j, const CrsProperties & x); | |
| 301 | +void from_json(const json & j, CrsProperties & x); | |
| 302 | +void to_json(json & j, const CrsProperties & x); | |
| 303 | 303 | |
| 304 | - void from_json(const json & j, Crs & x); | |
| 305 | - void to_json(json & j, const Crs & x); | |
| 304 | +void from_json(const json & j, Crs & x); | |
| 305 | +void to_json(json & j, const Crs & x); | |
| 306 | 306 | |
| 307 | - void from_json(const json & j, Geometry & x); | |
| 308 | - void to_json(json & j, const Geometry & x); | |
| 307 | +void from_json(const json & j, Geometry & x); | |
| 308 | +void to_json(json & j, const Geometry & x); | |
| 309 | 309 | |
| 310 | - void from_json(const json & j, FeatureProperties & x); | |
| 311 | - void to_json(json & j, const FeatureProperties & x); | |
| 310 | +void from_json(const json & j, FeatureProperties & x); | |
| 311 | +void to_json(json & j, const FeatureProperties & x); | |
| 312 | 312 | |
| 313 | - void from_json(const json & j, Feature & x); | |
| 314 | - void to_json(json & j, const Feature & x); | |
| 313 | +void from_json(const json & j, Feature & x); | |
| 314 | +void to_json(json & j, const Feature & x); | |
| 315 | 315 | |
| 316 | - void from_json(const json & j, TopLevel & x); | |
| 317 | - void to_json(json & j, const TopLevel & x); | |
| 316 | +void from_json(const json & j, TopLevel & x); | |
| 317 | +void to_json(json & j, const TopLevel & x); | |
| 318 | 318 | |
| 319 | - void from_json(const json & j, GeometryType & x); | |
| 320 | - void to_json(json & j, const GeometryType & x); | |
| 319 | +void from_json(const json & j, GeometryType & x); | |
| 320 | +void to_json(json & j, const GeometryType & x); | |
| 321 | 321 | |
| 322 | - void from_json(const json & j, GeometryName & x); | |
| 323 | - void to_json(json & j, const GeometryName & x); | |
| 322 | +void from_json(const json & j, GeometryName & x); | |
| 323 | +void to_json(json & j, const GeometryName & x); | |
| 324 | 324 | |
| 325 | - void from_json(const json & j, FireBanR & x); | |
| 326 | - void to_json(json & j, const FireBanR & x); | |
| 325 | +void from_json(const json & j, FireBanR & x); | |
| 326 | +void to_json(json & j, const FireBanR & x); | |
| 327 | 327 | |
| 328 | - void from_json(const json & j, Region & x); | |
| 329 | - void to_json(json & j, const Region & x); | |
| 328 | +void from_json(const json & j, Region & x); | |
| 329 | +void to_json(json & j, const Region & x); | |
| 330 | 330 | |
| 331 | - void from_json(const json & j, PropertiesType & x); | |
| 332 | - void to_json(json & j, const PropertiesType & x); | |
| 333 | - | |
| 334 | - void from_json(const json & j, FeatureType & x); | |
| 335 | - void to_json(json & j, const FeatureType & x); | |
| 331 | +void from_json(const json & j, PropertiesType & x); | |
| 332 | +void to_json(json & j, const PropertiesType & x); | |
| 336 | 333 | |
| 334 | +void from_json(const json & j, FeatureType & x); | |
| 335 | +void to_json(json & j, const FeatureType & x); | |
| 336 | +} | |
| 337 | +namespace quicktype { | |
| 337 | 338 | inline void from_json(const json & j, CrsProperties& x) { |
| 338 | 339 | x.set_name(j.at("name").get<std::string>()); |
| 339 | 340 | } |
Test case
1 generated file · +14 −13test/inputs/json/misc/3536b.json
Mcplusplusdefault / quicktype.hpp+14 −13
| @@ -150,24 +150,25 @@ namespace quicktype { | ||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | namespace quicktype { |
| 153 | - void from_json(const json & j, Identifier & x); | |
| 154 | - void to_json(json & j, const Identifier & x); | |
| 153 | +void from_json(const json & j, Identifier & x); | |
| 154 | +void to_json(json & j, const Identifier & x); | |
| 155 | 155 | |
| 156 | - void from_json(const json & j, Link & x); | |
| 157 | - void to_json(json & j, const Link & x); | |
| 156 | +void from_json(const json & j, Link & x); | |
| 157 | +void to_json(json & j, const Link & x); | |
| 158 | 158 | |
| 159 | - void from_json(const json & j, Text & x); | |
| 160 | - void to_json(json & j, const Text & x); | |
| 159 | +void from_json(const json & j, Text & x); | |
| 160 | +void to_json(json & j, const Text & x); | |
| 161 | 161 | |
| 162 | - void from_json(const json & j, TopLevelElement & x); | |
| 163 | - void to_json(json & j, const TopLevelElement & x); | |
| 162 | +void from_json(const json & j, TopLevelElement & x); | |
| 163 | +void to_json(json & j, const TopLevelElement & x); | |
| 164 | 164 | |
| 165 | - void from_json(const json & j, Scheme & x); | |
| 166 | - void to_json(json & j, const Scheme & x); | |
| 167 | - | |
| 168 | - void from_json(const json & j, Keyword & x); | |
| 169 | - void to_json(json & j, const Keyword & x); | |
| 165 | +void from_json(const json & j, Scheme & x); | |
| 166 | +void to_json(json & j, const Scheme & x); | |
| 170 | 167 | |
| 168 | +void from_json(const json & j, Keyword & x); | |
| 169 | +void to_json(json & j, const Keyword & x); | |
| 170 | +} | |
| 171 | +namespace quicktype { | |
| 171 | 172 | inline void from_json(const json & j, Identifier& x) { |
| 172 | 173 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 173 | 174 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/3659d.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/36d5d.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/3a6b3.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +12 −11test/inputs/json/misc/3e9a3.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -205,21 +205,22 @@ namespace quicktype { | ||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | namespace quicktype { |
| 208 | - void from_json(const json & j, Footnote & x); | |
| 209 | - void to_json(json & j, const Footnote & x); | |
| 208 | +void from_json(const json & j, Footnote & x); | |
| 209 | +void to_json(json & j, const Footnote & x); | |
| 210 | 210 | |
| 211 | - void from_json(const json & j, Datum & x); | |
| 212 | - void to_json(json & j, const Datum & x); | |
| 211 | +void from_json(const json & j, Datum & x); | |
| 212 | +void to_json(json & j, const Datum & x); | |
| 213 | 213 | |
| 214 | - void from_json(const json & j, Series & x); | |
| 215 | - void to_json(json & j, const Series & x); | |
| 214 | +void from_json(const json & j, Series & x); | |
| 215 | +void to_json(json & j, const Series & x); | |
| 216 | 216 | |
| 217 | - void from_json(const json & j, Results & x); | |
| 218 | - void to_json(json & j, const Results & x); | |
| 219 | - | |
| 220 | - void from_json(const json & j, TopLevel & x); | |
| 221 | - void to_json(json & j, const TopLevel & x); | |
| 217 | +void from_json(const json & j, Results & x); | |
| 218 | +void to_json(json & j, const Results & x); | |
| 222 | 219 | |
| 220 | +void from_json(const json & j, TopLevel & x); | |
| 221 | +void to_json(json & j, const TopLevel & x); | |
| 222 | +} | |
| 223 | +namespace quicktype { | |
| 223 | 224 | inline void from_json(const json & j, Footnote& x) { |
| 224 | 225 | x.set_code(get_stack_optional<std::string>(j, "code")); |
| 225 | 226 | x.set_text(get_stack_optional<std::string>(j, "text")); |
Test case
1 generated file · +32 −31test/inputs/json/misc/3f1ce.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -461,51 +461,52 @@ namespace quicktype { | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | namespace quicktype { |
| 464 | - void from_json(const json & j, Astronomy & x); | |
| 465 | - void to_json(json & j, const Astronomy & x); | |
| 464 | +void from_json(const json & j, Astronomy & x); | |
| 465 | +void to_json(json & j, const Astronomy & x); | |
| 466 | 466 | |
| 467 | - void from_json(const json & j, Atmosphere & x); | |
| 468 | - void to_json(json & j, const Atmosphere & x); | |
| 467 | +void from_json(const json & j, Atmosphere & x); | |
| 468 | +void to_json(json & j, const Atmosphere & x); | |
| 469 | 469 | |
| 470 | - void from_json(const json & j, Image & x); | |
| 471 | - void to_json(json & j, const Image & x); | |
| 470 | +void from_json(const json & j, Image & x); | |
| 471 | +void to_json(json & j, const Image & x); | |
| 472 | 472 | |
| 473 | - void from_json(const json & j, Condition & x); | |
| 474 | - void to_json(json & j, const Condition & x); | |
| 473 | +void from_json(const json & j, Condition & x); | |
| 474 | +void to_json(json & j, const Condition & x); | |
| 475 | 475 | |
| 476 | - void from_json(const json & j, Forecast & x); | |
| 477 | - void to_json(json & j, const Forecast & x); | |
| 476 | +void from_json(const json & j, Forecast & x); | |
| 477 | +void to_json(json & j, const Forecast & x); | |
| 478 | 478 | |
| 479 | - void from_json(const json & j, Guid & x); | |
| 480 | - void to_json(json & j, const Guid & x); | |
| 479 | +void from_json(const json & j, Guid & x); | |
| 480 | +void to_json(json & j, const Guid & x); | |
| 481 | 481 | |
| 482 | - void from_json(const json & j, Item & x); | |
| 483 | - void to_json(json & j, const Item & x); | |
| 482 | +void from_json(const json & j, Item & x); | |
| 483 | +void to_json(json & j, const Item & x); | |
| 484 | 484 | |
| 485 | - void from_json(const json & j, Location & x); | |
| 486 | - void to_json(json & j, const Location & x); | |
| 485 | +void from_json(const json & j, Location & x); | |
| 486 | +void to_json(json & j, const Location & x); | |
| 487 | 487 | |
| 488 | - void from_json(const json & j, Units & x); | |
| 489 | - void to_json(json & j, const Units & x); | |
| 488 | +void from_json(const json & j, Units & x); | |
| 489 | +void to_json(json & j, const Units & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, Wind & x); | |
| 492 | - void to_json(json & j, const Wind & x); | |
| 491 | +void from_json(const json & j, Wind & x); | |
| 492 | +void to_json(json & j, const Wind & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Channel & x); | |
| 495 | - void to_json(json & j, const Channel & x); | |
| 494 | +void from_json(const json & j, Channel & x); | |
| 495 | +void to_json(json & j, const Channel & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, Results & x); | |
| 498 | - void to_json(json & j, const Results & x); | |
| 497 | +void from_json(const json & j, Results & x); | |
| 498 | +void to_json(json & j, const Results & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, Query & x); | |
| 501 | - void to_json(json & j, const Query & x); | |
| 500 | +void from_json(const json & j, Query & x); | |
| 501 | +void to_json(json & j, const Query & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, TopLevel & x); | |
| 504 | - void to_json(json & j, const TopLevel & x); | |
| 505 | - | |
| 506 | - void from_json(const json & j, Text & x); | |
| 507 | - void to_json(json & j, const Text & x); | |
| 503 | +void from_json(const json & j, TopLevel & x); | |
| 504 | +void to_json(json & j, const TopLevel & x); | |
| 508 | 505 | |
| 506 | +void from_json(const json & j, Text & x); | |
| 507 | +void to_json(json & j, const Text & x); | |
| 508 | +} | |
| 509 | +namespace quicktype { | |
| 509 | 510 | inline void from_json(const json & j, Astronomy& x) { |
| 510 | 511 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 511 | 512 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +26 −25test/inputs/json/misc/437e7.json
Mcplusplusdefault / quicktype.hpp+26 −25
| @@ -554,42 +554,43 @@ namespace quicktype { | ||
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | namespace quicktype { |
| 557 | - void from_json(const json & j, Downsized & x); | |
| 558 | - void to_json(json & j, const Downsized & x); | |
| 557 | +void from_json(const json & j, Downsized & x); | |
| 558 | +void to_json(json & j, const Downsized & x); | |
| 559 | 559 | |
| 560 | - void from_json(const json & j, DownsizedSmall & x); | |
| 561 | - void to_json(json & j, const DownsizedSmall & x); | |
| 560 | +void from_json(const json & j, DownsizedSmall & x); | |
| 561 | +void to_json(json & j, const DownsizedSmall & x); | |
| 562 | 562 | |
| 563 | - void from_json(const json & j, FixedHeight & x); | |
| 564 | - void to_json(json & j, const FixedHeight & x); | |
| 563 | +void from_json(const json & j, FixedHeight & x); | |
| 564 | +void to_json(json & j, const FixedHeight & x); | |
| 565 | 565 | |
| 566 | - void from_json(const json & j, Looping & x); | |
| 567 | - void to_json(json & j, const Looping & x); | |
| 566 | +void from_json(const json & j, Looping & x); | |
| 567 | +void to_json(json & j, const Looping & x); | |
| 568 | 568 | |
| 569 | - void from_json(const json & j, Images & x); | |
| 570 | - void to_json(json & j, const Images & x); | |
| 569 | +void from_json(const json & j, Images & x); | |
| 570 | +void to_json(json & j, const Images & x); | |
| 571 | 571 | |
| 572 | - void from_json(const json & j, User & x); | |
| 573 | - void to_json(json & j, const User & x); | |
| 572 | +void from_json(const json & j, User & x); | |
| 573 | +void to_json(json & j, const User & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, Datum & x); | |
| 576 | - void to_json(json & j, const Datum & x); | |
| 575 | +void from_json(const json & j, Datum & x); | |
| 576 | +void to_json(json & j, const Datum & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, Meta & x); | |
| 579 | - void to_json(json & j, const Meta & x); | |
| 578 | +void from_json(const json & j, Meta & x); | |
| 579 | +void to_json(json & j, const Meta & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Pagination & x); | |
| 582 | - void to_json(json & j, const Pagination & x); | |
| 581 | +void from_json(const json & j, Pagination & x); | |
| 582 | +void to_json(json & j, const Pagination & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, TopLevel & x); | |
| 585 | - void to_json(json & j, const TopLevel & x); | |
| 584 | +void from_json(const json & j, TopLevel & x); | |
| 585 | +void to_json(json & j, const TopLevel & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, Rating & x); | |
| 588 | - void to_json(json & j, const Rating & x); | |
| 589 | - | |
| 590 | - void from_json(const json & j, Type & x); | |
| 591 | - void to_json(json & j, const Type & x); | |
| 587 | +void from_json(const json & j, Rating & x); | |
| 588 | +void to_json(json & j, const Rating & x); | |
| 592 | 589 | |
| 590 | +void from_json(const json & j, Type & x); | |
| 591 | +void to_json(json & j, const Type & x); | |
| 592 | +} | |
| 593 | +namespace quicktype { | |
| 593 | 594 | inline void from_json(const json & j, Downsized& x) { |
| 594 | 595 | x.set_height(j.at("height").get<std::string>()); |
| 595 | 596 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +4 −3test/inputs/json/misc/43970.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -59,9 +59,10 @@ namespace quicktype { | ||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | namespace quicktype { |
| 62 | - void from_json(const json & j, TopLevelElement & x); | |
| 63 | - void to_json(json & j, const TopLevelElement & x); | |
| 64 | - | |
| 62 | +void from_json(const json & j, TopLevelElement & x); | |
| 63 | +void to_json(json & j, const TopLevelElement & x); | |
| 64 | +} | |
| 65 | +namespace quicktype { | |
| 65 | 66 | inline void from_json(const json & j, TopLevelElement& x) { |
| 66 | 67 | x.set_id(j.at("ID").get<int64_t>()); |
| 67 | 68 | x.set_name(j.at("Name").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/43eaf.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +16 −15test/inputs/json/misc/458db.json
Mcplusplusdefault / quicktype.hpp+16 −15
| @@ -214,27 +214,28 @@ namespace quicktype { | ||
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | namespace quicktype { |
| 217 | - void from_json(const json & j, ResponseInfo & x); | |
| 218 | - void to_json(json & j, const ResponseInfo & x); | |
| 217 | +void from_json(const json & j, ResponseInfo & x); | |
| 218 | +void to_json(json & j, const ResponseInfo & x); | |
| 219 | 219 | |
| 220 | - void from_json(const json & j, Resultset & x); | |
| 221 | - void to_json(json & j, const Resultset & x); | |
| 220 | +void from_json(const json & j, Resultset & x); | |
| 221 | +void to_json(json & j, const Resultset & x); | |
| 222 | 222 | |
| 223 | - void from_json(const json & j, Metadata & x); | |
| 224 | - void to_json(json & j, const Metadata & x); | |
| 223 | +void from_json(const json & j, Metadata & x); | |
| 224 | +void to_json(json & j, const Metadata & x); | |
| 225 | 225 | |
| 226 | - void from_json(const json & j, Component & x); | |
| 227 | - void to_json(json & j, const Component & x); | |
| 226 | +void from_json(const json & j, Component & x); | |
| 227 | +void to_json(json & j, const Component & x); | |
| 228 | 228 | |
| 229 | - void from_json(const json & j, Result & x); | |
| 230 | - void to_json(json & j, const Result & x); | |
| 229 | +void from_json(const json & j, Result & x); | |
| 230 | +void to_json(json & j, const Result & x); | |
| 231 | 231 | |
| 232 | - void from_json(const json & j, TopLevel & x); | |
| 233 | - void to_json(json & j, const TopLevel & x); | |
| 234 | - | |
| 235 | - void from_json(const json & j, Name & x); | |
| 236 | - void to_json(json & j, const Name & x); | |
| 232 | +void from_json(const json & j, TopLevel & x); | |
| 233 | +void to_json(json & j, const TopLevel & x); | |
| 237 | 234 | |
| 235 | +void from_json(const json & j, Name & x); | |
| 236 | +void to_json(json & j, const Name & x); | |
| 237 | +} | |
| 238 | +namespace quicktype { | |
| 238 | 239 | inline void from_json(const json & j, ResponseInfo& x) { |
| 239 | 240 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 240 | 241 | x.set_status(j.at("status").get<int64_t>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/4961a.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/4a0d7.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +20 −19test/inputs/json/misc/4a455.json
Mcplusplusdefault / quicktype.hpp+20 −19
| @@ -193,33 +193,34 @@ namespace quicktype { | ||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | namespace quicktype { |
| 196 | - void from_json(const json & j, CrsProperties & x); | |
| 197 | - void to_json(json & j, const CrsProperties & x); | |
| 196 | +void from_json(const json & j, CrsProperties & x); | |
| 197 | +void to_json(json & j, const CrsProperties & x); | |
| 198 | 198 | |
| 199 | - void from_json(const json & j, Crs & x); | |
| 200 | - void to_json(json & j, const Crs & x); | |
| 199 | +void from_json(const json & j, Crs & x); | |
| 200 | +void to_json(json & j, const Crs & x); | |
| 201 | 201 | |
| 202 | - void from_json(const json & j, Geometry & x); | |
| 203 | - void to_json(json & j, const Geometry & x); | |
| 202 | +void from_json(const json & j, Geometry & x); | |
| 203 | +void to_json(json & j, const Geometry & x); | |
| 204 | 204 | |
| 205 | - void from_json(const json & j, FeatureProperties & x); | |
| 206 | - void to_json(json & j, const FeatureProperties & x); | |
| 205 | +void from_json(const json & j, FeatureProperties & x); | |
| 206 | +void to_json(json & j, const FeatureProperties & x); | |
| 207 | 207 | |
| 208 | - void from_json(const json & j, Feature & x); | |
| 209 | - void to_json(json & j, const Feature & x); | |
| 208 | +void from_json(const json & j, Feature & x); | |
| 209 | +void to_json(json & j, const Feature & x); | |
| 210 | 210 | |
| 211 | - void from_json(const json & j, TopLevel & x); | |
| 212 | - void to_json(json & j, const TopLevel & x); | |
| 211 | +void from_json(const json & j, TopLevel & x); | |
| 212 | +void to_json(json & j, const TopLevel & x); | |
| 213 | 213 | |
| 214 | - void from_json(const json & j, GeometryType & x); | |
| 215 | - void to_json(json & j, const GeometryType & x); | |
| 214 | +void from_json(const json & j, GeometryType & x); | |
| 215 | +void to_json(json & j, const GeometryType & x); | |
| 216 | 216 | |
| 217 | - void from_json(const json & j, GeometryName & x); | |
| 218 | - void to_json(json & j, const GeometryName & x); | |
| 219 | - | |
| 220 | - void from_json(const json & j, FeatureType & x); | |
| 221 | - void to_json(json & j, const FeatureType & x); | |
| 217 | +void from_json(const json & j, GeometryName & x); | |
| 218 | +void to_json(json & j, const GeometryName & x); | |
| 222 | 219 | |
| 220 | +void from_json(const json & j, FeatureType & x); | |
| 221 | +void to_json(json & j, const FeatureType & x); | |
| 222 | +} | |
| 223 | +namespace quicktype { | |
| 223 | 224 | inline void from_json(const json & j, CrsProperties& x) { |
| 224 | 225 | x.set_name(j.at("name").get<std::string>()); |
| 225 | 226 | } |
Test case
1 generated file · +30 −29test/inputs/json/misc/4c547.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +36 −35test/inputs/json/misc/4d6fb.json
Mcplusplusdefault / quicktype.hpp+36 −35
| @@ -698,57 +698,58 @@ namespace quicktype { | ||
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | namespace quicktype { |
| 701 | - void from_json(const json & j, Oembed & x); | |
| 702 | - void to_json(json & j, const Oembed & x); | |
| 701 | +void from_json(const json & j, Oembed & x); | |
| 702 | +void to_json(json & j, const Oembed & x); | |
| 703 | 703 | |
| 704 | - void from_json(const json & j, Media & x); | |
| 705 | - void to_json(json & j, const Media & x); | |
| 704 | +void from_json(const json & j, Media & x); | |
| 705 | +void to_json(json & j, const Media & x); | |
| 706 | 706 | |
| 707 | - void from_json(const json & j, MediaEmbed & x); | |
| 708 | - void to_json(json & j, const MediaEmbed & x); | |
| 707 | +void from_json(const json & j, MediaEmbed & x); | |
| 708 | +void to_json(json & j, const MediaEmbed & x); | |
| 709 | 709 | |
| 710 | - void from_json(const json & j, Source & x); | |
| 711 | - void to_json(json & j, const Source & x); | |
| 710 | +void from_json(const json & j, Source & x); | |
| 711 | +void to_json(json & j, const Source & x); | |
| 712 | 712 | |
| 713 | - void from_json(const json & j, Variants & x); | |
| 714 | - void to_json(json & j, const Variants & x); | |
| 713 | +void from_json(const json & j, Variants & x); | |
| 714 | +void to_json(json & j, const Variants & x); | |
| 715 | 715 | |
| 716 | - void from_json(const json & j, Image & x); | |
| 717 | - void to_json(json & j, const Image & x); | |
| 716 | +void from_json(const json & j, Image & x); | |
| 717 | +void to_json(json & j, const Image & x); | |
| 718 | 718 | |
| 719 | - void from_json(const json & j, Preview & x); | |
| 720 | - void to_json(json & j, const Preview & x); | |
| 719 | +void from_json(const json & j, Preview & x); | |
| 720 | +void to_json(json & j, const Preview & x); | |
| 721 | 721 | |
| 722 | - void from_json(const json & j, ChildData & x); | |
| 723 | - void to_json(json & j, const ChildData & x); | |
| 722 | +void from_json(const json & j, ChildData & x); | |
| 723 | +void to_json(json & j, const ChildData & x); | |
| 724 | 724 | |
| 725 | - void from_json(const json & j, Child & x); | |
| 726 | - void to_json(json & j, const Child & x); | |
| 725 | +void from_json(const json & j, Child & x); | |
| 726 | +void to_json(json & j, const Child & x); | |
| 727 | 727 | |
| 728 | - void from_json(const json & j, TopLevelData & x); | |
| 729 | - void to_json(json & j, const TopLevelData & x); | |
| 728 | +void from_json(const json & j, TopLevelData & x); | |
| 729 | +void to_json(json & j, const TopLevelData & x); | |
| 730 | 730 | |
| 731 | - void from_json(const json & j, TopLevel & x); | |
| 732 | - void to_json(json & j, const TopLevel & x); | |
| 731 | +void from_json(const json & j, TopLevel & x); | |
| 732 | +void to_json(json & j, const TopLevel & x); | |
| 733 | 733 | |
| 734 | - void from_json(const json & j, PostHint & x); | |
| 735 | - void to_json(json & j, const PostHint & x); | |
| 734 | +void from_json(const json & j, PostHint & x); | |
| 735 | +void to_json(json & j, const PostHint & x); | |
| 736 | 736 | |
| 737 | - void from_json(const json & j, Subreddit & x); | |
| 738 | - void to_json(json & j, const Subreddit & x); | |
| 737 | +void from_json(const json & j, Subreddit & x); | |
| 738 | +void to_json(json & j, const Subreddit & x); | |
| 739 | 739 | |
| 740 | - void from_json(const json & j, SubredditId & x); | |
| 741 | - void to_json(json & j, const SubredditId & x); | |
| 740 | +void from_json(const json & j, SubredditId & x); | |
| 741 | +void to_json(json & j, const SubredditId & x); | |
| 742 | 742 | |
| 743 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 744 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 743 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 744 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 745 | 745 | |
| 746 | - void from_json(const json & j, SubredditType & x); | |
| 747 | - void to_json(json & j, const SubredditType & x); | |
| 748 | - | |
| 749 | - void from_json(const json & j, Kind & x); | |
| 750 | - void to_json(json & j, const Kind & x); | |
| 746 | +void from_json(const json & j, SubredditType & x); | |
| 747 | +void to_json(json & j, const SubredditType & x); | |
| 751 | 748 | |
| 749 | +void from_json(const json & j, Kind & x); | |
| 750 | +void to_json(json & j, const Kind & x); | |
| 751 | +} | |
| 752 | +namespace quicktype { | |
| 752 | 753 | inline void from_json(const json & j, Oembed& x) { |
| 753 | 754 | x.set_author_name(j.at("author_name").get<std::string>()); |
| 754 | 755 | x.set_author_url(j.at("author_url").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/4e336.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/54147.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -116,15 +116,16 @@ namespace quicktype { | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | namespace quicktype { |
| 119 | - void from_json(const json & j, Args & x); | |
| 120 | - void to_json(json & j, const Args & x); | |
| 119 | +void from_json(const json & j, Args & x); | |
| 120 | +void to_json(json & j, const Args & x); | |
| 121 | 121 | |
| 122 | - void from_json(const json & j, Headers & x); | |
| 123 | - void to_json(json & j, const Headers & x); | |
| 124 | - | |
| 125 | - void from_json(const json & j, TopLevel & x); | |
| 126 | - void to_json(json & j, const TopLevel & x); | |
| 122 | +void from_json(const json & j, Headers & x); | |
| 123 | +void to_json(json & j, const Headers & x); | |
| 127 | 124 | |
| 125 | +void from_json(const json & j, TopLevel & x); | |
| 126 | +void to_json(json & j, const TopLevel & x); | |
| 127 | +} | |
| 128 | +namespace quicktype { | |
| 128 | 129 | inline void from_json(const json & j, Args& x) { |
| 129 | 130 | (void)j; |
| 130 | 131 | (void)x; |
Test case
1 generated file · +10 −9test/inputs/json/misc/54d32.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -128,18 +128,19 @@ namespace quicktype { | ||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | namespace quicktype { |
| 131 | - void from_json(const json & j, Facets & x); | |
| 132 | - void to_json(json & j, const Facets & x); | |
| 131 | +void from_json(const json & j, Facets & x); | |
| 132 | +void to_json(json & j, const Facets & x); | |
| 133 | 133 | |
| 134 | - void from_json(const json & j, Result & x); | |
| 135 | - void to_json(json & j, const Result & x); | |
| 134 | +void from_json(const json & j, Result & x); | |
| 135 | +void to_json(json & j, const Result & x); | |
| 136 | 136 | |
| 137 | - void from_json(const json & j, TopLevel & x); | |
| 138 | - void to_json(json & j, const TopLevel & x); | |
| 139 | - | |
| 140 | - void from_json(const json & j, Status & x); | |
| 141 | - void to_json(json & j, const Status & x); | |
| 137 | +void from_json(const json & j, TopLevel & x); | |
| 138 | +void to_json(json & j, const TopLevel & x); | |
| 142 | 139 | |
| 140 | +void from_json(const json & j, Status & x); | |
| 141 | +void to_json(json & j, const Status & x); | |
| 142 | +} | |
| 143 | +namespace quicktype { | |
| 143 | 144 | inline void from_json(const json & j, Facets& x) { |
| 144 | 145 | (void)j; |
| 145 | 146 | (void)x; |
Test case
1 generated file · +14 −13test/inputs/json/misc/570ec.json
Mcplusplusdefault / quicktype.hpp+14 −13
| @@ -222,24 +222,25 @@ namespace quicktype { | ||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | namespace quicktype { |
| 225 | - void from_json(const json & j, Identifier & x); | |
| 226 | - void to_json(json & j, const Identifier & x); | |
| 225 | +void from_json(const json & j, Identifier & x); | |
| 226 | +void to_json(json & j, const Identifier & x); | |
| 227 | 227 | |
| 228 | - void from_json(const json & j, Link & x); | |
| 229 | - void to_json(json & j, const Link & x); | |
| 228 | +void from_json(const json & j, Link & x); | |
| 229 | +void to_json(json & j, const Link & x); | |
| 230 | 230 | |
| 231 | - void from_json(const json & j, OtherName & x); | |
| 232 | - void to_json(json & j, const OtherName & x); | |
| 231 | +void from_json(const json & j, OtherName & x); | |
| 232 | +void to_json(json & j, const OtherName & x); | |
| 233 | 233 | |
| 234 | - void from_json(const json & j, Text & x); | |
| 235 | - void to_json(json & j, const Text & x); | |
| 234 | +void from_json(const json & j, Text & x); | |
| 235 | +void to_json(json & j, const Text & x); | |
| 236 | 236 | |
| 237 | - void from_json(const json & j, TopLevelElement & x); | |
| 238 | - void to_json(json & j, const TopLevelElement & x); | |
| 239 | - | |
| 240 | - void from_json(const json & j, Scheme & x); | |
| 241 | - void to_json(json & j, const Scheme & x); | |
| 237 | +void from_json(const json & j, TopLevelElement & x); | |
| 238 | +void to_json(json & j, const TopLevelElement & x); | |
| 242 | 239 | |
| 240 | +void from_json(const json & j, Scheme & x); | |
| 241 | +void to_json(json & j, const Scheme & x); | |
| 242 | +} | |
| 243 | +namespace quicktype { | |
| 243 | 244 | inline void from_json(const json & j, Identifier& x) { |
| 244 | 245 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 245 | 246 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/5dd0d.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/5eae5.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -64,9 +64,10 @@ namespace quicktype { | ||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | namespace quicktype { |
| 67 | - void from_json(const json & j, TopLevelElement & x); | |
| 68 | - void to_json(json & j, const TopLevelElement & x); | |
| 69 | - | |
| 67 | +void from_json(const json & j, TopLevelElement & x); | |
| 68 | +void to_json(json & j, const TopLevelElement & x); | |
| 69 | +} | |
| 70 | +namespace quicktype { | |
| 70 | 71 | inline void from_json(const json & j, TopLevelElement& x) { |
| 71 | 72 | x.set_date(j.at("Date").get<std::string>()); |
| 72 | 73 | x.set_id(j.at("ID").get<int64_t>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/5eb20.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/5f3a1.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/61b66.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/6260a.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +22 −21test/inputs/json/misc/65dec.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -353,36 +353,37 @@ namespace quicktype { | ||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | namespace quicktype { |
| 356 | - void from_json(const json & j, LegalityElement & x); | |
| 357 | - void to_json(json & j, const LegalityElement & x); | |
| 356 | +void from_json(const json & j, LegalityElement & x); | |
| 357 | +void to_json(json & j, const LegalityElement & x); | |
| 358 | 358 | |
| 359 | - void from_json(const json & j, Ruling & x); | |
| 360 | - void to_json(json & j, const Ruling & x); | |
| 359 | +void from_json(const json & j, Ruling & x); | |
| 360 | +void to_json(json & j, const Ruling & x); | |
| 361 | 361 | |
| 362 | - void from_json(const json & j, Card & x); | |
| 363 | - void to_json(json & j, const Card & x); | |
| 362 | +void from_json(const json & j, Card & x); | |
| 363 | +void to_json(json & j, const Card & x); | |
| 364 | 364 | |
| 365 | - void from_json(const json & j, TopLevel & x); | |
| 366 | - void to_json(json & j, const TopLevel & x); | |
| 365 | +void from_json(const json & j, TopLevel & x); | |
| 366 | +void to_json(json & j, const TopLevel & x); | |
| 367 | 367 | |
| 368 | - void from_json(const json & j, ColorIdentity & x); | |
| 369 | - void to_json(json & j, const ColorIdentity & x); | |
| 368 | +void from_json(const json & j, ColorIdentity & x); | |
| 369 | +void to_json(json & j, const ColorIdentity & x); | |
| 370 | 370 | |
| 371 | - void from_json(const json & j, Watermark & x); | |
| 372 | - void to_json(json & j, const Watermark & x); | |
| 371 | +void from_json(const json & j, Watermark & x); | |
| 372 | +void to_json(json & j, const Watermark & x); | |
| 373 | 373 | |
| 374 | - void from_json(const json & j, Layout & x); | |
| 375 | - void to_json(json & j, const Layout & x); | |
| 374 | +void from_json(const json & j, Layout & x); | |
| 375 | +void to_json(json & j, const Layout & x); | |
| 376 | 376 | |
| 377 | - void from_json(const json & j, LegalityEnum & x); | |
| 378 | - void to_json(json & j, const LegalityEnum & x); | |
| 377 | +void from_json(const json & j, LegalityEnum & x); | |
| 378 | +void to_json(json & j, const LegalityEnum & x); | |
| 379 | 379 | |
| 380 | - void from_json(const json & j, Rarity & x); | |
| 381 | - void to_json(json & j, const Rarity & x); | |
| 382 | - | |
| 383 | - void from_json(const json & j, Type & x); | |
| 384 | - void to_json(json & j, const Type & x); | |
| 380 | +void from_json(const json & j, Rarity & x); | |
| 381 | +void to_json(json & j, const Rarity & x); | |
| 385 | 382 | |
| 383 | +void from_json(const json & j, Type & x); | |
| 384 | +void to_json(json & j, const Type & x); | |
| 385 | +} | |
| 386 | +namespace quicktype { | |
| 386 | 387 | inline void from_json(const json & j, LegalityElement& x) { |
| 387 | 388 | x.set_format(j.at("format").get<std::string>()); |
| 388 | 389 | x.set_legality(j.at("legality").get<LegalityEnum>()); |
Test case
1 generated file · +20 −19test/inputs/json/misc/66121.json
Mcplusplusdefault / quicktype.hpp+20 −19
| @@ -211,33 +211,34 @@ namespace quicktype { | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | namespace quicktype { |
| 214 | - void from_json(const json & j, Identifier & x); | |
| 215 | - void to_json(json & j, const Identifier & x); | |
| 214 | +void from_json(const json & j, Identifier & x); | |
| 215 | +void to_json(json & j, const Identifier & x); | |
| 216 | 216 | |
| 217 | - void from_json(const json & j, Link & x); | |
| 218 | - void to_json(json & j, const Link & x); | |
| 217 | +void from_json(const json & j, Link & x); | |
| 218 | +void to_json(json & j, const Link & x); | |
| 219 | 219 | |
| 220 | - void from_json(const json & j, Text & x); | |
| 221 | - void to_json(json & j, const Text & x); | |
| 220 | +void from_json(const json & j, Text & x); | |
| 221 | +void to_json(json & j, const Text & x); | |
| 222 | 222 | |
| 223 | - void from_json(const json & j, TopLevelElement & x); | |
| 224 | - void to_json(json & j, const TopLevelElement & x); | |
| 223 | +void from_json(const json & j, TopLevelElement & x); | |
| 224 | +void to_json(json & j, const TopLevelElement & x); | |
| 225 | 225 | |
| 226 | - void from_json(const json & j, Scheme & x); | |
| 227 | - void to_json(json & j, const Scheme & x); | |
| 226 | +void from_json(const json & j, Scheme & x); | |
| 227 | +void to_json(json & j, const Scheme & x); | |
| 228 | 228 | |
| 229 | - void from_json(const json & j, Keyword & x); | |
| 230 | - void to_json(json & j, const Keyword & x); | |
| 229 | +void from_json(const json & j, Keyword & x); | |
| 230 | +void to_json(json & j, const Keyword & x); | |
| 231 | 231 | |
| 232 | - void from_json(const json & j, Note & x); | |
| 233 | - void to_json(json & j, const Note & x); | |
| 232 | +void from_json(const json & j, Note & x); | |
| 233 | +void to_json(json & j, const Note & x); | |
| 234 | 234 | |
| 235 | - void from_json(const json & j, MediaType & x); | |
| 236 | - void to_json(json & j, const MediaType & x); | |
| 237 | - | |
| 238 | - void from_json(const json & j, Title & x); | |
| 239 | - void to_json(json & j, const Title & x); | |
| 235 | +void from_json(const json & j, MediaType & x); | |
| 236 | +void to_json(json & j, const MediaType & x); | |
| 240 | 237 | |
| 238 | +void from_json(const json & j, Title & x); | |
| 239 | +void to_json(json & j, const Title & x); | |
| 240 | +} | |
| 241 | +namespace quicktype { | |
| 241 | 242 | inline void from_json(const json & j, Identifier& x) { |
| 242 | 243 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 243 | 244 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/6617c.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, IssPosition & x); | |
| 80 | - void to_json(json & j, const IssPosition & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, TopLevel & x); | |
| 83 | - void to_json(json & j, const TopLevel & x); | |
| 79 | +void from_json(const json & j, IssPosition & x); | |
| 80 | +void to_json(json & j, const IssPosition & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, TopLevel & x); | |
| 83 | +void to_json(json & j, const TopLevel & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, IssPosition& x) { |
| 86 | 87 | x.set_latitude(j.at("latitude").get<std::string>()); |
| 87 | 88 | x.set_longitude(j.at("longitude").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/67c03.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, Person & x); | |
| 80 | - void to_json(json & j, const Person & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, TopLevel & x); | |
| 83 | - void to_json(json & j, const TopLevel & x); | |
| 79 | +void from_json(const json & j, Person & x); | |
| 80 | +void to_json(json & j, const Person & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, TopLevel & x); | |
| 83 | +void to_json(json & j, const TopLevel & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, Person& x) { |
| 86 | 87 | x.set_craft(j.at("craft").get<std::string>()); |
| 87 | 88 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/68c30.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -184,18 +184,19 @@ namespace quicktype { | ||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | namespace quicktype { |
| 187 | - void from_json(const json & j, Out & x); | |
| 188 | - void to_json(json & j, const Out & x); | |
| 187 | +void from_json(const json & j, Out & x); | |
| 188 | +void to_json(json & j, const Out & x); | |
| 189 | 189 | |
| 190 | - void from_json(const json & j, Input & x); | |
| 191 | - void to_json(json & j, const Input & x); | |
| 190 | +void from_json(const json & j, Input & x); | |
| 191 | +void to_json(json & j, const Input & x); | |
| 192 | 192 | |
| 193 | - void from_json(const json & j, Tx & x); | |
| 194 | - void to_json(json & j, const Tx & x); | |
| 195 | - | |
| 196 | - void from_json(const json & j, TopLevel & x); | |
| 197 | - void to_json(json & j, const TopLevel & x); | |
| 193 | +void from_json(const json & j, Tx & x); | |
| 194 | +void to_json(json & j, const Tx & x); | |
| 198 | 195 | |
| 196 | +void from_json(const json & j, TopLevel & x); | |
| 197 | +void to_json(json & j, const TopLevel & x); | |
| 198 | +} | |
| 199 | +namespace quicktype { | |
| 199 | 200 | inline void from_json(const json & j, Out& x) { |
| 200 | 201 | x.set_addr(j.at("addr").get<std::string>()); |
| 201 | 202 | x.set_n(j.at("n").get<int64_t>()); |
Test case
1 generated file · +16 −15test/inputs/json/misc/6c155.json
Mcplusplusdefault / quicktype.hpp+16 −15
| @@ -276,27 +276,28 @@ namespace quicktype { | ||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | namespace quicktype { |
| 279 | - void from_json(const json & j, ResponseInfo & x); | |
| 280 | - void to_json(json & j, const ResponseInfo & x); | |
| 279 | +void from_json(const json & j, ResponseInfo & x); | |
| 280 | +void to_json(json & j, const ResponseInfo & x); | |
| 281 | 281 | |
| 282 | - void from_json(const json & j, Resultset & x); | |
| 283 | - void to_json(json & j, const Resultset & x); | |
| 282 | +void from_json(const json & j, Resultset & x); | |
| 283 | +void to_json(json & j, const Resultset & x); | |
| 284 | 284 | |
| 285 | - void from_json(const json & j, Metadata & x); | |
| 286 | - void to_json(json & j, const Metadata & x); | |
| 285 | +void from_json(const json & j, Metadata & x); | |
| 286 | +void to_json(json & j, const Metadata & x); | |
| 287 | 287 | |
| 288 | - void from_json(const json & j, Component & x); | |
| 289 | - void to_json(json & j, const Component & x); | |
| 288 | +void from_json(const json & j, Component & x); | |
| 289 | +void to_json(json & j, const Component & x); | |
| 290 | 290 | |
| 291 | - void from_json(const json & j, Location & x); | |
| 292 | - void to_json(json & j, const Location & x); | |
| 291 | +void from_json(const json & j, Location & x); | |
| 292 | +void to_json(json & j, const Location & x); | |
| 293 | 293 | |
| 294 | - void from_json(const json & j, Result & x); | |
| 295 | - void to_json(json & j, const Result & x); | |
| 296 | - | |
| 297 | - void from_json(const json & j, TopLevel & x); | |
| 298 | - void to_json(json & j, const TopLevel & x); | |
| 294 | +void from_json(const json & j, Result & x); | |
| 295 | +void to_json(json & j, const Result & x); | |
| 299 | 296 | |
| 297 | +void from_json(const json & j, TopLevel & x); | |
| 298 | +void to_json(json & j, const TopLevel & x); | |
| 299 | +} | |
| 300 | +namespace quicktype { | |
| 300 | 301 | inline void from_json(const json & j, ResponseInfo& x) { |
| 301 | 302 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 302 | 303 | x.set_status(j.at("status").get<int64_t>()); |
Test case
1 generated file · +32 −31test/inputs/json/misc/6de06.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -719,51 +719,52 @@ namespace quicktype { | ||
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | namespace quicktype { |
| 722 | - void from_json(const json & j, Oembed & x); | |
| 723 | - void to_json(json & j, const Oembed & x); | |
| 722 | +void from_json(const json & j, Oembed & x); | |
| 723 | +void to_json(json & j, const Oembed & x); | |
| 724 | 724 | |
| 725 | - void from_json(const json & j, Media & x); | |
| 726 | - void to_json(json & j, const Media & x); | |
| 725 | +void from_json(const json & j, Media & x); | |
| 726 | +void to_json(json & j, const Media & x); | |
| 727 | 727 | |
| 728 | - void from_json(const json & j, MediaEmbed & x); | |
| 729 | - void to_json(json & j, const MediaEmbed & x); | |
| 728 | +void from_json(const json & j, MediaEmbed & x); | |
| 729 | +void to_json(json & j, const MediaEmbed & x); | |
| 730 | 730 | |
| 731 | - void from_json(const json & j, Source & x); | |
| 732 | - void to_json(json & j, const Source & x); | |
| 731 | +void from_json(const json & j, Source & x); | |
| 732 | +void to_json(json & j, const Source & x); | |
| 733 | 733 | |
| 734 | - void from_json(const json & j, Gif & x); | |
| 735 | - void to_json(json & j, const Gif & x); | |
| 734 | +void from_json(const json & j, Gif & x); | |
| 735 | +void to_json(json & j, const Gif & x); | |
| 736 | 736 | |
| 737 | - void from_json(const json & j, Variants & x); | |
| 738 | - void to_json(json & j, const Variants & x); | |
| 737 | +void from_json(const json & j, Variants & x); | |
| 738 | +void to_json(json & j, const Variants & x); | |
| 739 | 739 | |
| 740 | - void from_json(const json & j, Image & x); | |
| 741 | - void to_json(json & j, const Image & x); | |
| 740 | +void from_json(const json & j, Image & x); | |
| 741 | +void to_json(json & j, const Image & x); | |
| 742 | 742 | |
| 743 | - void from_json(const json & j, Preview & x); | |
| 744 | - void to_json(json & j, const Preview & x); | |
| 743 | +void from_json(const json & j, Preview & x); | |
| 744 | +void to_json(json & j, const Preview & x); | |
| 745 | 745 | |
| 746 | - void from_json(const json & j, ChildData & x); | |
| 747 | - void to_json(json & j, const ChildData & x); | |
| 746 | +void from_json(const json & j, ChildData & x); | |
| 747 | +void to_json(json & j, const ChildData & x); | |
| 748 | 748 | |
| 749 | - void from_json(const json & j, Child & x); | |
| 750 | - void to_json(json & j, const Child & x); | |
| 749 | +void from_json(const json & j, Child & x); | |
| 750 | +void to_json(json & j, const Child & x); | |
| 751 | 751 | |
| 752 | - void from_json(const json & j, TopLevelData & x); | |
| 753 | - void to_json(json & j, const TopLevelData & x); | |
| 752 | +void from_json(const json & j, TopLevelData & x); | |
| 753 | +void to_json(json & j, const TopLevelData & x); | |
| 754 | 754 | |
| 755 | - void from_json(const json & j, TopLevel & x); | |
| 756 | - void to_json(json & j, const TopLevel & x); | |
| 755 | +void from_json(const json & j, TopLevel & x); | |
| 756 | +void to_json(json & j, const TopLevel & x); | |
| 757 | 757 | |
| 758 | - void from_json(const json & j, PostHint & x); | |
| 759 | - void to_json(json & j, const PostHint & x); | |
| 758 | +void from_json(const json & j, PostHint & x); | |
| 759 | +void to_json(json & j, const PostHint & x); | |
| 760 | 760 | |
| 761 | - void from_json(const json & j, SubredditType & x); | |
| 762 | - void to_json(json & j, const SubredditType & x); | |
| 763 | - | |
| 764 | - void from_json(const json & j, Kind & x); | |
| 765 | - void to_json(json & j, const Kind & x); | |
| 761 | +void from_json(const json & j, SubredditType & x); | |
| 762 | +void to_json(json & j, const SubredditType & x); | |
| 766 | 763 | |
| 764 | +void from_json(const json & j, Kind & x); | |
| 765 | +void to_json(json & j, const Kind & x); | |
| 766 | +} | |
| 767 | +namespace quicktype { | |
| 767 | 768 | inline void from_json(const json & j, Oembed& x) { |
| 768 | 769 | x.set_description(j.at("description").get<std::string>()); |
| 769 | 770 | x.set_height(j.at("height").get<int64_t>()); |
Test case
1 generated file · +32 −31test/inputs/json/misc/6dec6.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -461,51 +461,52 @@ namespace quicktype { | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | namespace quicktype { |
| 464 | - void from_json(const json & j, Astronomy & x); | |
| 465 | - void to_json(json & j, const Astronomy & x); | |
| 464 | +void from_json(const json & j, Astronomy & x); | |
| 465 | +void to_json(json & j, const Astronomy & x); | |
| 466 | 466 | |
| 467 | - void from_json(const json & j, Atmosphere & x); | |
| 468 | - void to_json(json & j, const Atmosphere & x); | |
| 467 | +void from_json(const json & j, Atmosphere & x); | |
| 468 | +void to_json(json & j, const Atmosphere & x); | |
| 469 | 469 | |
| 470 | - void from_json(const json & j, Image & x); | |
| 471 | - void to_json(json & j, const Image & x); | |
| 470 | +void from_json(const json & j, Image & x); | |
| 471 | +void to_json(json & j, const Image & x); | |
| 472 | 472 | |
| 473 | - void from_json(const json & j, Condition & x); | |
| 474 | - void to_json(json & j, const Condition & x); | |
| 473 | +void from_json(const json & j, Condition & x); | |
| 474 | +void to_json(json & j, const Condition & x); | |
| 475 | 475 | |
| 476 | - void from_json(const json & j, Forecast & x); | |
| 477 | - void to_json(json & j, const Forecast & x); | |
| 476 | +void from_json(const json & j, Forecast & x); | |
| 477 | +void to_json(json & j, const Forecast & x); | |
| 478 | 478 | |
| 479 | - void from_json(const json & j, Guid & x); | |
| 480 | - void to_json(json & j, const Guid & x); | |
| 479 | +void from_json(const json & j, Guid & x); | |
| 480 | +void to_json(json & j, const Guid & x); | |
| 481 | 481 | |
| 482 | - void from_json(const json & j, Item & x); | |
| 483 | - void to_json(json & j, const Item & x); | |
| 482 | +void from_json(const json & j, Item & x); | |
| 483 | +void to_json(json & j, const Item & x); | |
| 484 | 484 | |
| 485 | - void from_json(const json & j, Location & x); | |
| 486 | - void to_json(json & j, const Location & x); | |
| 485 | +void from_json(const json & j, Location & x); | |
| 486 | +void to_json(json & j, const Location & x); | |
| 487 | 487 | |
| 488 | - void from_json(const json & j, Units & x); | |
| 489 | - void to_json(json & j, const Units & x); | |
| 488 | +void from_json(const json & j, Units & x); | |
| 489 | +void to_json(json & j, const Units & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, Wind & x); | |
| 492 | - void to_json(json & j, const Wind & x); | |
| 491 | +void from_json(const json & j, Wind & x); | |
| 492 | +void to_json(json & j, const Wind & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Channel & x); | |
| 495 | - void to_json(json & j, const Channel & x); | |
| 494 | +void from_json(const json & j, Channel & x); | |
| 495 | +void to_json(json & j, const Channel & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, Results & x); | |
| 498 | - void to_json(json & j, const Results & x); | |
| 497 | +void from_json(const json & j, Results & x); | |
| 498 | +void to_json(json & j, const Results & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, Query & x); | |
| 501 | - void to_json(json & j, const Query & x); | |
| 500 | +void from_json(const json & j, Query & x); | |
| 501 | +void to_json(json & j, const Query & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, TopLevel & x); | |
| 504 | - void to_json(json & j, const TopLevel & x); | |
| 505 | - | |
| 506 | - void from_json(const json & j, Text & x); | |
| 507 | - void to_json(json & j, const Text & x); | |
| 503 | +void from_json(const json & j, TopLevel & x); | |
| 504 | +void to_json(json & j, const TopLevel & x); | |
| 508 | 505 | |
| 506 | +void from_json(const json & j, Text & x); | |
| 507 | +void to_json(json & j, const Text & x); | |
| 508 | +} | |
| 509 | +namespace quicktype { | |
| 509 | 510 | inline void from_json(const json & j, Astronomy& x) { |
| 510 | 511 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 511 | 512 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/6eb00.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -59,9 +59,10 @@ namespace quicktype { | ||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | namespace quicktype { |
| 62 | - void from_json(const json & j, TopLevelElement & x); | |
| 63 | - void to_json(json & j, const TopLevelElement & x); | |
| 64 | - | |
| 62 | +void from_json(const json & j, TopLevelElement & x); | |
| 63 | +void to_json(json & j, const TopLevelElement & x); | |
| 64 | +} | |
| 65 | +namespace quicktype { | |
| 65 | 66 | inline void from_json(const json & j, TopLevelElement& x) { |
| 66 | 67 | x.set_directorate_id(j.at("DirectorateID").get<int64_t>()); |
| 67 | 68 | x.set_id(j.at("Id").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/70c77.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/734ad.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -427,18 +427,19 @@ namespace quicktype { | ||
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | namespace quicktype { |
| 430 | - void from_json(const json & j, Facets & x); | |
| 431 | - void to_json(json & j, const Facets & x); | |
| 430 | +void from_json(const json & j, Facets & x); | |
| 431 | +void to_json(json & j, const Facets & x); | |
| 432 | 432 | |
| 433 | - void from_json(const json & j, Result & x); | |
| 434 | - void to_json(json & j, const Result & x); | |
| 433 | +void from_json(const json & j, Result & x); | |
| 434 | +void to_json(json & j, const Result & x); | |
| 435 | 435 | |
| 436 | - void from_json(const json & j, TopLevel & x); | |
| 437 | - void to_json(json & j, const TopLevel & x); | |
| 438 | - | |
| 439 | - void from_json(const json & j, Status & x); | |
| 440 | - void to_json(json & j, const Status & x); | |
| 436 | +void from_json(const json & j, TopLevel & x); | |
| 437 | +void to_json(json & j, const TopLevel & x); | |
| 441 | 438 | |
| 439 | +void from_json(const json & j, Status & x); | |
| 440 | +void to_json(json & j, const Status & x); | |
| 441 | +} | |
| 442 | +namespace quicktype { | |
| 442 | 443 | inline void from_json(const json & j, Facets& x) { |
| 443 | 444 | (void)j; |
| 444 | 445 | (void)x; |
Test case
1 generated file · +4 −3test/inputs/json/misc/75912.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/7681c.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -566,45 +566,46 @@ namespace quicktype { | ||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | namespace quicktype { |
| 569 | - void from_json(const json & j, The480_WStill & x); | |
| 570 | - void to_json(json & j, const The480_WStill & x); | |
| 569 | +void from_json(const json & j, The480_WStill & x); | |
| 570 | +void to_json(json & j, const The480_WStill & x); | |
| 571 | 571 | |
| 572 | - void from_json(const json & j, DownsizedSmall & x); | |
| 573 | - void to_json(json & j, const DownsizedSmall & x); | |
| 572 | +void from_json(const json & j, DownsizedSmall & x); | |
| 573 | +void to_json(json & j, const DownsizedSmall & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, FixedHeight & x); | |
| 576 | - void to_json(json & j, const FixedHeight & x); | |
| 575 | +void from_json(const json & j, FixedHeight & x); | |
| 576 | +void to_json(json & j, const FixedHeight & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, Looping & x); | |
| 579 | - void to_json(json & j, const Looping & x); | |
| 578 | +void from_json(const json & j, Looping & x); | |
| 579 | +void to_json(json & j, const Looping & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Images & x); | |
| 582 | - void to_json(json & j, const Images & x); | |
| 581 | +void from_json(const json & j, Images & x); | |
| 582 | +void to_json(json & j, const Images & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, User & x); | |
| 585 | - void to_json(json & j, const User & x); | |
| 584 | +void from_json(const json & j, User & x); | |
| 585 | +void to_json(json & j, const User & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, Datum & x); | |
| 588 | - void to_json(json & j, const Datum & x); | |
| 587 | +void from_json(const json & j, Datum & x); | |
| 588 | +void to_json(json & j, const Datum & x); | |
| 589 | 589 | |
| 590 | - void from_json(const json & j, Meta & x); | |
| 591 | - void to_json(json & j, const Meta & x); | |
| 590 | +void from_json(const json & j, Meta & x); | |
| 591 | +void to_json(json & j, const Meta & x); | |
| 592 | 592 | |
| 593 | - void from_json(const json & j, Pagination & x); | |
| 594 | - void to_json(json & j, const Pagination & x); | |
| 593 | +void from_json(const json & j, Pagination & x); | |
| 594 | +void to_json(json & j, const Pagination & x); | |
| 595 | 595 | |
| 596 | - void from_json(const json & j, TopLevel & x); | |
| 597 | - void to_json(json & j, const TopLevel & x); | |
| 596 | +void from_json(const json & j, TopLevel & x); | |
| 597 | +void to_json(json & j, const TopLevel & x); | |
| 598 | 598 | |
| 599 | - void from_json(const json & j, Rating & x); | |
| 600 | - void to_json(json & j, const Rating & x); | |
| 599 | +void from_json(const json & j, Rating & x); | |
| 600 | +void to_json(json & j, const Rating & x); | |
| 601 | 601 | |
| 602 | - void from_json(const json & j, Type & x); | |
| 603 | - void to_json(json & j, const Type & x); | |
| 604 | - | |
| 605 | - void from_json(const json & j, Username & x); | |
| 606 | - void to_json(json & j, const Username & x); | |
| 602 | +void from_json(const json & j, Type & x); | |
| 603 | +void to_json(json & j, const Type & x); | |
| 607 | 604 | |
| 605 | +void from_json(const json & j, Username & x); | |
| 606 | +void to_json(json & j, const Username & x); | |
| 607 | +} | |
| 608 | +namespace quicktype { | |
| 608 | 609 | inline void from_json(const json & j, The480_WStill& x) { |
| 609 | 610 | x.set_height(j.at("height").get<std::string>()); |
| 610 | 611 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +58 −57test/inputs/json/misc/76ae1.json
Mcplusplusdefault / quicktype.hpp+58 −57
| @@ -784,90 +784,91 @@ namespace quicktype { | ||
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | namespace quicktype { |
| 787 | - void from_json(const json & j, Property & x); | |
| 788 | - void to_json(json & j, const Property & x); | |
| 787 | +void from_json(const json & j, Property & x); | |
| 788 | +void to_json(json & j, const Property & x); | |
| 789 | 789 | |
| 790 | - void from_json(const json & j, Article & x); | |
| 791 | - void to_json(json & j, const Article & x); | |
| 790 | +void from_json(const json & j, Article & x); | |
| 791 | +void to_json(json & j, const Article & x); | |
| 792 | 792 | |
| 793 | - void from_json(const json & j, DeMinimisProperties & x); | |
| 794 | - void to_json(json & j, const DeMinimisProperties & x); | |
| 793 | +void from_json(const json & j, DeMinimisProperties & x); | |
| 794 | +void to_json(json & j, const DeMinimisProperties & x); | |
| 795 | 795 | |
| 796 | - void from_json(const json & j, DeMinimis & x); | |
| 797 | - void to_json(json & j, const DeMinimis & x); | |
| 796 | +void from_json(const json & j, DeMinimis & x); | |
| 797 | +void to_json(json & j, const DeMinimis & x); | |
| 798 | 798 | |
| 799 | - void from_json(const json & j, FaqProperties & x); | |
| 800 | - void to_json(json & j, const FaqProperties & x); | |
| 799 | +void from_json(const json & j, FaqProperties & x); | |
| 800 | +void to_json(json & j, const FaqProperties & x); | |
| 801 | 801 | |
| 802 | - void from_json(const json & j, Faq & x); | |
| 803 | - void to_json(json & j, const Faq & x); | |
| 802 | +void from_json(const json & j, Faq & x); | |
| 803 | +void to_json(json & j, const Faq & x); | |
| 804 | 804 | |
| 805 | - void from_json(const json & j, ReportProperties & x); | |
| 806 | - void to_json(json & j, const ReportProperties & x); | |
| 805 | +void from_json(const json & j, ReportProperties & x); | |
| 806 | +void to_json(json & j, const ReportProperties & x); | |
| 807 | 807 | |
| 808 | - void from_json(const json & j, Report & x); | |
| 809 | - void to_json(json & j, const Report & x); | |
| 808 | +void from_json(const json & j, Report & x); | |
| 809 | +void to_json(json & j, const Report & x); | |
| 810 | 810 | |
| 811 | - void from_json(const json & j, TaxonomyProperties & x); | |
| 812 | - void to_json(json & j, const TaxonomyProperties & x); | |
| 811 | +void from_json(const json & j, TaxonomyProperties & x); | |
| 812 | +void to_json(json & j, const TaxonomyProperties & x); | |
| 813 | 813 | |
| 814 | - void from_json(const json & j, Taxonomy & x); | |
| 815 | - void to_json(json & j, const Taxonomy & x); | |
| 814 | +void from_json(const json & j, Taxonomy & x); | |
| 815 | +void to_json(json & j, const Taxonomy & x); | |
| 816 | 816 | |
| 817 | - void from_json(const json & j, Definitions & x); | |
| 818 | - void to_json(json & j, const Definitions & x); | |
| 817 | +void from_json(const json & j, Definitions & x); | |
| 818 | +void to_json(json & j, const Definitions & x); | |
| 819 | 819 | |
| 820 | - void from_json(const json & j, Info & x); | |
| 821 | - void to_json(json & j, const Info & x); | |
| 820 | +void from_json(const json & j, Info & x); | |
| 821 | +void to_json(json & j, const Info & x); | |
| 822 | 822 | |
| 823 | - void from_json(const json & j, Parameter & x); | |
| 824 | - void to_json(json & j, const Parameter & x); | |
| 823 | +void from_json(const json & j, Parameter & x); | |
| 824 | +void to_json(json & j, const Parameter & x); | |
| 825 | 825 | |
| 826 | - void from_json(const json & j, ItemsClass & x); | |
| 827 | - void to_json(json & j, const ItemsClass & x); | |
| 826 | +void from_json(const json & j, ItemsClass & x); | |
| 827 | +void to_json(json & j, const ItemsClass & x); | |
| 828 | 828 | |
| 829 | - void from_json(const json & j, Purple200 & x); | |
| 830 | - void to_json(json & j, const Purple200 & x); | |
| 829 | +void from_json(const json & j, Purple200 & x); | |
| 830 | +void to_json(json & j, const Purple200 & x); | |
| 831 | 831 | |
| 832 | - void from_json(const json & j, PurpleResponses & x); | |
| 833 | - void to_json(json & j, const PurpleResponses & x); | |
| 832 | +void from_json(const json & j, PurpleResponses & x); | |
| 833 | +void to_json(json & j, const PurpleResponses & x); | |
| 834 | 834 | |
| 835 | - void from_json(const json & j, BusinessServiceProvidersSearchGet & x); | |
| 836 | - void to_json(json & j, const BusinessServiceProvidersSearchGet & x); | |
| 835 | +void from_json(const json & j, BusinessServiceProvidersSearchGet & x); | |
| 836 | +void to_json(json & j, const BusinessServiceProvidersSearchGet & x); | |
| 837 | 837 | |
| 838 | - void from_json(const json & j, BusinessServiceProvidersSearchClass & x); | |
| 839 | - void to_json(json & j, const BusinessServiceProvidersSearchClass & x); | |
| 838 | +void from_json(const json & j, BusinessServiceProvidersSearchClass & x); | |
| 839 | +void to_json(json & j, const BusinessServiceProvidersSearchClass & x); | |
| 840 | 840 | |
| 841 | - void from_json(const json & j, PurpleSchema & x); | |
| 842 | - void to_json(json & j, const PurpleSchema & x); | |
| 841 | +void from_json(const json & j, PurpleSchema & x); | |
| 842 | +void to_json(json & j, const PurpleSchema & x); | |
| 843 | 843 | |
| 844 | - void from_json(const json & j, Fluffy200 & x); | |
| 845 | - void to_json(json & j, const Fluffy200 & x); | |
| 844 | +void from_json(const json & j, Fluffy200 & x); | |
| 845 | +void to_json(json & j, const Fluffy200 & x); | |
| 846 | 846 | |
| 847 | - void from_json(const json & j, FluffyResponses & x); | |
| 848 | - void to_json(json & j, const FluffyResponses & x); | |
| 847 | +void from_json(const json & j, FluffyResponses & x); | |
| 848 | +void to_json(json & j, const FluffyResponses & x); | |
| 849 | 849 | |
| 850 | - void from_json(const json & j, ConsolidatedScreeningListSearchGet & x); | |
| 851 | - void to_json(json & j, const ConsolidatedScreeningListSearchGet & x); | |
| 850 | +void from_json(const json & j, ConsolidatedScreeningListSearchGet & x); | |
| 851 | +void to_json(json & j, const ConsolidatedScreeningListSearchGet & x); | |
| 852 | 852 | |
| 853 | - void from_json(const json & j, ConsolidatedScreeningListSearchClass & x); | |
| 854 | - void to_json(json & j, const ConsolidatedScreeningListSearchClass & x); | |
| 853 | +void from_json(const json & j, ConsolidatedScreeningListSearchClass & x); | |
| 854 | +void to_json(json & j, const ConsolidatedScreeningListSearchClass & x); | |
| 855 | 855 | |
| 856 | - void from_json(const json & j, Paths & x); | |
| 857 | - void to_json(json & j, const Paths & x); | |
| 856 | +void from_json(const json & j, Paths & x); | |
| 857 | +void to_json(json & j, const Paths & x); | |
| 858 | 858 | |
| 859 | - void from_json(const json & j, TopLevel & x); | |
| 860 | - void to_json(json & j, const TopLevel & x); | |
| 859 | +void from_json(const json & j, TopLevel & x); | |
| 860 | +void to_json(json & j, const TopLevel & x); | |
| 861 | 861 | |
| 862 | - void from_json(const json & j, FormatEnum & x); | |
| 863 | - void to_json(json & j, const FormatEnum & x); | |
| 862 | +void from_json(const json & j, FormatEnum & x); | |
| 863 | +void to_json(json & j, const FormatEnum & x); | |
| 864 | 864 | |
| 865 | - void from_json(const json & j, In & x); | |
| 866 | - void to_json(json & j, const In & x); | |
| 867 | - | |
| 868 | - void from_json(const json & j, SchemaType & x); | |
| 869 | - void to_json(json & j, const SchemaType & x); | |
| 865 | +void from_json(const json & j, In & x); | |
| 866 | +void to_json(json & j, const In & x); | |
| 870 | 867 | |
| 868 | +void from_json(const json & j, SchemaType & x); | |
| 869 | +void to_json(json & j, const SchemaType & x); | |
| 870 | +} | |
| 871 | +namespace quicktype { | |
| 871 | 872 | inline void from_json(const json & j, Property& x) { |
| 872 | 873 | x.set_description(j.at("description").get<std::string>()); |
| 873 | 874 | x.set_type(j.at("type").get<FormatEnum>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/77392.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -155,15 +155,16 @@ namespace quicktype { | ||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | namespace quicktype { |
| 158 | - void from_json(const json & j, TopLevelElement & x); | |
| 159 | - void to_json(json & j, const TopLevelElement & x); | |
| 158 | +void from_json(const json & j, TopLevelElement & x); | |
| 159 | +void to_json(json & j, const TopLevelElement & x); | |
| 160 | 160 | |
| 161 | - void from_json(const json & j, OrbitClass & x); | |
| 162 | - void to_json(json & j, const OrbitClass & x); | |
| 163 | - | |
| 164 | - void from_json(const json & j, Pha & x); | |
| 165 | - void to_json(json & j, const Pha & x); | |
| 161 | +void from_json(const json & j, OrbitClass & x); | |
| 162 | +void to_json(json & j, const OrbitClass & x); | |
| 166 | 163 | |
| 164 | +void from_json(const json & j, Pha & x); | |
| 165 | +void to_json(json & j, const Pha & x); | |
| 166 | +} | |
| 167 | +namespace quicktype { | |
| 167 | 168 | inline void from_json(const json & j, TopLevelElement& x) { |
| 168 | 169 | x.set_designation(j.at("designation").get<std::string>()); |
| 169 | 170 | x.set_discovery_date(j.at("discovery_date").get<std::string>()); |
Test case
1 generated file · +32 −31test/inputs/json/misc/7d397.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -324,51 +324,52 @@ namespace quicktype { | ||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | namespace quicktype { |
| 327 | - void from_json(const json & j, Property & x); | |
| 328 | - void to_json(json & j, const Property & x); | |
| 327 | +void from_json(const json & j, Property & x); | |
| 328 | +void to_json(json & j, const Property & x); | |
| 329 | 329 | |
| 330 | - void from_json(const json & j, List & x); | |
| 331 | - void to_json(json & j, const List & x); | |
| 330 | +void from_json(const json & j, List & x); | |
| 331 | +void to_json(json & j, const List & x); | |
| 332 | 332 | |
| 333 | - void from_json(const json & j, Definitions & x); | |
| 334 | - void to_json(json & j, const Definitions & x); | |
| 333 | +void from_json(const json & j, Definitions & x); | |
| 334 | +void to_json(json & j, const Definitions & x); | |
| 335 | 335 | |
| 336 | - void from_json(const json & j, Info & x); | |
| 337 | - void to_json(json & j, const Info & x); | |
| 336 | +void from_json(const json & j, Info & x); | |
| 337 | +void to_json(json & j, const Info & x); | |
| 338 | 338 | |
| 339 | - void from_json(const json & j, Parameter & x); | |
| 340 | - void to_json(json & j, const Parameter & x); | |
| 339 | +void from_json(const json & j, Parameter & x); | |
| 340 | +void to_json(json & j, const Parameter & x); | |
| 341 | 341 | |
| 342 | - void from_json(const json & j, Items & x); | |
| 343 | - void to_json(json & j, const Items & x); | |
| 342 | +void from_json(const json & j, Items & x); | |
| 343 | +void to_json(json & j, const Items & x); | |
| 344 | 344 | |
| 345 | - void from_json(const json & j, Schema & x); | |
| 346 | - void to_json(json & j, const Schema & x); | |
| 345 | +void from_json(const json & j, Schema & x); | |
| 346 | +void to_json(json & j, const Schema & x); | |
| 347 | 347 | |
| 348 | - void from_json(const json & j, The200 & x); | |
| 349 | - void to_json(json & j, const The200 & x); | |
| 348 | +void from_json(const json & j, The200 & x); | |
| 349 | +void to_json(json & j, const The200 & x); | |
| 350 | 350 | |
| 351 | - void from_json(const json & j, Responses & x); | |
| 352 | - void to_json(json & j, const Responses & x); | |
| 351 | +void from_json(const json & j, Responses & x); | |
| 352 | +void to_json(json & j, const Responses & x); | |
| 353 | 353 | |
| 354 | - void from_json(const json & j, Get & x); | |
| 355 | - void to_json(json & j, const Get & x); | |
| 354 | +void from_json(const json & j, Get & x); | |
| 355 | +void to_json(json & j, const Get & x); | |
| 356 | 356 | |
| 357 | - void from_json(const json & j, ConsolidatedScreeningListSearch & x); | |
| 358 | - void to_json(json & j, const ConsolidatedScreeningListSearch & x); | |
| 357 | +void from_json(const json & j, ConsolidatedScreeningListSearch & x); | |
| 358 | +void to_json(json & j, const ConsolidatedScreeningListSearch & x); | |
| 359 | 359 | |
| 360 | - void from_json(const json & j, Paths & x); | |
| 361 | - void to_json(json & j, const Paths & x); | |
| 360 | +void from_json(const json & j, Paths & x); | |
| 361 | +void to_json(json & j, const Paths & x); | |
| 362 | 362 | |
| 363 | - void from_json(const json & j, TopLevel & x); | |
| 364 | - void to_json(json & j, const TopLevel & x); | |
| 363 | +void from_json(const json & j, TopLevel & x); | |
| 364 | +void to_json(json & j, const TopLevel & x); | |
| 365 | 365 | |
| 366 | - void from_json(const json & j, Type & x); | |
| 367 | - void to_json(json & j, const Type & x); | |
| 368 | - | |
| 369 | - void from_json(const json & j, In & x); | |
| 370 | - void to_json(json & j, const In & x); | |
| 366 | +void from_json(const json & j, Type & x); | |
| 367 | +void to_json(json & j, const Type & x); | |
| 371 | 368 | |
| 369 | +void from_json(const json & j, In & x); | |
| 370 | +void to_json(json & j, const In & x); | |
| 371 | +} | |
| 372 | +namespace quicktype { | |
| 372 | 373 | inline void from_json(const json & j, Property& x) { |
| 373 | 374 | x.set_description(j.at("description").get<std::string>()); |
| 374 | 375 | x.set_type(j.at("type").get<Type>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/7d722.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/7df41.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -91,12 +91,13 @@ namespace quicktype { | ||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | namespace quicktype { |
| 94 | - void from_json(const json & j, Pc & x); | |
| 95 | - void to_json(json & j, const Pc & x); | |
| 96 | - | |
| 97 | - void from_json(const json & j, TopLevel & x); | |
| 98 | - void to_json(json & j, const TopLevel & x); | |
| 94 | +void from_json(const json & j, Pc & x); | |
| 95 | +void to_json(json & j, const Pc & x); | |
| 99 | 96 | |
| 97 | +void from_json(const json & j, TopLevel & x); | |
| 98 | +void to_json(json & j, const TopLevel & x); | |
| 99 | +} | |
| 100 | +namespace quicktype { | |
| 100 | 101 | inline void from_json(const json & j, Pc& x) { |
| 101 | 102 | x.set_count(j.at("count").get<int64_t>()); |
| 102 | 103 | x.set_label(j.at("label").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/7dfa6.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +18 −17test/inputs/json/misc/7eb30.json
Mcplusplusdefault / quicktype.hpp+18 −17
| @@ -180,30 +180,31 @@ namespace quicktype { | ||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | namespace quicktype { |
| 183 | - void from_json(const json & j, Group & x); | |
| 184 | - void to_json(json & j, const Group & x); | |
| 183 | +void from_json(const json & j, Group & x); | |
| 184 | +void to_json(json & j, const Group & x); | |
| 185 | 185 | |
| 186 | - void from_json(const json & j, Result & x); | |
| 187 | - void to_json(json & j, const Result & x); | |
| 186 | +void from_json(const json & j, Result & x); | |
| 187 | +void to_json(json & j, const Result & x); | |
| 188 | 188 | |
| 189 | - void from_json(const json & j, TopLevel & x); | |
| 190 | - void to_json(json & j, const TopLevel & x); | |
| 189 | +void from_json(const json & j, TopLevel & x); | |
| 190 | +void to_json(json & j, const TopLevel & x); | |
| 191 | 191 | |
| 192 | - void from_json(const json & j, Code & x); | |
| 193 | - void to_json(json & j, const Code & x); | |
| 192 | +void from_json(const json & j, Code & x); | |
| 193 | +void to_json(json & j, const Code & x); | |
| 194 | 194 | |
| 195 | - void from_json(const json & j, English & x); | |
| 196 | - void to_json(json & j, const English & x); | |
| 195 | +void from_json(const json & j, English & x); | |
| 196 | +void to_json(json & j, const English & x); | |
| 197 | 197 | |
| 198 | - void from_json(const json & j, Thai & x); | |
| 199 | - void to_json(json & j, const Thai & x); | |
| 198 | +void from_json(const json & j, Thai & x); | |
| 199 | +void to_json(json & j, const Thai & x); | |
| 200 | 200 | |
| 201 | - void from_json(const json & j, Location & x); | |
| 202 | - void to_json(json & j, const Location & x); | |
| 203 | - | |
| 204 | - void from_json(const json & j, Tel & x); | |
| 205 | - void to_json(json & j, const Tel & x); | |
| 201 | +void from_json(const json & j, Location & x); | |
| 202 | +void to_json(json & j, const Location & x); | |
| 206 | 203 | |
| 204 | +void from_json(const json & j, Tel & x); | |
| 205 | +void to_json(json & j, const Tel & x); | |
| 206 | +} | |
| 207 | +namespace quicktype { | |
| 207 | 208 | inline void from_json(const json & j, Group& x) { |
| 208 | 209 | x.set_code(j.at("code").get<Code>()); |
| 209 | 210 | x.set_english(j.at("english").get<English>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/7f568.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -216,18 +216,19 @@ namespace quicktype { | ||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | namespace quicktype { |
| 219 | - void from_json(const json & j, File & x); | |
| 220 | - void to_json(json & j, const File & x); | |
| 219 | +void from_json(const json & j, File & x); | |
| 220 | +void to_json(json & j, const File & x); | |
| 221 | 221 | |
| 222 | - void from_json(const json & j, TopLevelElement & x); | |
| 223 | - void to_json(json & j, const TopLevelElement & x); | |
| 222 | +void from_json(const json & j, TopLevelElement & x); | |
| 223 | +void to_json(json & j, const TopLevelElement & x); | |
| 224 | 224 | |
| 225 | - void from_json(const json & j, Language & x); | |
| 226 | - void to_json(json & j, const Language & x); | |
| 227 | - | |
| 228 | - void from_json(const json & j, Type & x); | |
| 229 | - void to_json(json & j, const Type & x); | |
| 225 | +void from_json(const json & j, Language & x); | |
| 226 | +void to_json(json & j, const Language & x); | |
| 230 | 227 | |
| 228 | +void from_json(const json & j, Type & x); | |
| 229 | +void to_json(json & j, const Type & x); | |
| 230 | +} | |
| 231 | +namespace quicktype { | |
| 231 | 232 | inline void from_json(const json & j, File& x) { |
| 232 | 233 | x.set_filename(j.at("filename").get<std::string>()); |
| 233 | 234 | x.set_language(get_stack_optional<Language>(j, "language")); |
Test case
1 generated file · +8 −7test/inputs/json/misc/80aff.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -186,15 +186,16 @@ namespace quicktype { | ||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | namespace quicktype { |
| 189 | - void from_json(const json & j, Facets & x); | |
| 190 | - void to_json(json & j, const Facets & x); | |
| 189 | +void from_json(const json & j, Facets & x); | |
| 190 | +void to_json(json & j, const Facets & x); | |
| 191 | 191 | |
| 192 | - void from_json(const json & j, Result & x); | |
| 193 | - void to_json(json & j, const Result & x); | |
| 194 | - | |
| 195 | - void from_json(const json & j, TopLevel & x); | |
| 196 | - void to_json(json & j, const TopLevel & x); | |
| 192 | +void from_json(const json & j, Result & x); | |
| 193 | +void to_json(json & j, const Result & x); | |
| 197 | 194 | |
| 195 | +void from_json(const json & j, TopLevel & x); | |
| 196 | +void to_json(json & j, const TopLevel & x); | |
| 197 | +} | |
| 198 | +namespace quicktype { | |
| 198 | 199 | inline void from_json(const json & j, Facets& x) { |
| 199 | 200 | (void)j; |
| 200 | 201 | (void)x; |
Test case
1 generated file · +4 −3test/inputs/json/misc/82509.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_origin(j.at("origin").get<std::string>()); |
| 55 | 56 | } |
Test case
1 generated file · +32 −31test/inputs/json/misc/8592b.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -577,51 +577,52 @@ namespace quicktype { | ||
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | namespace quicktype { |
| 580 | - void from_json(const json & j, MediaEmbed & x); | |
| 581 | - void to_json(json & j, const MediaEmbed & x); | |
| 580 | +void from_json(const json & j, MediaEmbed & x); | |
| 581 | +void to_json(json & j, const MediaEmbed & x); | |
| 582 | 582 | |
| 583 | - void from_json(const json & j, Source & x); | |
| 584 | - void to_json(json & j, const Source & x); | |
| 583 | +void from_json(const json & j, Source & x); | |
| 584 | +void to_json(json & j, const Source & x); | |
| 585 | 585 | |
| 586 | - void from_json(const json & j, Image & x); | |
| 587 | - void to_json(json & j, const Image & x); | |
| 586 | +void from_json(const json & j, Image & x); | |
| 587 | +void to_json(json & j, const Image & x); | |
| 588 | 588 | |
| 589 | - void from_json(const json & j, Preview & x); | |
| 590 | - void to_json(json & j, const Preview & x); | |
| 589 | +void from_json(const json & j, Preview & x); | |
| 590 | +void to_json(json & j, const Preview & x); | |
| 591 | 591 | |
| 592 | - void from_json(const json & j, ChildData & x); | |
| 593 | - void to_json(json & j, const ChildData & x); | |
| 592 | +void from_json(const json & j, ChildData & x); | |
| 593 | +void to_json(json & j, const ChildData & x); | |
| 594 | 594 | |
| 595 | - void from_json(const json & j, Child & x); | |
| 596 | - void to_json(json & j, const Child & x); | |
| 595 | +void from_json(const json & j, Child & x); | |
| 596 | +void to_json(json & j, const Child & x); | |
| 597 | 597 | |
| 598 | - void from_json(const json & j, TopLevelData & x); | |
| 599 | - void to_json(json & j, const TopLevelData & x); | |
| 598 | +void from_json(const json & j, TopLevelData & x); | |
| 599 | +void to_json(json & j, const TopLevelData & x); | |
| 600 | 600 | |
| 601 | - void from_json(const json & j, TopLevel & x); | |
| 602 | - void to_json(json & j, const TopLevel & x); | |
| 601 | +void from_json(const json & j, TopLevel & x); | |
| 602 | +void to_json(json & j, const TopLevel & x); | |
| 603 | 603 | |
| 604 | - void from_json(const json & j, PostHint & x); | |
| 605 | - void to_json(json & j, const PostHint & x); | |
| 604 | +void from_json(const json & j, PostHint & x); | |
| 605 | +void to_json(json & j, const PostHint & x); | |
| 606 | 606 | |
| 607 | - void from_json(const json & j, Subreddit & x); | |
| 608 | - void to_json(json & j, const Subreddit & x); | |
| 607 | +void from_json(const json & j, Subreddit & x); | |
| 608 | +void to_json(json & j, const Subreddit & x); | |
| 609 | 609 | |
| 610 | - void from_json(const json & j, SubredditId & x); | |
| 611 | - void to_json(json & j, const SubredditId & x); | |
| 610 | +void from_json(const json & j, SubredditId & x); | |
| 611 | +void to_json(json & j, const SubredditId & x); | |
| 612 | 612 | |
| 613 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 614 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 613 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 614 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 615 | 615 | |
| 616 | - void from_json(const json & j, SubredditType & x); | |
| 617 | - void to_json(json & j, const SubredditType & x); | |
| 616 | +void from_json(const json & j, SubredditType & x); | |
| 617 | +void to_json(json & j, const SubredditType & x); | |
| 618 | 618 | |
| 619 | - void from_json(const json & j, SuggestedSort & x); | |
| 620 | - void to_json(json & j, const SuggestedSort & x); | |
| 621 | - | |
| 622 | - void from_json(const json & j, Kind & x); | |
| 623 | - void to_json(json & j, const Kind & x); | |
| 619 | +void from_json(const json & j, SuggestedSort & x); | |
| 620 | +void to_json(json & j, const SuggestedSort & x); | |
| 624 | 621 | |
| 622 | +void from_json(const json & j, Kind & x); | |
| 623 | +void to_json(json & j, const Kind & x); | |
| 624 | +} | |
| 625 | +namespace quicktype { | |
| 625 | 626 | inline void from_json(const json & j, MediaEmbed& x) { |
| 626 | 627 | (void)j; |
| 627 | 628 | (void)x; |
Test case
1 generated file · +30 −29test/inputs/json/misc/88130.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/8a62c.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/908db.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -80,15 +80,16 @@ namespace quicktype { | ||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | namespace quicktype { |
| 83 | - void from_json(const json & j, StateState & x); | |
| 84 | - void to_json(json & j, const StateState & x); | |
| 83 | +void from_json(const json & j, StateState & x); | |
| 84 | +void to_json(json & j, const StateState & x); | |
| 85 | 85 | |
| 86 | - void from_json(const json & j, StateElement & x); | |
| 87 | - void to_json(json & j, const StateElement & x); | |
| 88 | - | |
| 89 | - void from_json(const json & j, TopLevel & x); | |
| 90 | - void to_json(json & j, const TopLevel & x); | |
| 86 | +void from_json(const json & j, StateElement & x); | |
| 87 | +void to_json(json & j, const StateElement & x); | |
| 91 | 88 | |
| 89 | +void from_json(const json & j, TopLevel & x); | |
| 90 | +void to_json(json & j, const TopLevel & x); | |
| 91 | +} | |
| 92 | +namespace quicktype { | |
| 92 | 93 | inline void from_json(const json & j, StateState& x) { |
| 93 | 94 | x.set_state_id(j.at("state_id").get<std::string>()); |
| 94 | 95 | x.set_state_name(j.at("state_name").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/9617f.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/96f7c.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -72,9 +72,10 @@ namespace quicktype { | ||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | namespace quicktype { |
| 75 | - void from_json(const json & j, TopLevel & x); | |
| 76 | - void to_json(json & j, const TopLevel & x); | |
| 77 | - | |
| 75 | +void from_json(const json & j, TopLevel & x); | |
| 76 | +void to_json(json & j, const TopLevel & x); | |
| 77 | +} | |
| 78 | +namespace quicktype { | |
| 78 | 79 | inline void from_json(const json & j, TopLevel& x) { |
| 79 | 80 | x.set_git(j.at("git").get<std::vector<std::string>>()); |
| 80 | 81 | x.set_github_services_sha(j.at("github_services_sha").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/9847b.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -54,9 +54,10 @@ namespace quicktype { | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | namespace quicktype { |
| 57 | - void from_json(const json & j, TopLevelElement & x); | |
| 58 | - void to_json(json & j, const TopLevelElement & x); | |
| 59 | - | |
| 57 | +void from_json(const json & j, TopLevelElement & x); | |
| 58 | +void to_json(json & j, const TopLevelElement & x); | |
| 59 | +} | |
| 60 | +namespace quicktype { | |
| 60 | 61 | inline void from_json(const json & j, TopLevelElement& x) { |
| 61 | 62 | x.set_id(j.at("id").get<std::string>()); |
| 62 | 63 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/9929c.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +18 −17test/inputs/json/misc/996bd.json
Mcplusplusdefault / quicktype.hpp+18 −17
| @@ -209,30 +209,31 @@ namespace quicktype { | ||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | namespace quicktype { |
| 212 | - void from_json(const json & j, Identifier & x); | |
| 213 | - void to_json(json & j, const Identifier & x); | |
| 212 | +void from_json(const json & j, Identifier & x); | |
| 213 | +void to_json(json & j, const Identifier & x); | |
| 214 | 214 | |
| 215 | - void from_json(const json & j, Link & x); | |
| 216 | - void to_json(json & j, const Link & x); | |
| 215 | +void from_json(const json & j, Link & x); | |
| 216 | +void to_json(json & j, const Link & x); | |
| 217 | 217 | |
| 218 | - void from_json(const json & j, Text & x); | |
| 219 | - void to_json(json & j, const Text & x); | |
| 218 | +void from_json(const json & j, Text & x); | |
| 219 | +void to_json(json & j, const Text & x); | |
| 220 | 220 | |
| 221 | - void from_json(const json & j, TopLevelElement & x); | |
| 222 | - void to_json(json & j, const TopLevelElement & x); | |
| 221 | +void from_json(const json & j, TopLevelElement & x); | |
| 222 | +void to_json(json & j, const TopLevelElement & x); | |
| 223 | 223 | |
| 224 | - void from_json(const json & j, Scheme & x); | |
| 225 | - void to_json(json & j, const Scheme & x); | |
| 224 | +void from_json(const json & j, Scheme & x); | |
| 225 | +void to_json(json & j, const Scheme & x); | |
| 226 | 226 | |
| 227 | - void from_json(const json & j, Keyword & x); | |
| 228 | - void to_json(json & j, const Keyword & x); | |
| 227 | +void from_json(const json & j, Keyword & x); | |
| 228 | +void to_json(json & j, const Keyword & x); | |
| 229 | 229 | |
| 230 | - void from_json(const json & j, MediaType & x); | |
| 231 | - void to_json(json & j, const MediaType & x); | |
| 232 | - | |
| 233 | - void from_json(const json & j, Title & x); | |
| 234 | - void to_json(json & j, const Title & x); | |
| 230 | +void from_json(const json & j, MediaType & x); | |
| 231 | +void to_json(json & j, const MediaType & x); | |
| 235 | 232 | |
| 233 | +void from_json(const json & j, Title & x); | |
| 234 | +void to_json(json & j, const Title & x); | |
| 235 | +} | |
| 236 | +namespace quicktype { | |
| 236 | 237 | inline void from_json(const json & j, Identifier& x) { |
| 237 | 238 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 238 | 239 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +12 −11test/inputs/json/misc/9a503.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -148,21 +148,22 @@ namespace quicktype { | ||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | namespace quicktype { |
| 151 | - void from_json(const json & j, Identifier & x); | |
| 152 | - void to_json(json & j, const Identifier & x); | |
| 151 | +void from_json(const json & j, Identifier & x); | |
| 152 | +void to_json(json & j, const Identifier & x); | |
| 153 | 153 | |
| 154 | - void from_json(const json & j, Link & x); | |
| 155 | - void to_json(json & j, const Link & x); | |
| 154 | +void from_json(const json & j, Link & x); | |
| 155 | +void to_json(json & j, const Link & x); | |
| 156 | 156 | |
| 157 | - void from_json(const json & j, Text & x); | |
| 158 | - void to_json(json & j, const Text & x); | |
| 157 | +void from_json(const json & j, Text & x); | |
| 158 | +void to_json(json & j, const Text & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, TopLevelElement & x); | |
| 161 | - void to_json(json & j, const TopLevelElement & x); | |
| 162 | - | |
| 163 | - void from_json(const json & j, Keyword & x); | |
| 164 | - void to_json(json & j, const Keyword & x); | |
| 160 | +void from_json(const json & j, TopLevelElement & x); | |
| 161 | +void to_json(json & j, const TopLevelElement & x); | |
| 165 | 162 | |
| 163 | +void from_json(const json & j, Keyword & x); | |
| 164 | +void to_json(json & j, const Keyword & x); | |
| 165 | +} | |
| 166 | +namespace quicktype { | |
| 166 | 167 | inline void from_json(const json & j, Identifier& x) { |
| 167 | 168 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 168 | 169 | x.set_scheme(j.at("scheme").get<std::string>()); |
Test case
1 generated file · +12 −11test/inputs/json/misc/9ac3b.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -209,21 +209,22 @@ namespace quicktype { | ||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | namespace quicktype { |
| 212 | - void from_json(const json & j, Facets & x); | |
| 213 | - void to_json(json & j, const Facets & x); | |
| 212 | +void from_json(const json & j, Facets & x); | |
| 213 | +void to_json(json & j, const Facets & x); | |
| 214 | 214 | |
| 215 | - void from_json(const json & j, Result & x); | |
| 216 | - void to_json(json & j, const Result & x); | |
| 215 | +void from_json(const json & j, Result & x); | |
| 216 | +void to_json(json & j, const Result & x); | |
| 217 | 217 | |
| 218 | - void from_json(const json & j, TopLevel & x); | |
| 219 | - void to_json(json & j, const TopLevel & x); | |
| 218 | +void from_json(const json & j, TopLevel & x); | |
| 219 | +void to_json(json & j, const TopLevel & x); | |
| 220 | 220 | |
| 221 | - void from_json(const json & j, Status & x); | |
| 222 | - void to_json(json & j, const Status & x); | |
| 223 | - | |
| 224 | - void from_json(const json & j, Title & x); | |
| 225 | - void to_json(json & j, const Title & x); | |
| 221 | +void from_json(const json & j, Status & x); | |
| 222 | +void to_json(json & j, const Status & x); | |
| 226 | 223 | |
| 224 | +void from_json(const json & j, Title & x); | |
| 225 | +void to_json(json & j, const Title & x); | |
| 226 | +} | |
| 227 | +namespace quicktype { | |
| 227 | 228 | inline void from_json(const json & j, Facets& x) { |
| 228 | 229 | (void)j; |
| 229 | 230 | (void)x; |
Test case
1 generated file · +12 −11test/inputs/json/misc/9eed5.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -148,21 +148,22 @@ namespace quicktype { | ||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | namespace quicktype { |
| 151 | - void from_json(const json & j, Identifier & x); | |
| 152 | - void to_json(json & j, const Identifier & x); | |
| 151 | +void from_json(const json & j, Identifier & x); | |
| 152 | +void to_json(json & j, const Identifier & x); | |
| 153 | 153 | |
| 154 | - void from_json(const json & j, Link & x); | |
| 155 | - void to_json(json & j, const Link & x); | |
| 154 | +void from_json(const json & j, Link & x); | |
| 155 | +void to_json(json & j, const Link & x); | |
| 156 | 156 | |
| 157 | - void from_json(const json & j, Text & x); | |
| 158 | - void to_json(json & j, const Text & x); | |
| 157 | +void from_json(const json & j, Text & x); | |
| 158 | +void to_json(json & j, const Text & x); | |
| 159 | 159 | |
| 160 | - void from_json(const json & j, TopLevelElement & x); | |
| 161 | - void to_json(json & j, const TopLevelElement & x); | |
| 162 | - | |
| 163 | - void from_json(const json & j, Keyword & x); | |
| 164 | - void to_json(json & j, const Keyword & x); | |
| 160 | +void from_json(const json & j, TopLevelElement & x); | |
| 161 | +void to_json(json & j, const TopLevelElement & x); | |
| 165 | 162 | |
| 163 | +void from_json(const json & j, Keyword & x); | |
| 164 | +void to_json(json & j, const Keyword & x); | |
| 165 | +} | |
| 166 | +namespace quicktype { | |
| 166 | 167 | inline void from_json(const json & j, Identifier& x) { |
| 167 | 168 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 168 | 169 | x.set_scheme(j.at("scheme").get<std::string>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/a1eca.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/a45b0.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/a71df.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/a9691.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/ab0d1.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/abb4b.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/ac944.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +22 −21test/inputs/json/misc/ad8be.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -229,36 +229,37 @@ namespace quicktype { | ||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | namespace quicktype { |
| 232 | - void from_json(const json & j, Identifier & x); | |
| 233 | - void to_json(json & j, const Identifier & x); | |
| 232 | +void from_json(const json & j, Identifier & x); | |
| 233 | +void to_json(json & j, const Identifier & x); | |
| 234 | 234 | |
| 235 | - void from_json(const json & j, Link & x); | |
| 236 | - void to_json(json & j, const Link & x); | |
| 235 | +void from_json(const json & j, Link & x); | |
| 236 | +void to_json(json & j, const Link & x); | |
| 237 | 237 | |
| 238 | - void from_json(const json & j, OtherName & x); | |
| 239 | - void to_json(json & j, const OtherName & x); | |
| 238 | +void from_json(const json & j, OtherName & x); | |
| 239 | +void to_json(json & j, const OtherName & x); | |
| 240 | 240 | |
| 241 | - void from_json(const json & j, Text & x); | |
| 242 | - void to_json(json & j, const Text & x); | |
| 241 | +void from_json(const json & j, Text & x); | |
| 242 | +void to_json(json & j, const Text & x); | |
| 243 | 243 | |
| 244 | - void from_json(const json & j, TopLevelElement & x); | |
| 245 | - void to_json(json & j, const TopLevelElement & x); | |
| 244 | +void from_json(const json & j, TopLevelElement & x); | |
| 245 | +void to_json(json & j, const TopLevelElement & x); | |
| 246 | 246 | |
| 247 | - void from_json(const json & j, Scheme & x); | |
| 248 | - void to_json(json & j, const Scheme & x); | |
| 247 | +void from_json(const json & j, Scheme & x); | |
| 248 | +void to_json(json & j, const Scheme & x); | |
| 249 | 249 | |
| 250 | - void from_json(const json & j, Keyword & x); | |
| 251 | - void to_json(json & j, const Keyword & x); | |
| 250 | +void from_json(const json & j, Keyword & x); | |
| 251 | +void to_json(json & j, const Keyword & x); | |
| 252 | 252 | |
| 253 | - void from_json(const json & j, Note & x); | |
| 254 | - void to_json(json & j, const Note & x); | |
| 253 | +void from_json(const json & j, Note & x); | |
| 254 | +void to_json(json & j, const Note & x); | |
| 255 | 255 | |
| 256 | - void from_json(const json & j, MediaType & x); | |
| 257 | - void to_json(json & j, const MediaType & x); | |
| 258 | - | |
| 259 | - void from_json(const json & j, Title & x); | |
| 260 | - void to_json(json & j, const Title & x); | |
| 256 | +void from_json(const json & j, MediaType & x); | |
| 257 | +void to_json(json & j, const MediaType & x); | |
| 261 | 258 | |
| 259 | +void from_json(const json & j, Title & x); | |
| 260 | +void to_json(json & j, const Title & x); | |
| 261 | +} | |
| 262 | +namespace quicktype { | |
| 262 | 263 | inline void from_json(const json & j, Identifier& x) { |
| 263 | 264 | x.set_identifier(j.at("identifier").get<std::string>()); |
| 264 | 265 | x.set_scheme(j.at("scheme").get<Scheme>()); |
Test case
1 generated file · +24 −23test/inputs/json/misc/ae7f0.json
Mcplusplusdefault / quicktype.hpp+24 −23
| @@ -485,39 +485,40 @@ namespace quicktype { | ||
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | namespace quicktype { |
| 488 | - void from_json(const json & j, MediaEmbed & x); | |
| 489 | - void to_json(json & j, const MediaEmbed & x); | |
| 488 | +void from_json(const json & j, MediaEmbed & x); | |
| 489 | +void to_json(json & j, const MediaEmbed & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, ChildData & x); | |
| 492 | - void to_json(json & j, const ChildData & x); | |
| 491 | +void from_json(const json & j, ChildData & x); | |
| 492 | +void to_json(json & j, const ChildData & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Child & x); | |
| 495 | - void to_json(json & j, const Child & x); | |
| 494 | +void from_json(const json & j, Child & x); | |
| 495 | +void to_json(json & j, const Child & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, TopLevelData & x); | |
| 498 | - void to_json(json & j, const TopLevelData & x); | |
| 497 | +void from_json(const json & j, TopLevelData & x); | |
| 498 | +void to_json(json & j, const TopLevelData & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, TopLevel & x); | |
| 501 | - void to_json(json & j, const TopLevel & x); | |
| 500 | +void from_json(const json & j, TopLevel & x); | |
| 501 | +void to_json(json & j, const TopLevel & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, Domain & x); | |
| 504 | - void to_json(json & j, const Domain & x); | |
| 503 | +void from_json(const json & j, Domain & x); | |
| 504 | +void to_json(json & j, const Domain & x); | |
| 505 | 505 | |
| 506 | - void from_json(const json & j, Subreddit & x); | |
| 507 | - void to_json(json & j, const Subreddit & x); | |
| 506 | +void from_json(const json & j, Subreddit & x); | |
| 507 | +void to_json(json & j, const Subreddit & x); | |
| 508 | 508 | |
| 509 | - void from_json(const json & j, SubredditId & x); | |
| 510 | - void to_json(json & j, const SubredditId & x); | |
| 509 | +void from_json(const json & j, SubredditId & x); | |
| 510 | +void to_json(json & j, const SubredditId & x); | |
| 511 | 511 | |
| 512 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 513 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 512 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 513 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 514 | 514 | |
| 515 | - void from_json(const json & j, SubredditType & x); | |
| 516 | - void to_json(json & j, const SubredditType & x); | |
| 517 | - | |
| 518 | - void from_json(const json & j, Kind & x); | |
| 519 | - void to_json(json & j, const Kind & x); | |
| 515 | +void from_json(const json & j, SubredditType & x); | |
| 516 | +void to_json(json & j, const SubredditType & x); | |
| 520 | 517 | |
| 518 | +void from_json(const json & j, Kind & x); | |
| 519 | +void to_json(json & j, const Kind & x); | |
| 520 | +} | |
| 521 | +namespace quicktype { | |
| 521 | 522 | inline void from_json(const json & j, MediaEmbed& x) { |
| 522 | 523 | (void)j; |
| 523 | 524 | (void)x; |
Test case
1 generated file · +20 −19test/inputs/json/misc/ae9ca.json
Mcplusplusdefault / quicktype.hpp+20 −19
| @@ -169,33 +169,34 @@ namespace quicktype { | ||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | namespace quicktype { |
| 172 | - void from_json(const json & j, Geometry & x); | |
| 173 | - void to_json(json & j, const Geometry & x); | |
| 172 | +void from_json(const json & j, Geometry & x); | |
| 173 | +void to_json(json & j, const Geometry & x); | |
| 174 | 174 | |
| 175 | - void from_json(const json & j, Properties & x); | |
| 176 | - void to_json(json & j, const Properties & x); | |
| 175 | +void from_json(const json & j, Properties & x); | |
| 176 | +void to_json(json & j, const Properties & x); | |
| 177 | 177 | |
| 178 | - void from_json(const json & j, Feature & x); | |
| 179 | - void to_json(json & j, const Feature & x); | |
| 178 | +void from_json(const json & j, Feature & x); | |
| 179 | +void to_json(json & j, const Feature & x); | |
| 180 | 180 | |
| 181 | - void from_json(const json & j, TopLevel & x); | |
| 182 | - void to_json(json & j, const TopLevel & x); | |
| 181 | +void from_json(const json & j, TopLevel & x); | |
| 182 | +void to_json(json & j, const TopLevel & x); | |
| 183 | 183 | |
| 184 | - void from_json(const json & j, GeometryType & x); | |
| 185 | - void to_json(json & j, const GeometryType & x); | |
| 184 | +void from_json(const json & j, GeometryType & x); | |
| 185 | +void to_json(json & j, const GeometryType & x); | |
| 186 | 186 | |
| 187 | - void from_json(const json & j, MaintainingAuthority & x); | |
| 188 | - void to_json(json & j, const MaintainingAuthority & x); | |
| 187 | +void from_json(const json & j, MaintainingAuthority & x); | |
| 188 | +void to_json(json & j, const MaintainingAuthority & x); | |
| 189 | 189 | |
| 190 | - void from_json(const json & j, Class & x); | |
| 191 | - void to_json(json & j, const Class & x); | |
| 190 | +void from_json(const json & j, Class & x); | |
| 191 | +void to_json(json & j, const Class & x); | |
| 192 | 192 | |
| 193 | - void from_json(const json & j, Ward & x); | |
| 194 | - void to_json(json & j, const Ward & x); | |
| 195 | - | |
| 196 | - void from_json(const json & j, FeatureType & x); | |
| 197 | - void to_json(json & j, const FeatureType & x); | |
| 193 | +void from_json(const json & j, Ward & x); | |
| 194 | +void to_json(json & j, const Ward & x); | |
| 198 | 195 | |
| 196 | +void from_json(const json & j, FeatureType & x); | |
| 197 | +void to_json(json & j, const FeatureType & x); | |
| 198 | +} | |
| 199 | +namespace quicktype { | |
| 199 | 200 | inline void from_json(const json & j, Geometry& x) { |
| 200 | 201 | x.set_coordinates(j.at("coordinates").get<std::vector<double>>()); |
| 201 | 202 | x.set_type(j.at("type").get<GeometryType>()); |
Test case
1 generated file · +34 −33test/inputs/json/misc/af2d1.json
Mcplusplusdefault / quicktype.hpp+34 −33
| @@ -410,54 +410,55 @@ namespace quicktype { | ||
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | namespace quicktype { |
| 413 | - void from_json(const json & j, CrsProperties & x); | |
| 414 | - void to_json(json & j, const CrsProperties & x); | |
| 413 | +void from_json(const json & j, CrsProperties & x); | |
| 414 | +void to_json(json & j, const CrsProperties & x); | |
| 415 | 415 | |
| 416 | - void from_json(const json & j, Crs & x); | |
| 417 | - void to_json(json & j, const Crs & x); | |
| 416 | +void from_json(const json & j, Crs & x); | |
| 417 | +void to_json(json & j, const Crs & x); | |
| 418 | 418 | |
| 419 | - void from_json(const json & j, Geometry & x); | |
| 420 | - void to_json(json & j, const Geometry & x); | |
| 419 | +void from_json(const json & j, Geometry & x); | |
| 420 | +void to_json(json & j, const Geometry & x); | |
| 421 | 421 | |
| 422 | - void from_json(const json & j, FeatureProperties & x); | |
| 423 | - void to_json(json & j, const FeatureProperties & x); | |
| 422 | +void from_json(const json & j, FeatureProperties & x); | |
| 423 | +void to_json(json & j, const FeatureProperties & x); | |
| 424 | 424 | |
| 425 | - void from_json(const json & j, Feature & x); | |
| 426 | - void to_json(json & j, const Feature & x); | |
| 425 | +void from_json(const json & j, Feature & x); | |
| 426 | +void to_json(json & j, const Feature & x); | |
| 427 | 427 | |
| 428 | - void from_json(const json & j, TopLevel & x); | |
| 429 | - void to_json(json & j, const TopLevel & x); | |
| 428 | +void from_json(const json & j, TopLevel & x); | |
| 429 | +void to_json(json & j, const TopLevel & x); | |
| 430 | 430 | |
| 431 | - void from_json(const json & j, GeometryType & x); | |
| 432 | - void to_json(json & j, const GeometryType & x); | |
| 431 | +void from_json(const json & j, GeometryType & x); | |
| 432 | +void to_json(json & j, const GeometryType & x); | |
| 433 | 433 | |
| 434 | - void from_json(const json & j, GeometryName & x); | |
| 435 | - void to_json(json & j, const GeometryName & x); | |
| 434 | +void from_json(const json & j, GeometryName & x); | |
| 435 | +void to_json(json & j, const GeometryName & x); | |
| 436 | 436 | |
| 437 | - void from_json(const json & j, AddImprov & x); | |
| 438 | - void to_json(json & j, const AddImprov & x); | |
| 437 | +void from_json(const json & j, AddImprov & x); | |
| 438 | +void to_json(json & j, const AddImprov & x); | |
| 439 | 439 | |
| 440 | - void from_json(const json & j, FundingBa & x); | |
| 441 | - void to_json(json & j, const FundingBa & x); | |
| 440 | +void from_json(const json & j, FundingBa & x); | |
| 441 | +void to_json(json & j, const FundingBa & x); | |
| 442 | 442 | |
| 443 | - void from_json(const json & j, LevelAccu & x); | |
| 444 | - void to_json(json & j, const LevelAccu & x); | |
| 443 | +void from_json(const json & j, LevelAccu & x); | |
| 444 | +void to_json(json & j, const LevelAccu & x); | |
| 445 | 445 | |
| 446 | - void from_json(const json & j, Material & x); | |
| 447 | - void to_json(json & j, const Material & x); | |
| 446 | +void from_json(const json & j, Material & x); | |
| 447 | +void to_json(json & j, const Material & x); | |
| 448 | 448 | |
| 449 | - void from_json(const json & j, MiSymbolo & x); | |
| 450 | - void to_json(json & j, const MiSymbolo & x); | |
| 449 | +void from_json(const json & j, MiSymbolo & x); | |
| 450 | +void to_json(json & j, const MiSymbolo & x); | |
| 451 | 451 | |
| 452 | - void from_json(const json & j, Status & x); | |
| 453 | - void to_json(json & j, const Status & x); | |
| 452 | +void from_json(const json & j, Status & x); | |
| 453 | +void to_json(json & j, const Status & x); | |
| 454 | 454 | |
| 455 | - void from_json(const json & j, PropertiesType & x); | |
| 456 | - void to_json(json & j, const PropertiesType & x); | |
| 457 | - | |
| 458 | - void from_json(const json & j, FeatureType & x); | |
| 459 | - void to_json(json & j, const FeatureType & x); | |
| 455 | +void from_json(const json & j, PropertiesType & x); | |
| 456 | +void to_json(json & j, const PropertiesType & x); | |
| 460 | 457 | |
| 458 | +void from_json(const json & j, FeatureType & x); | |
| 459 | +void to_json(json & j, const FeatureType & x); | |
| 460 | +} | |
| 461 | +namespace quicktype { | |
| 461 | 462 | inline void from_json(const json & j, CrsProperties& x) { |
| 462 | 463 | x.set_name(j.at("name").get<std::string>()); |
| 463 | 464 | } |
Test case
1 generated file · +12 −11test/inputs/json/misc/b4865.json
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -186,21 +186,22 @@ namespace quicktype { | ||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | namespace quicktype { |
| 189 | - void from_json(const json & j, Geolocation & x); | |
| 190 | - void to_json(json & j, const Geolocation & x); | |
| 189 | +void from_json(const json & j, Geolocation & x); | |
| 190 | +void to_json(json & j, const Geolocation & x); | |
| 191 | 191 | |
| 192 | - void from_json(const json & j, TopLevelElement & x); | |
| 193 | - void to_json(json & j, const TopLevelElement & x); | |
| 192 | +void from_json(const json & j, TopLevelElement & x); | |
| 193 | +void to_json(json & j, const TopLevelElement & x); | |
| 194 | 194 | |
| 195 | - void from_json(const json & j, Fall & x); | |
| 196 | - void to_json(json & j, const Fall & x); | |
| 195 | +void from_json(const json & j, Fall & x); | |
| 196 | +void to_json(json & j, const Fall & x); | |
| 197 | 197 | |
| 198 | - void from_json(const json & j, Type & x); | |
| 199 | - void to_json(json & j, const Type & x); | |
| 200 | - | |
| 201 | - void from_json(const json & j, Nametype & x); | |
| 202 | - void to_json(json & j, const Nametype & x); | |
| 198 | +void from_json(const json & j, Type & x); | |
| 199 | +void to_json(json & j, const Type & x); | |
| 203 | 200 | |
| 201 | +void from_json(const json & j, Nametype & x); | |
| 202 | +void to_json(json & j, const Nametype & x); | |
| 203 | +} | |
| 204 | +namespace quicktype { | |
| 204 | 205 | inline void from_json(const json & j, Geolocation& x) { |
| 205 | 206 | x.set_coordinates(j.at("coordinates").get<std::vector<double>>()); |
| 206 | 207 | x.set_type(j.at("type").get<Type>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/b6f2c.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/b6fe5.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -62,9 +62,10 @@ namespace quicktype { | ||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | namespace quicktype { |
| 65 | - void from_json(const json & j, TopLevel & x); | |
| 66 | - void to_json(json & j, const TopLevel & x); | |
| 67 | - | |
| 65 | +void from_json(const json & j, TopLevel & x); | |
| 66 | +void to_json(json & j, const TopLevel & x); | |
| 67 | +} | |
| 68 | +namespace quicktype { | |
| 68 | 69 | inline void from_json(const json & j, TopLevel& x) { |
| 69 | 70 | x.set_group(j.at("group").get<std::string>()); |
| 70 | 71 | x.set_movie(j.at("movie").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/b9f64.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_user_agent(j.at("user-agent").get<std::string>()); |
| 55 | 56 | } |
Test case
1 generated file · +6 −5test/inputs/json/misc/bb1ec.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +40 −39test/inputs/json/misc/be234.json
Mcplusplusdefault / quicktype.hpp+40 −39
| @@ -723,63 +723,64 @@ namespace quicktype { | ||
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | namespace quicktype { |
| 726 | - void from_json(const json & j, Oembed & x); | |
| 727 | - void to_json(json & j, const Oembed & x); | |
| 726 | +void from_json(const json & j, Oembed & x); | |
| 727 | +void to_json(json & j, const Oembed & x); | |
| 728 | 728 | |
| 729 | - void from_json(const json & j, Media & x); | |
| 730 | - void to_json(json & j, const Media & x); | |
| 729 | +void from_json(const json & j, Media & x); | |
| 730 | +void to_json(json & j, const Media & x); | |
| 731 | 731 | |
| 732 | - void from_json(const json & j, MediaEmbed & x); | |
| 733 | - void to_json(json & j, const MediaEmbed & x); | |
| 732 | +void from_json(const json & j, MediaEmbed & x); | |
| 733 | +void to_json(json & j, const MediaEmbed & x); | |
| 734 | 734 | |
| 735 | - void from_json(const json & j, Source & x); | |
| 736 | - void to_json(json & j, const Source & x); | |
| 735 | +void from_json(const json & j, Source & x); | |
| 736 | +void to_json(json & j, const Source & x); | |
| 737 | 737 | |
| 738 | - void from_json(const json & j, Gif & x); | |
| 739 | - void to_json(json & j, const Gif & x); | |
| 738 | +void from_json(const json & j, Gif & x); | |
| 739 | +void to_json(json & j, const Gif & x); | |
| 740 | 740 | |
| 741 | - void from_json(const json & j, Variants & x); | |
| 742 | - void to_json(json & j, const Variants & x); | |
| 741 | +void from_json(const json & j, Variants & x); | |
| 742 | +void to_json(json & j, const Variants & x); | |
| 743 | 743 | |
| 744 | - void from_json(const json & j, Image & x); | |
| 745 | - void to_json(json & j, const Image & x); | |
| 744 | +void from_json(const json & j, Image & x); | |
| 745 | +void to_json(json & j, const Image & x); | |
| 746 | 746 | |
| 747 | - void from_json(const json & j, Preview & x); | |
| 748 | - void to_json(json & j, const Preview & x); | |
| 747 | +void from_json(const json & j, Preview & x); | |
| 748 | +void to_json(json & j, const Preview & x); | |
| 749 | 749 | |
| 750 | - void from_json(const json & j, ChildData & x); | |
| 751 | - void to_json(json & j, const ChildData & x); | |
| 750 | +void from_json(const json & j, ChildData & x); | |
| 751 | +void to_json(json & j, const ChildData & x); | |
| 752 | 752 | |
| 753 | - void from_json(const json & j, Child & x); | |
| 754 | - void to_json(json & j, const Child & x); | |
| 753 | +void from_json(const json & j, Child & x); | |
| 754 | +void to_json(json & j, const Child & x); | |
| 755 | 755 | |
| 756 | - void from_json(const json & j, TopLevelData & x); | |
| 757 | - void to_json(json & j, const TopLevelData & x); | |
| 756 | +void from_json(const json & j, TopLevelData & x); | |
| 757 | +void to_json(json & j, const TopLevelData & x); | |
| 758 | 758 | |
| 759 | - void from_json(const json & j, TopLevel & x); | |
| 760 | - void to_json(json & j, const TopLevel & x); | |
| 759 | +void from_json(const json & j, TopLevel & x); | |
| 760 | +void to_json(json & j, const TopLevel & x); | |
| 761 | 761 | |
| 762 | - void from_json(const json & j, Domain & x); | |
| 763 | - void to_json(json & j, const Domain & x); | |
| 762 | +void from_json(const json & j, Domain & x); | |
| 763 | +void to_json(json & j, const Domain & x); | |
| 764 | 764 | |
| 765 | - void from_json(const json & j, PostHint & x); | |
| 766 | - void to_json(json & j, const PostHint & x); | |
| 765 | +void from_json(const json & j, PostHint & x); | |
| 766 | +void to_json(json & j, const PostHint & x); | |
| 767 | 767 | |
| 768 | - void from_json(const json & j, Subreddit & x); | |
| 769 | - void to_json(json & j, const Subreddit & x); | |
| 768 | +void from_json(const json & j, Subreddit & x); | |
| 769 | +void to_json(json & j, const Subreddit & x); | |
| 770 | 770 | |
| 771 | - void from_json(const json & j, SubredditId & x); | |
| 772 | - void to_json(json & j, const SubredditId & x); | |
| 771 | +void from_json(const json & j, SubredditId & x); | |
| 772 | +void to_json(json & j, const SubredditId & x); | |
| 773 | 773 | |
| 774 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 775 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 774 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 775 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 776 | 776 | |
| 777 | - void from_json(const json & j, SubredditType & x); | |
| 778 | - void to_json(json & j, const SubredditType & x); | |
| 779 | - | |
| 780 | - void from_json(const json & j, Kind & x); | |
| 781 | - void to_json(json & j, const Kind & x); | |
| 777 | +void from_json(const json & j, SubredditType & x); | |
| 778 | +void to_json(json & j, const SubredditType & x); | |
| 782 | 779 | |
| 780 | +void from_json(const json & j, Kind & x); | |
| 781 | +void to_json(json & j, const Kind & x); | |
| 782 | +} | |
| 783 | +namespace quicktype { | |
| 783 | 784 | inline void from_json(const json & j, Oembed& x) { |
| 784 | 785 | x.set_description(j.at("description").get<std::string>()); |
| 785 | 786 | x.set_height(j.at("height").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/c0356.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -95,15 +95,16 @@ namespace quicktype { | ||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | namespace quicktype { |
| 98 | - void from_json(const json & j, Datum & x); | |
| 99 | - void to_json(json & j, const Datum & x); | |
| 98 | +void from_json(const json & j, Datum & x); | |
| 99 | +void to_json(json & j, const Datum & x); | |
| 100 | 100 | |
| 101 | - void from_json(const json & j, Description & x); | |
| 102 | - void to_json(json & j, const Description & x); | |
| 103 | - | |
| 104 | - void from_json(const json & j, TopLevel & x); | |
| 105 | - void to_json(json & j, const TopLevel & x); | |
| 101 | +void from_json(const json & j, Description & x); | |
| 102 | +void to_json(json & j, const Description & x); | |
| 106 | 103 | |
| 104 | +void from_json(const json & j, TopLevel & x); | |
| 105 | +void to_json(json & j, const TopLevel & x); | |
| 106 | +} | |
| 107 | +namespace quicktype { | |
| 107 | 108 | inline void from_json(const json & j, Datum& x) { |
| 108 | 109 | x.set_anomaly(j.at("anomaly").get<std::string>()); |
| 109 | 110 | x.set_value(j.at("value").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/c0a3a.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/c3303.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -561,45 +561,46 @@ namespace quicktype { | ||
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | namespace quicktype { |
| 564 | - void from_json(const json & j, The480_WStill & x); | |
| 565 | - void to_json(json & j, const The480_WStill & x); | |
| 564 | +void from_json(const json & j, The480_WStill & x); | |
| 565 | +void to_json(json & j, const The480_WStill & x); | |
| 566 | 566 | |
| 567 | - void from_json(const json & j, DownsizedSmall & x); | |
| 568 | - void to_json(json & j, const DownsizedSmall & x); | |
| 567 | +void from_json(const json & j, DownsizedSmall & x); | |
| 568 | +void to_json(json & j, const DownsizedSmall & x); | |
| 569 | 569 | |
| 570 | - void from_json(const json & j, FixedHeight & x); | |
| 571 | - void to_json(json & j, const FixedHeight & x); | |
| 570 | +void from_json(const json & j, FixedHeight & x); | |
| 571 | +void to_json(json & j, const FixedHeight & x); | |
| 572 | 572 | |
| 573 | - void from_json(const json & j, Looping & x); | |
| 574 | - void to_json(json & j, const Looping & x); | |
| 573 | +void from_json(const json & j, Looping & x); | |
| 574 | +void to_json(json & j, const Looping & x); | |
| 575 | 575 | |
| 576 | - void from_json(const json & j, Images & x); | |
| 577 | - void to_json(json & j, const Images & x); | |
| 576 | +void from_json(const json & j, Images & x); | |
| 577 | +void to_json(json & j, const Images & x); | |
| 578 | 578 | |
| 579 | - void from_json(const json & j, User & x); | |
| 580 | - void to_json(json & j, const User & x); | |
| 579 | +void from_json(const json & j, User & x); | |
| 580 | +void to_json(json & j, const User & x); | |
| 581 | 581 | |
| 582 | - void from_json(const json & j, Datum & x); | |
| 583 | - void to_json(json & j, const Datum & x); | |
| 582 | +void from_json(const json & j, Datum & x); | |
| 583 | +void to_json(json & j, const Datum & x); | |
| 584 | 584 | |
| 585 | - void from_json(const json & j, Meta & x); | |
| 586 | - void to_json(json & j, const Meta & x); | |
| 585 | +void from_json(const json & j, Meta & x); | |
| 586 | +void to_json(json & j, const Meta & x); | |
| 587 | 587 | |
| 588 | - void from_json(const json & j, Pagination & x); | |
| 589 | - void to_json(json & j, const Pagination & x); | |
| 588 | +void from_json(const json & j, Pagination & x); | |
| 589 | +void to_json(json & j, const Pagination & x); | |
| 590 | 590 | |
| 591 | - void from_json(const json & j, TopLevel & x); | |
| 592 | - void to_json(json & j, const TopLevel & x); | |
| 591 | +void from_json(const json & j, TopLevel & x); | |
| 592 | +void to_json(json & j, const TopLevel & x); | |
| 593 | 593 | |
| 594 | - void from_json(const json & j, Rating & x); | |
| 595 | - void to_json(json & j, const Rating & x); | |
| 594 | +void from_json(const json & j, Rating & x); | |
| 595 | +void to_json(json & j, const Rating & x); | |
| 596 | 596 | |
| 597 | - void from_json(const json & j, Type & x); | |
| 598 | - void to_json(json & j, const Type & x); | |
| 599 | - | |
| 600 | - void from_json(const json & j, Username & x); | |
| 601 | - void to_json(json & j, const Username & x); | |
| 597 | +void from_json(const json & j, Type & x); | |
| 598 | +void to_json(json & j, const Type & x); | |
| 602 | 599 | |
| 600 | +void from_json(const json & j, Username & x); | |
| 601 | +void to_json(json & j, const Username & x); | |
| 602 | +} | |
| 603 | +namespace quicktype { | |
| 603 | 604 | inline void from_json(const json & j, The480_WStill& x) { |
| 604 | 605 | x.set_height(j.at("height").get<std::string>()); |
| 605 | 606 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +6 −5test/inputs/json/misc/c6cfd.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, Country & x); | |
| 70 | - void to_json(json & j, const Country & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, Country & x); | |
| 70 | +void to_json(json & j, const Country & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, Country& x) { |
| 76 | 77 | x.set_code(j.at("code").get<std::string>()); |
| 77 | 78 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/cb0cc.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -169,18 +169,19 @@ namespace quicktype { | ||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | namespace quicktype { |
| 172 | - void from_json(const json & j, Laureate & x); | |
| 173 | - void to_json(json & j, const Laureate & x); | |
| 172 | +void from_json(const json & j, Laureate & x); | |
| 173 | +void to_json(json & j, const Laureate & x); | |
| 174 | 174 | |
| 175 | - void from_json(const json & j, Prize & x); | |
| 176 | - void to_json(json & j, const Prize & x); | |
| 175 | +void from_json(const json & j, Prize & x); | |
| 176 | +void to_json(json & j, const Prize & x); | |
| 177 | 177 | |
| 178 | - void from_json(const json & j, TopLevel & x); | |
| 179 | - void to_json(json & j, const TopLevel & x); | |
| 180 | - | |
| 181 | - void from_json(const json & j, Category & x); | |
| 182 | - void to_json(json & j, const Category & x); | |
| 178 | +void from_json(const json & j, TopLevel & x); | |
| 179 | +void to_json(json & j, const TopLevel & x); | |
| 183 | 180 | |
| 181 | +void from_json(const json & j, Category & x); | |
| 182 | +void to_json(json & j, const Category & x); | |
| 183 | +} | |
| 184 | +namespace quicktype { | |
| 184 | 185 | inline void from_json(const json & j, Laureate& x) { |
| 185 | 186 | x.set_firstname(j.at("firstname").get<std::string>()); |
| 186 | 187 | x.set_id(j.at("id").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/cb81e.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -81,12 +81,13 @@ namespace quicktype { | ||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | namespace quicktype { |
| 84 | - void from_json(const json & j, Description & x); | |
| 85 | - void to_json(json & j, const Description & x); | |
| 86 | - | |
| 87 | - void from_json(const json & j, TopLevel & x); | |
| 88 | - void to_json(json & j, const TopLevel & x); | |
| 84 | +void from_json(const json & j, Description & x); | |
| 85 | +void to_json(json & j, const Description & x); | |
| 89 | 86 | |
| 87 | +void from_json(const json & j, TopLevel & x); | |
| 88 | +void to_json(json & j, const TopLevel & x); | |
| 89 | +} | |
| 90 | +namespace quicktype { | |
| 90 | 91 | inline void from_json(const json & j, Description& x) { |
| 91 | 92 | x.set_base_period(j.at("base_period").get<std::string>()); |
| 92 | 93 | x.set_missing(j.at("missing").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/ccd18.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/misc/cd238.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -194,18 +194,19 @@ namespace quicktype { | ||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | namespace quicktype { |
| 197 | - void from_json(const json & j, Status & x); | |
| 198 | - void to_json(json & j, const Status & x); | |
| 197 | +void from_json(const json & j, Status & x); | |
| 198 | +void to_json(json & j, const Status & x); | |
| 199 | 199 | |
| 200 | - void from_json(const json & j, Meta & x); | |
| 201 | - void to_json(json & j, const Meta & x); | |
| 200 | +void from_json(const json & j, Meta & x); | |
| 201 | +void to_json(json & j, const Meta & x); | |
| 202 | 202 | |
| 203 | - void from_json(const json & j, Weather & x); | |
| 204 | - void to_json(json & j, const Weather & x); | |
| 205 | - | |
| 206 | - void from_json(const json & j, TopLevel & x); | |
| 207 | - void to_json(json & j, const TopLevel & x); | |
| 203 | +void from_json(const json & j, Weather & x); | |
| 204 | +void to_json(json & j, const Weather & x); | |
| 208 | 205 | |
| 206 | +void from_json(const json & j, TopLevel & x); | |
| 207 | +void to_json(json & j, const TopLevel & x); | |
| 208 | +} | |
| 209 | +namespace quicktype { | |
| 209 | 210 | inline void from_json(const json & j, Status& x) { |
| 210 | 211 | x.set_avg_delay(j.at("avgDelay").get<std::string>()); |
| 211 | 212 | x.set_closure_begin(j.at("closureBegin").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/cd463.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/cf0d8.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/cfbce.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_base(j.at("base").get<std::string>()); |
| 65 | 66 | x.set_date(j.at("date").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/d0908.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, TotalPopulation & x); | |
| 70 | - void to_json(json & j, const TotalPopulation & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, TotalPopulation & x); | |
| 70 | +void to_json(json & j, const TotalPopulation & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TotalPopulation& x) { |
| 76 | 77 | x.set_date(j.at("date").get<std::string>()); |
| 77 | 78 | x.set_population(j.at("population").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/d23d5.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -181,15 +181,16 @@ namespace quicktype { | ||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | namespace quicktype { |
| 184 | - void from_json(const json & j, Facets & x); | |
| 185 | - void to_json(json & j, const Facets & x); | |
| 184 | +void from_json(const json & j, Facets & x); | |
| 185 | +void to_json(json & j, const Facets & x); | |
| 186 | 186 | |
| 187 | - void from_json(const json & j, Result & x); | |
| 188 | - void to_json(json & j, const Result & x); | |
| 189 | - | |
| 190 | - void from_json(const json & j, TopLevel & x); | |
| 191 | - void to_json(json & j, const TopLevel & x); | |
| 187 | +void from_json(const json & j, Result & x); | |
| 188 | +void to_json(json & j, const Result & x); | |
| 192 | 189 | |
| 190 | +void from_json(const json & j, TopLevel & x); | |
| 191 | +void to_json(json & j, const TopLevel & x); | |
| 192 | +} | |
| 193 | +namespace quicktype { | |
| 193 | 194 | inline void from_json(const json & j, Facets& x) { |
| 194 | 195 | (void)j; |
| 195 | 196 | (void)x; |
Test case
1 generated file · +32 −31test/inputs/json/misc/dbfb3.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -461,51 +461,52 @@ namespace quicktype { | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | namespace quicktype { |
| 464 | - void from_json(const json & j, Astronomy & x); | |
| 465 | - void to_json(json & j, const Astronomy & x); | |
| 464 | +void from_json(const json & j, Astronomy & x); | |
| 465 | +void to_json(json & j, const Astronomy & x); | |
| 466 | 466 | |
| 467 | - void from_json(const json & j, Atmosphere & x); | |
| 468 | - void to_json(json & j, const Atmosphere & x); | |
| 467 | +void from_json(const json & j, Atmosphere & x); | |
| 468 | +void to_json(json & j, const Atmosphere & x); | |
| 469 | 469 | |
| 470 | - void from_json(const json & j, Image & x); | |
| 471 | - void to_json(json & j, const Image & x); | |
| 470 | +void from_json(const json & j, Image & x); | |
| 471 | +void to_json(json & j, const Image & x); | |
| 472 | 472 | |
| 473 | - void from_json(const json & j, Condition & x); | |
| 474 | - void to_json(json & j, const Condition & x); | |
| 473 | +void from_json(const json & j, Condition & x); | |
| 474 | +void to_json(json & j, const Condition & x); | |
| 475 | 475 | |
| 476 | - void from_json(const json & j, Forecast & x); | |
| 477 | - void to_json(json & j, const Forecast & x); | |
| 476 | +void from_json(const json & j, Forecast & x); | |
| 477 | +void to_json(json & j, const Forecast & x); | |
| 478 | 478 | |
| 479 | - void from_json(const json & j, Guid & x); | |
| 480 | - void to_json(json & j, const Guid & x); | |
| 479 | +void from_json(const json & j, Guid & x); | |
| 480 | +void to_json(json & j, const Guid & x); | |
| 481 | 481 | |
| 482 | - void from_json(const json & j, Item & x); | |
| 483 | - void to_json(json & j, const Item & x); | |
| 482 | +void from_json(const json & j, Item & x); | |
| 483 | +void to_json(json & j, const Item & x); | |
| 484 | 484 | |
| 485 | - void from_json(const json & j, Location & x); | |
| 486 | - void to_json(json & j, const Location & x); | |
| 485 | +void from_json(const json & j, Location & x); | |
| 486 | +void to_json(json & j, const Location & x); | |
| 487 | 487 | |
| 488 | - void from_json(const json & j, Units & x); | |
| 489 | - void to_json(json & j, const Units & x); | |
| 488 | +void from_json(const json & j, Units & x); | |
| 489 | +void to_json(json & j, const Units & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, Wind & x); | |
| 492 | - void to_json(json & j, const Wind & x); | |
| 491 | +void from_json(const json & j, Wind & x); | |
| 492 | +void to_json(json & j, const Wind & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Channel & x); | |
| 495 | - void to_json(json & j, const Channel & x); | |
| 494 | +void from_json(const json & j, Channel & x); | |
| 495 | +void to_json(json & j, const Channel & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, Results & x); | |
| 498 | - void to_json(json & j, const Results & x); | |
| 497 | +void from_json(const json & j, Results & x); | |
| 498 | +void to_json(json & j, const Results & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, Query & x); | |
| 501 | - void to_json(json & j, const Query & x); | |
| 500 | +void from_json(const json & j, Query & x); | |
| 501 | +void to_json(json & j, const Query & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, TopLevel & x); | |
| 504 | - void to_json(json & j, const TopLevel & x); | |
| 505 | - | |
| 506 | - void from_json(const json & j, Text & x); | |
| 507 | - void to_json(json & j, const Text & x); | |
| 503 | +void from_json(const json & j, TopLevel & x); | |
| 504 | +void to_json(json & j, const TopLevel & x); | |
| 508 | 505 | |
| 506 | +void from_json(const json & j, Text & x); | |
| 507 | +void to_json(json & j, const Text & x); | |
| 508 | +} | |
| 509 | +namespace quicktype { | |
| 509 | 510 | inline void from_json(const json & j, Astronomy& x) { |
| 510 | 511 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 511 | 512 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/dc44f.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -355,45 +355,46 @@ namespace quicktype { | ||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | namespace quicktype { |
| 358 | - void from_json(const json & j, LegalityElement & x); | |
| 359 | - void to_json(json & j, const LegalityElement & x); | |
| 358 | +void from_json(const json & j, LegalityElement & x); | |
| 359 | +void to_json(json & j, const LegalityElement & x); | |
| 360 | 360 | |
| 361 | - void from_json(const json & j, Ruling & x); | |
| 362 | - void to_json(json & j, const Ruling & x); | |
| 361 | +void from_json(const json & j, Ruling & x); | |
| 362 | +void to_json(json & j, const Ruling & x); | |
| 363 | 363 | |
| 364 | - void from_json(const json & j, Card & x); | |
| 365 | - void to_json(json & j, const Card & x); | |
| 364 | +void from_json(const json & j, Card & x); | |
| 365 | +void to_json(json & j, const Card & x); | |
| 366 | 366 | |
| 367 | - void from_json(const json & j, TopLevel & x); | |
| 368 | - void to_json(json & j, const TopLevel & x); | |
| 367 | +void from_json(const json & j, TopLevel & x); | |
| 368 | +void to_json(json & j, const TopLevel & x); | |
| 369 | 369 | |
| 370 | - void from_json(const json & j, Booster & x); | |
| 371 | - void to_json(json & j, const Booster & x); | |
| 370 | +void from_json(const json & j, Booster & x); | |
| 371 | +void to_json(json & j, const Booster & x); | |
| 372 | 372 | |
| 373 | - void from_json(const json & j, ColorIdentity & x); | |
| 374 | - void to_json(json & j, const ColorIdentity & x); | |
| 373 | +void from_json(const json & j, ColorIdentity & x); | |
| 374 | +void to_json(json & j, const ColorIdentity & x); | |
| 375 | 375 | |
| 376 | - void from_json(const json & j, Color & x); | |
| 377 | - void to_json(json & j, const Color & x); | |
| 376 | +void from_json(const json & j, Color & x); | |
| 377 | +void to_json(json & j, const Color & x); | |
| 378 | 378 | |
| 379 | - void from_json(const json & j, Layout & x); | |
| 380 | - void to_json(json & j, const Layout & x); | |
| 379 | +void from_json(const json & j, Layout & x); | |
| 380 | +void to_json(json & j, const Layout & x); | |
| 381 | 381 | |
| 382 | - void from_json(const json & j, Format & x); | |
| 383 | - void to_json(json & j, const Format & x); | |
| 382 | +void from_json(const json & j, Format & x); | |
| 383 | +void to_json(json & j, const Format & x); | |
| 384 | 384 | |
| 385 | - void from_json(const json & j, LegalityEnum & x); | |
| 386 | - void to_json(json & j, const LegalityEnum & x); | |
| 385 | +void from_json(const json & j, LegalityEnum & x); | |
| 386 | +void to_json(json & j, const LegalityEnum & x); | |
| 387 | 387 | |
| 388 | - void from_json(const json & j, Rarity & x); | |
| 389 | - void to_json(json & j, const Rarity & x); | |
| 388 | +void from_json(const json & j, Rarity & x); | |
| 389 | +void to_json(json & j, const Rarity & x); | |
| 390 | 390 | |
| 391 | - void from_json(const json & j, Supertype & x); | |
| 392 | - void to_json(json & j, const Supertype & x); | |
| 393 | - | |
| 394 | - void from_json(const json & j, Type & x); | |
| 395 | - void to_json(json & j, const Type & x); | |
| 391 | +void from_json(const json & j, Supertype & x); | |
| 392 | +void to_json(json & j, const Supertype & x); | |
| 396 | 393 | |
| 394 | +void from_json(const json & j, Type & x); | |
| 395 | +void to_json(json & j, const Type & x); | |
| 396 | +} | |
| 397 | +namespace quicktype { | |
| 397 | 398 | inline void from_json(const json & j, LegalityElement& x) { |
| 398 | 399 | x.set_format(j.at("format").get<Format>()); |
| 399 | 400 | x.set_legality(j.at("legality").get<LegalityEnum>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/dd1ce.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -355,45 +355,46 @@ namespace quicktype { | ||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | namespace quicktype { |
| 358 | - void from_json(const json & j, LegalityElement & x); | |
| 359 | - void to_json(json & j, const LegalityElement & x); | |
| 358 | +void from_json(const json & j, LegalityElement & x); | |
| 359 | +void to_json(json & j, const LegalityElement & x); | |
| 360 | 360 | |
| 361 | - void from_json(const json & j, Ruling & x); | |
| 362 | - void to_json(json & j, const Ruling & x); | |
| 361 | +void from_json(const json & j, Ruling & x); | |
| 362 | +void to_json(json & j, const Ruling & x); | |
| 363 | 363 | |
| 364 | - void from_json(const json & j, Card & x); | |
| 365 | - void to_json(json & j, const Card & x); | |
| 364 | +void from_json(const json & j, Card & x); | |
| 365 | +void to_json(json & j, const Card & x); | |
| 366 | 366 | |
| 367 | - void from_json(const json & j, TopLevel & x); | |
| 368 | - void to_json(json & j, const TopLevel & x); | |
| 367 | +void from_json(const json & j, TopLevel & x); | |
| 368 | +void to_json(json & j, const TopLevel & x); | |
| 369 | 369 | |
| 370 | - void from_json(const json & j, Booster & x); | |
| 371 | - void to_json(json & j, const Booster & x); | |
| 370 | +void from_json(const json & j, Booster & x); | |
| 371 | +void to_json(json & j, const Booster & x); | |
| 372 | 372 | |
| 373 | - void from_json(const json & j, ColorIdentity & x); | |
| 374 | - void to_json(json & j, const ColorIdentity & x); | |
| 373 | +void from_json(const json & j, ColorIdentity & x); | |
| 374 | +void to_json(json & j, const ColorIdentity & x); | |
| 375 | 375 | |
| 376 | - void from_json(const json & j, Color & x); | |
| 377 | - void to_json(json & j, const Color & x); | |
| 376 | +void from_json(const json & j, Color & x); | |
| 377 | +void to_json(json & j, const Color & x); | |
| 378 | 378 | |
| 379 | - void from_json(const json & j, Layout & x); | |
| 380 | - void to_json(json & j, const Layout & x); | |
| 379 | +void from_json(const json & j, Layout & x); | |
| 380 | +void to_json(json & j, const Layout & x); | |
| 381 | 381 | |
| 382 | - void from_json(const json & j, Format & x); | |
| 383 | - void to_json(json & j, const Format & x); | |
| 382 | +void from_json(const json & j, Format & x); | |
| 383 | +void to_json(json & j, const Format & x); | |
| 384 | 384 | |
| 385 | - void from_json(const json & j, LegalityEnum & x); | |
| 386 | - void to_json(json & j, const LegalityEnum & x); | |
| 385 | +void from_json(const json & j, LegalityEnum & x); | |
| 386 | +void to_json(json & j, const LegalityEnum & x); | |
| 387 | 387 | |
| 388 | - void from_json(const json & j, Rarity & x); | |
| 389 | - void to_json(json & j, const Rarity & x); | |
| 388 | +void from_json(const json & j, Rarity & x); | |
| 389 | +void to_json(json & j, const Rarity & x); | |
| 390 | 390 | |
| 391 | - void from_json(const json & j, Supertype & x); | |
| 392 | - void to_json(json & j, const Supertype & x); | |
| 393 | - | |
| 394 | - void from_json(const json & j, Type & x); | |
| 395 | - void to_json(json & j, const Type & x); | |
| 391 | +void from_json(const json & j, Supertype & x); | |
| 392 | +void to_json(json & j, const Supertype & x); | |
| 396 | 393 | |
| 394 | +void from_json(const json & j, Type & x); | |
| 395 | +void to_json(json & j, const Type & x); | |
| 396 | +} | |
| 397 | +namespace quicktype { | |
| 397 | 398 | inline void from_json(const json & j, LegalityElement& x) { |
| 398 | 399 | x.set_format(j.at("format").get<Format>()); |
| 399 | 400 | x.set_legality(j.at("legality").get<LegalityEnum>()); |
Test case
1 generated file · +16 −15test/inputs/json/misc/dec3a.json
Mcplusplusdefault / quicktype.hpp+16 −15
| @@ -316,27 +316,28 @@ namespace quicktype { | ||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | namespace quicktype { |
| 319 | - void from_json(const json & j, ResponseInfo & x); | |
| 320 | - void to_json(json & j, const ResponseInfo & x); | |
| 319 | +void from_json(const json & j, ResponseInfo & x); | |
| 320 | +void to_json(json & j, const ResponseInfo & x); | |
| 321 | 321 | |
| 322 | - void from_json(const json & j, Resultset & x); | |
| 323 | - void to_json(json & j, const Resultset & x); | |
| 322 | +void from_json(const json & j, Resultset & x); | |
| 323 | +void to_json(json & j, const Resultset & x); | |
| 324 | 324 | |
| 325 | - void from_json(const json & j, Metadata & x); | |
| 326 | - void to_json(json & j, const Metadata & x); | |
| 325 | +void from_json(const json & j, Metadata & x); | |
| 326 | +void to_json(json & j, const Metadata & x); | |
| 327 | 327 | |
| 328 | - void from_json(const json & j, HiringOrg & x); | |
| 329 | - void to_json(json & j, const HiringOrg & x); | |
| 328 | +void from_json(const json & j, HiringOrg & x); | |
| 329 | +void to_json(json & j, const HiringOrg & x); | |
| 330 | 330 | |
| 331 | - void from_json(const json & j, Location & x); | |
| 332 | - void to_json(json & j, const Location & x); | |
| 331 | +void from_json(const json & j, Location & x); | |
| 332 | +void to_json(json & j, const Location & x); | |
| 333 | 333 | |
| 334 | - void from_json(const json & j, Result & x); | |
| 335 | - void to_json(json & j, const Result & x); | |
| 336 | - | |
| 337 | - void from_json(const json & j, TopLevel & x); | |
| 338 | - void to_json(json & j, const TopLevel & x); | |
| 334 | +void from_json(const json & j, Result & x); | |
| 335 | +void to_json(json & j, const Result & x); | |
| 339 | 336 | |
| 337 | +void from_json(const json & j, TopLevel & x); | |
| 338 | +void to_json(json & j, const TopLevel & x); | |
| 339 | +} | |
| 340 | +namespace quicktype { | |
| 340 | 341 | inline void from_json(const json & j, ResponseInfo& x) { |
| 341 | 342 | x.set_developer_message(j.at("developerMessage").get<std::string>()); |
| 342 | 343 | x.set_status(j.at("status").get<int64_t>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/df957.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -459,48 +459,49 @@ namespace quicktype { | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | namespace quicktype { |
| 462 | - void from_json(const json & j, Astronomy & x); | |
| 463 | - void to_json(json & j, const Astronomy & x); | |
| 462 | +void from_json(const json & j, Astronomy & x); | |
| 463 | +void to_json(json & j, const Astronomy & x); | |
| 464 | 464 | |
| 465 | - void from_json(const json & j, Atmosphere & x); | |
| 466 | - void to_json(json & j, const Atmosphere & x); | |
| 465 | +void from_json(const json & j, Atmosphere & x); | |
| 466 | +void to_json(json & j, const Atmosphere & x); | |
| 467 | 467 | |
| 468 | - void from_json(const json & j, Image & x); | |
| 469 | - void to_json(json & j, const Image & x); | |
| 468 | +void from_json(const json & j, Image & x); | |
| 469 | +void to_json(json & j, const Image & x); | |
| 470 | 470 | |
| 471 | - void from_json(const json & j, Condition & x); | |
| 472 | - void to_json(json & j, const Condition & x); | |
| 471 | +void from_json(const json & j, Condition & x); | |
| 472 | +void to_json(json & j, const Condition & x); | |
| 473 | 473 | |
| 474 | - void from_json(const json & j, Forecast & x); | |
| 475 | - void to_json(json & j, const Forecast & x); | |
| 474 | +void from_json(const json & j, Forecast & x); | |
| 475 | +void to_json(json & j, const Forecast & x); | |
| 476 | 476 | |
| 477 | - void from_json(const json & j, Guid & x); | |
| 478 | - void to_json(json & j, const Guid & x); | |
| 477 | +void from_json(const json & j, Guid & x); | |
| 478 | +void to_json(json & j, const Guid & x); | |
| 479 | 479 | |
| 480 | - void from_json(const json & j, Item & x); | |
| 481 | - void to_json(json & j, const Item & x); | |
| 480 | +void from_json(const json & j, Item & x); | |
| 481 | +void to_json(json & j, const Item & x); | |
| 482 | 482 | |
| 483 | - void from_json(const json & j, Location & x); | |
| 484 | - void to_json(json & j, const Location & x); | |
| 483 | +void from_json(const json & j, Location & x); | |
| 484 | +void to_json(json & j, const Location & x); | |
| 485 | 485 | |
| 486 | - void from_json(const json & j, Units & x); | |
| 487 | - void to_json(json & j, const Units & x); | |
| 486 | +void from_json(const json & j, Units & x); | |
| 487 | +void to_json(json & j, const Units & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, Wind & x); | |
| 490 | - void to_json(json & j, const Wind & x); | |
| 489 | +void from_json(const json & j, Wind & x); | |
| 490 | +void to_json(json & j, const Wind & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Channel & x); | |
| 493 | - void to_json(json & j, const Channel & x); | |
| 492 | +void from_json(const json & j, Channel & x); | |
| 493 | +void to_json(json & j, const Channel & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, Results & x); | |
| 496 | - void to_json(json & j, const Results & x); | |
| 495 | +void from_json(const json & j, Results & x); | |
| 496 | +void to_json(json & j, const Results & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, Query & x); | |
| 499 | - void to_json(json & j, const Query & x); | |
| 500 | - | |
| 501 | - void from_json(const json & j, TopLevel & x); | |
| 502 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, Query & x); | |
| 499 | +void to_json(json & j, const Query & x); | |
| 503 | 500 | |
| 501 | +void from_json(const json & j, TopLevel & x); | |
| 502 | +void to_json(json & j, const TopLevel & x); | |
| 503 | +} | |
| 504 | +namespace quicktype { | |
| 504 | 505 | inline void from_json(const json & j, Astronomy& x) { |
| 505 | 506 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 506 | 507 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +26 −25test/inputs/json/misc/e0ac7.json
Mcplusplusdefault / quicktype.hpp+26 −25
| @@ -564,42 +564,43 @@ namespace quicktype { | ||
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | namespace quicktype { |
| 567 | - void from_json(const json & j, Downsized & x); | |
| 568 | - void to_json(json & j, const Downsized & x); | |
| 567 | +void from_json(const json & j, Downsized & x); | |
| 568 | +void to_json(json & j, const Downsized & x); | |
| 569 | 569 | |
| 570 | - void from_json(const json & j, DownsizedSmall & x); | |
| 571 | - void to_json(json & j, const DownsizedSmall & x); | |
| 570 | +void from_json(const json & j, DownsizedSmall & x); | |
| 571 | +void to_json(json & j, const DownsizedSmall & x); | |
| 572 | 572 | |
| 573 | - void from_json(const json & j, FixedHeight & x); | |
| 574 | - void to_json(json & j, const FixedHeight & x); | |
| 573 | +void from_json(const json & j, FixedHeight & x); | |
| 574 | +void to_json(json & j, const FixedHeight & x); | |
| 575 | 575 | |
| 576 | - void from_json(const json & j, Looping & x); | |
| 577 | - void to_json(json & j, const Looping & x); | |
| 576 | +void from_json(const json & j, Looping & x); | |
| 577 | +void to_json(json & j, const Looping & x); | |
| 578 | 578 | |
| 579 | - void from_json(const json & j, Images & x); | |
| 580 | - void to_json(json & j, const Images & x); | |
| 579 | +void from_json(const json & j, Images & x); | |
| 580 | +void to_json(json & j, const Images & x); | |
| 581 | 581 | |
| 582 | - void from_json(const json & j, User & x); | |
| 583 | - void to_json(json & j, const User & x); | |
| 582 | +void from_json(const json & j, User & x); | |
| 583 | +void to_json(json & j, const User & x); | |
| 584 | 584 | |
| 585 | - void from_json(const json & j, Datum & x); | |
| 586 | - void to_json(json & j, const Datum & x); | |
| 585 | +void from_json(const json & j, Datum & x); | |
| 586 | +void to_json(json & j, const Datum & x); | |
| 587 | 587 | |
| 588 | - void from_json(const json & j, Meta & x); | |
| 589 | - void to_json(json & j, const Meta & x); | |
| 588 | +void from_json(const json & j, Meta & x); | |
| 589 | +void to_json(json & j, const Meta & x); | |
| 590 | 590 | |
| 591 | - void from_json(const json & j, Pagination & x); | |
| 592 | - void to_json(json & j, const Pagination & x); | |
| 591 | +void from_json(const json & j, Pagination & x); | |
| 592 | +void to_json(json & j, const Pagination & x); | |
| 593 | 593 | |
| 594 | - void from_json(const json & j, TopLevel & x); | |
| 595 | - void to_json(json & j, const TopLevel & x); | |
| 594 | +void from_json(const json & j, TopLevel & x); | |
| 595 | +void to_json(json & j, const TopLevel & x); | |
| 596 | 596 | |
| 597 | - void from_json(const json & j, Rating & x); | |
| 598 | - void to_json(json & j, const Rating & x); | |
| 599 | - | |
| 600 | - void from_json(const json & j, Type & x); | |
| 601 | - void to_json(json & j, const Type & x); | |
| 597 | +void from_json(const json & j, Rating & x); | |
| 598 | +void to_json(json & j, const Rating & x); | |
| 602 | 599 | |
| 600 | +void from_json(const json & j, Type & x); | |
| 601 | +void to_json(json & j, const Type & x); | |
| 602 | +} | |
| 603 | +namespace quicktype { | |
| 603 | 604 | inline void from_json(const json & j, Downsized& x) { |
| 604 | 605 | x.set_height(j.at("height").get<std::string>()); |
| 605 | 606 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +32 −31test/inputs/json/misc/e2915.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -461,51 +461,52 @@ namespace quicktype { | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | namespace quicktype { |
| 464 | - void from_json(const json & j, Astronomy & x); | |
| 465 | - void to_json(json & j, const Astronomy & x); | |
| 464 | +void from_json(const json & j, Astronomy & x); | |
| 465 | +void to_json(json & j, const Astronomy & x); | |
| 466 | 466 | |
| 467 | - void from_json(const json & j, Atmosphere & x); | |
| 468 | - void to_json(json & j, const Atmosphere & x); | |
| 467 | +void from_json(const json & j, Atmosphere & x); | |
| 468 | +void to_json(json & j, const Atmosphere & x); | |
| 469 | 469 | |
| 470 | - void from_json(const json & j, Image & x); | |
| 471 | - void to_json(json & j, const Image & x); | |
| 470 | +void from_json(const json & j, Image & x); | |
| 471 | +void to_json(json & j, const Image & x); | |
| 472 | 472 | |
| 473 | - void from_json(const json & j, Condition & x); | |
| 474 | - void to_json(json & j, const Condition & x); | |
| 473 | +void from_json(const json & j, Condition & x); | |
| 474 | +void to_json(json & j, const Condition & x); | |
| 475 | 475 | |
| 476 | - void from_json(const json & j, Forecast & x); | |
| 477 | - void to_json(json & j, const Forecast & x); | |
| 476 | +void from_json(const json & j, Forecast & x); | |
| 477 | +void to_json(json & j, const Forecast & x); | |
| 478 | 478 | |
| 479 | - void from_json(const json & j, Guid & x); | |
| 480 | - void to_json(json & j, const Guid & x); | |
| 479 | +void from_json(const json & j, Guid & x); | |
| 480 | +void to_json(json & j, const Guid & x); | |
| 481 | 481 | |
| 482 | - void from_json(const json & j, Item & x); | |
| 483 | - void to_json(json & j, const Item & x); | |
| 482 | +void from_json(const json & j, Item & x); | |
| 483 | +void to_json(json & j, const Item & x); | |
| 484 | 484 | |
| 485 | - void from_json(const json & j, Location & x); | |
| 486 | - void to_json(json & j, const Location & x); | |
| 485 | +void from_json(const json & j, Location & x); | |
| 486 | +void to_json(json & j, const Location & x); | |
| 487 | 487 | |
| 488 | - void from_json(const json & j, Units & x); | |
| 489 | - void to_json(json & j, const Units & x); | |
| 488 | +void from_json(const json & j, Units & x); | |
| 489 | +void to_json(json & j, const Units & x); | |
| 490 | 490 | |
| 491 | - void from_json(const json & j, Wind & x); | |
| 492 | - void to_json(json & j, const Wind & x); | |
| 491 | +void from_json(const json & j, Wind & x); | |
| 492 | +void to_json(json & j, const Wind & x); | |
| 493 | 493 | |
| 494 | - void from_json(const json & j, Channel & x); | |
| 495 | - void to_json(json & j, const Channel & x); | |
| 494 | +void from_json(const json & j, Channel & x); | |
| 495 | +void to_json(json & j, const Channel & x); | |
| 496 | 496 | |
| 497 | - void from_json(const json & j, Results & x); | |
| 498 | - void to_json(json & j, const Results & x); | |
| 497 | +void from_json(const json & j, Results & x); | |
| 498 | +void to_json(json & j, const Results & x); | |
| 499 | 499 | |
| 500 | - void from_json(const json & j, Query & x); | |
| 501 | - void to_json(json & j, const Query & x); | |
| 500 | +void from_json(const json & j, Query & x); | |
| 501 | +void to_json(json & j, const Query & x); | |
| 502 | 502 | |
| 503 | - void from_json(const json & j, TopLevel & x); | |
| 504 | - void to_json(json & j, const TopLevel & x); | |
| 505 | - | |
| 506 | - void from_json(const json & j, Text & x); | |
| 507 | - void to_json(json & j, const Text & x); | |
| 503 | +void from_json(const json & j, TopLevel & x); | |
| 504 | +void to_json(json & j, const TopLevel & x); | |
| 508 | 505 | |
| 506 | +void from_json(const json & j, Text & x); | |
| 507 | +void to_json(json & j, const Text & x); | |
| 508 | +} | |
| 509 | +namespace quicktype { | |
| 509 | 510 | inline void from_json(const json & j, Astronomy& x) { |
| 510 | 511 | x.set_sunrise(j.at("sunrise").get<std::string>()); |
| 511 | 512 | x.set_sunset(j.at("sunset").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/e2a58.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -54,9 +54,10 @@ namespace quicktype { | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | namespace quicktype { |
| 57 | - void from_json(const json & j, TopLevelElement & x); | |
| 58 | - void to_json(json & j, const TopLevelElement & x); | |
| 59 | - | |
| 57 | +void from_json(const json & j, TopLevelElement & x); | |
| 58 | +void to_json(json & j, const TopLevelElement & x); | |
| 59 | +} | |
| 60 | +namespace quicktype { | |
| 60 | 61 | inline void from_json(const json & j, TopLevelElement& x) { |
| 61 | 62 | x.set_date(j.at("date").get<std::string>()); |
| 62 | 63 | x.set_stop_and_search(j.at("stop-and-search").get<std::vector<std::string>>()); |
Test case
1 generated file · +30 −29test/inputs/json/misc/e324e.json
Mcplusplusdefault / quicktype.hpp+30 −29
| @@ -322,48 +322,49 @@ namespace quicktype { | ||
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | namespace quicktype { |
| 325 | - void from_json(const json & j, Property & x); | |
| 326 | - void to_json(json & j, const Property & x); | |
| 325 | +void from_json(const json & j, Property & x); | |
| 326 | +void to_json(json & j, const Property & x); | |
| 327 | 327 | |
| 328 | - void from_json(const json & j, Rate & x); | |
| 329 | - void to_json(json & j, const Rate & x); | |
| 328 | +void from_json(const json & j, Rate & x); | |
| 329 | +void to_json(json & j, const Rate & x); | |
| 330 | 330 | |
| 331 | - void from_json(const json & j, Definitions & x); | |
| 332 | - void to_json(json & j, const Definitions & x); | |
| 331 | +void from_json(const json & j, Definitions & x); | |
| 332 | +void to_json(json & j, const Definitions & x); | |
| 333 | 333 | |
| 334 | - void from_json(const json & j, Info & x); | |
| 335 | - void to_json(json & j, const Info & x); | |
| 334 | +void from_json(const json & j, Info & x); | |
| 335 | +void to_json(json & j, const Info & x); | |
| 336 | 336 | |
| 337 | - void from_json(const json & j, Parameter & x); | |
| 338 | - void to_json(json & j, const Parameter & x); | |
| 337 | +void from_json(const json & j, Parameter & x); | |
| 338 | +void to_json(json & j, const Parameter & x); | |
| 339 | 339 | |
| 340 | - void from_json(const json & j, Items & x); | |
| 341 | - void to_json(json & j, const Items & x); | |
| 340 | +void from_json(const json & j, Items & x); | |
| 341 | +void to_json(json & j, const Items & x); | |
| 342 | 342 | |
| 343 | - void from_json(const json & j, Schema & x); | |
| 344 | - void to_json(json & j, const Schema & x); | |
| 343 | +void from_json(const json & j, Schema & x); | |
| 344 | +void to_json(json & j, const Schema & x); | |
| 345 | 345 | |
| 346 | - void from_json(const json & j, The200 & x); | |
| 347 | - void to_json(json & j, const The200 & x); | |
| 346 | +void from_json(const json & j, The200 & x); | |
| 347 | +void to_json(json & j, const The200 & x); | |
| 348 | 348 | |
| 349 | - void from_json(const json & j, Responses & x); | |
| 350 | - void to_json(json & j, const Responses & x); | |
| 349 | +void from_json(const json & j, Responses & x); | |
| 350 | +void to_json(json & j, const Responses & x); | |
| 351 | 351 | |
| 352 | - void from_json(const json & j, Get & x); | |
| 353 | - void to_json(json & j, const Get & x); | |
| 352 | +void from_json(const json & j, Get & x); | |
| 353 | +void to_json(json & j, const Get & x); | |
| 354 | 354 | |
| 355 | - void from_json(const json & j, TariffRatesSearch & x); | |
| 356 | - void to_json(json & j, const TariffRatesSearch & x); | |
| 355 | +void from_json(const json & j, TariffRatesSearch & x); | |
| 356 | +void to_json(json & j, const TariffRatesSearch & x); | |
| 357 | 357 | |
| 358 | - void from_json(const json & j, Paths & x); | |
| 359 | - void to_json(json & j, const Paths & x); | |
| 358 | +void from_json(const json & j, Paths & x); | |
| 359 | +void to_json(json & j, const Paths & x); | |
| 360 | 360 | |
| 361 | - void from_json(const json & j, TopLevel & x); | |
| 362 | - void to_json(json & j, const TopLevel & x); | |
| 363 | - | |
| 364 | - void from_json(const json & j, Type & x); | |
| 365 | - void to_json(json & j, const Type & x); | |
| 361 | +void from_json(const json & j, TopLevel & x); | |
| 362 | +void to_json(json & j, const TopLevel & x); | |
| 366 | 363 | |
| 364 | +void from_json(const json & j, Type & x); | |
| 365 | +void to_json(json & j, const Type & x); | |
| 366 | +} | |
| 367 | +namespace quicktype { | |
| 367 | 368 | inline void from_json(const json & j, Property& x) { |
| 368 | 369 | x.set_description(j.at("description").get<std::string>()); |
| 369 | 370 | x.set_type(j.at("type").get<Type>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/e64a0.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -101,15 +101,16 @@ namespace quicktype { | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | namespace quicktype { |
| 104 | - void from_json(const json & j, Args & x); | |
| 105 | - void to_json(json & j, const Args & x); | |
| 104 | +void from_json(const json & j, Args & x); | |
| 105 | +void to_json(json & j, const Args & x); | |
| 106 | 106 | |
| 107 | - void from_json(const json & j, Headers & x); | |
| 108 | - void to_json(json & j, const Headers & x); | |
| 109 | - | |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 107 | +void from_json(const json & j, Headers & x); | |
| 108 | +void to_json(json & j, const Headers & x); | |
| 112 | 109 | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, Args& x) { |
| 114 | 115 | (void)j; |
| 115 | 116 | (void)x; |
Test case
1 generated file · +6 −5test/inputs/json/misc/e8a0b.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +94 −93test/inputs/json/misc/e8b04.json
Mcplusplusdefault / quicktype.hpp+94 −93
| @@ -945,144 +945,145 @@ namespace quicktype { | ||
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | namespace quicktype { |
| 948 | - void from_json(const json & j, Grant & x); | |
| 949 | - void to_json(json & j, const Grant & x); | |
| 948 | +void from_json(const json & j, Grant & x); | |
| 949 | +void to_json(json & j, const Grant & x); | |
| 950 | 950 | |
| 951 | - void from_json(const json & j, Test & x); | |
| 952 | - void to_json(json & j, const Test & x); | |
| 951 | +void from_json(const json & j, Test & x); | |
| 952 | +void to_json(json & j, const Test & x); | |
| 953 | 953 | |
| 954 | - void from_json(const json & j, CustomFields & x); | |
| 955 | - void to_json(json & j, const CustomFields & x); | |
| 954 | +void from_json(const json & j, CustomFields & x); | |
| 955 | +void to_json(json & j, const CustomFields & x); | |
| 956 | 956 | |
| 957 | - void from_json(const json & j, Group & x); | |
| 958 | - void to_json(json & j, const Group & x); | |
| 957 | +void from_json(const json & j, Group & x); | |
| 958 | +void to_json(json & j, const Group & x); | |
| 959 | 959 | |
| 960 | - void from_json(const json & j, Order & x); | |
| 961 | - void to_json(json & j, const Order & x); | |
| 960 | +void from_json(const json & j, Order & x); | |
| 961 | +void to_json(json & j, const Order & x); | |
| 962 | 962 | |
| 963 | - void from_json(const json & j, Select & x); | |
| 964 | - void to_json(json & j, const Select & x); | |
| 963 | +void from_json(const json & j, Select & x); | |
| 964 | +void to_json(json & j, const Select & x); | |
| 965 | 965 | |
| 966 | - void from_json(const json & j, TableColumnId & x); | |
| 967 | - void to_json(json & j, const TableColumnId & x); | |
| 966 | +void from_json(const json & j, TableColumnId & x); | |
| 967 | +void to_json(json & j, const TableColumnId & x); | |
| 968 | 968 | |
| 969 | - void from_json(const json & j, ChildMetadata & x); | |
| 970 | - void to_json(json & j, const ChildMetadata & x); | |
| 969 | +void from_json(const json & j, ChildMetadata & x); | |
| 970 | +void to_json(json & j, const ChildMetadata & x); | |
| 971 | 971 | |
| 972 | - void from_json(const json & j, Child & x); | |
| 973 | - void to_json(json & j, const Child & x); | |
| 972 | +void from_json(const json & j, Child & x); | |
| 973 | +void to_json(json & j, const Child & x); | |
| 974 | 974 | |
| 975 | - void from_json(const json & j, Where & x); | |
| 976 | - void to_json(json & j, const Where & x); | |
| 975 | +void from_json(const json & j, Where & x); | |
| 976 | +void to_json(json & j, const Where & x); | |
| 977 | 977 | |
| 978 | - void from_json(const json & j, JsonQuery & x); | |
| 979 | - void to_json(json & j, const JsonQuery & x); | |
| 978 | +void from_json(const json & j, JsonQuery & x); | |
| 979 | +void to_json(json & j, const JsonQuery & x); | |
| 980 | 980 | |
| 981 | - void from_json(const json & j, PurpleVisible & x); | |
| 982 | - void to_json(json & j, const PurpleVisible & x); | |
| 981 | +void from_json(const json & j, PurpleVisible & x); | |
| 982 | +void to_json(json & j, const PurpleVisible & x); | |
| 983 | 983 | |
| 984 | - void from_json(const json & j, MetadataRenderTypeConfig & x); | |
| 985 | - void to_json(json & j, const MetadataRenderTypeConfig & x); | |
| 984 | +void from_json(const json & j, MetadataRenderTypeConfig & x); | |
| 985 | +void to_json(json & j, const MetadataRenderTypeConfig & x); | |
| 986 | 986 | |
| 987 | - void from_json(const json & j, Field & x); | |
| 988 | - void to_json(json & j, const Field & x); | |
| 987 | +void from_json(const json & j, Field & x); | |
| 988 | +void to_json(json & j, const Field & x); | |
| 989 | 989 | |
| 990 | - void from_json(const json & j, Row & x); | |
| 991 | - void to_json(json & j, const Row & x); | |
| 990 | +void from_json(const json & j, Row & x); | |
| 991 | +void to_json(json & j, const Row & x); | |
| 992 | 992 | |
| 993 | - void from_json(const json & j, Styles & x); | |
| 994 | - void to_json(json & j, const Styles & x); | |
| 993 | +void from_json(const json & j, Styles & x); | |
| 994 | +void to_json(json & j, const Styles & x); | |
| 995 | 995 | |
| 996 | - void from_json(const json & j, Column & x); | |
| 997 | - void to_json(json & j, const Column & x); | |
| 996 | +void from_json(const json & j, Column & x); | |
| 997 | +void to_json(json & j, const Column & x); | |
| 998 | 998 | |
| 999 | - void from_json(const json & j, FatRow & x); | |
| 1000 | - void to_json(json & j, const FatRow & x); | |
| 999 | +void from_json(const json & j, FatRow & x); | |
| 1000 | +void to_json(json & j, const FatRow & x); | |
| 1001 | 1001 | |
| 1002 | - void from_json(const json & j, RichRendererConfigs & x); | |
| 1003 | - void to_json(json & j, const RichRendererConfigs & x); | |
| 1002 | +void from_json(const json & j, RichRendererConfigs & x); | |
| 1003 | +void to_json(json & j, const RichRendererConfigs & x); | |
| 1004 | 1004 | |
| 1005 | - void from_json(const json & j, AccessPoints & x); | |
| 1006 | - void to_json(json & j, const AccessPoints & x); | |
| 1005 | +void from_json(const json & j, AccessPoints & x); | |
| 1006 | +void to_json(json & j, const AccessPoints & x); | |
| 1007 | 1007 | |
| 1008 | - void from_json(const json & j, FluffyVisible & x); | |
| 1009 | - void to_json(json & j, const FluffyVisible & x); | |
| 1008 | +void from_json(const json & j, FluffyVisible & x); | |
| 1009 | +void to_json(json & j, const FluffyVisible & x); | |
| 1010 | 1010 | |
| 1011 | - void from_json(const json & j, V1ArchivedPropertiesRenderTypeConfig & x); | |
| 1012 | - void to_json(json & j, const V1ArchivedPropertiesRenderTypeConfig & x); | |
| 1011 | +void from_json(const json & j, V1ArchivedPropertiesRenderTypeConfig & x); | |
| 1012 | +void to_json(json & j, const V1ArchivedPropertiesRenderTypeConfig & x); | |
| 1013 | 1013 | |
| 1014 | - void from_json(const json & j, V1ArchivedProperties & x); | |
| 1015 | - void to_json(json & j, const V1ArchivedProperties & x); | |
| 1014 | +void from_json(const json & j, V1ArchivedProperties & x); | |
| 1015 | +void to_json(json & j, const V1ArchivedProperties & x); | |
| 1016 | 1016 | |
| 1017 | - void from_json(const json & j, TopLevelMetadata & x); | |
| 1018 | - void to_json(json & j, const TopLevelMetadata & x); | |
| 1017 | +void from_json(const json & j, TopLevelMetadata & x); | |
| 1018 | +void to_json(json & j, const TopLevelMetadata & x); | |
| 1019 | 1019 | |
| 1020 | - void from_json(const json & j, Owner & x); | |
| 1021 | - void to_json(json & j, const Owner & x); | |
| 1020 | +void from_json(const json & j, Owner & x); | |
| 1021 | +void to_json(json & j, const Owner & x); | |
| 1022 | 1022 | |
| 1023 | - void from_json(const json & j, Ratings & x); | |
| 1024 | - void to_json(json & j, const Ratings & x); | |
| 1023 | +void from_json(const json & j, Ratings & x); | |
| 1024 | +void to_json(json & j, const Ratings & x); | |
| 1025 | 1025 | |
| 1026 | - void from_json(const json & j, TableAuthor & x); | |
| 1027 | - void to_json(json & j, const TableAuthor & x); | |
| 1026 | +void from_json(const json & j, TableAuthor & x); | |
| 1027 | +void to_json(json & j, const TableAuthor & x); | |
| 1028 | 1028 | |
| 1029 | - void from_json(const json & j, TopLevelElement & x); | |
| 1030 | - void to_json(json & j, const TopLevelElement & x); | |
| 1029 | +void from_json(const json & j, TopLevelElement & x); | |
| 1030 | +void to_json(json & j, const TopLevelElement & x); | |
| 1031 | 1031 | |
| 1032 | - void from_json(const json & j, DisplayType & x); | |
| 1033 | - void to_json(json & j, const DisplayType & x); | |
| 1032 | +void from_json(const json & j, DisplayType & x); | |
| 1033 | +void to_json(json & j, const DisplayType & x); | |
| 1034 | 1034 | |
| 1035 | - void from_json(const json & j, TopLevelFlag & x); | |
| 1036 | - void to_json(json & j, const TopLevelFlag & x); | |
| 1035 | +void from_json(const json & j, TopLevelFlag & x); | |
| 1036 | +void to_json(json & j, const TopLevelFlag & x); | |
| 1037 | 1037 | |
| 1038 | - void from_json(const json & j, GrantFlag & x); | |
| 1039 | - void to_json(json & j, const GrantFlag & x); | |
| 1038 | +void from_json(const json & j, GrantFlag & x); | |
| 1039 | +void to_json(json & j, const GrantFlag & x); | |
| 1040 | 1040 | |
| 1041 | - void from_json(const json & j, GrantType & x); | |
| 1042 | - void to_json(json & j, const GrantType & x); | |
| 1041 | +void from_json(const json & j, GrantType & x); | |
| 1042 | +void to_json(json & j, const GrantType & x); | |
| 1043 | 1043 | |
| 1044 | - void from_json(const json & j, OrderColumnFieldName & x); | |
| 1045 | - void to_json(json & j, const OrderColumnFieldName & x); | |
| 1044 | +void from_json(const json & j, OrderColumnFieldName & x); | |
| 1045 | +void to_json(json & j, const OrderColumnFieldName & x); | |
| 1046 | 1046 | |
| 1047 | - void from_json(const json & j, ChildOperator & x); | |
| 1048 | - void to_json(json & j, const ChildOperator & x); | |
| 1047 | +void from_json(const json & j, ChildOperator & x); | |
| 1048 | +void to_json(json & j, const ChildOperator & x); | |
| 1049 | 1049 | |
| 1050 | - void from_json(const json & j, ChildColumnFieldName & x); | |
| 1051 | - void to_json(json & j, const ChildColumnFieldName & x); | |
| 1050 | +void from_json(const json & j, ChildColumnFieldName & x); | |
| 1051 | +void to_json(json & j, const ChildColumnFieldName & x); | |
| 1052 | 1052 | |
| 1053 | - void from_json(const json & j, MetadataOperator & x); | |
| 1054 | - void to_json(json & j, const MetadataOperator & x); | |
| 1053 | +void from_json(const json & j, MetadataOperator & x); | |
| 1054 | +void to_json(json & j, const MetadataOperator & x); | |
| 1055 | 1055 | |
| 1056 | - void from_json(const json & j, WhereOperator & x); | |
| 1057 | - void to_json(json & j, const WhereOperator & x); | |
| 1056 | +void from_json(const json & j, WhereOperator & x); | |
| 1057 | +void to_json(json & j, const WhereOperator & x); | |
| 1058 | 1058 | |
| 1059 | - void from_json(const json & j, FieldType & x); | |
| 1060 | - void to_json(json & j, const FieldType & x); | |
| 1059 | +void from_json(const json & j, FieldType & x); | |
| 1060 | +void to_json(json & j, const FieldType & x); | |
| 1061 | 1061 | |
| 1062 | - void from_json(const json & j, Width & x); | |
| 1063 | - void to_json(json & j, const Width & x); | |
| 1062 | +void from_json(const json & j, Width & x); | |
| 1063 | +void to_json(json & j, const Width & x); | |
| 1064 | 1064 | |
| 1065 | - void from_json(const json & j, ModifyingViewUid & x); | |
| 1066 | - void to_json(json & j, const ModifyingViewUid & x); | |
| 1065 | +void from_json(const json & j, ModifyingViewUid & x); | |
| 1066 | +void to_json(json & j, const ModifyingViewUid & x); | |
| 1067 | 1067 | |
| 1068 | - void from_json(const json & j, RoleName & x); | |
| 1069 | - void to_json(json & j, const RoleName & x); | |
| 1068 | +void from_json(const json & j, RoleName & x); | |
| 1069 | +void to_json(json & j, const RoleName & x); | |
| 1070 | 1070 | |
| 1071 | - void from_json(const json & j, Provenance & x); | |
| 1072 | - void to_json(json & j, const Provenance & x); | |
| 1071 | +void from_json(const json & j, Provenance & x); | |
| 1072 | +void to_json(json & j, const Provenance & x); | |
| 1073 | 1073 | |
| 1074 | - void from_json(const json & j, PublicationStage & x); | |
| 1075 | - void to_json(json & j, const PublicationStage & x); | |
| 1074 | +void from_json(const json & j, PublicationStage & x); | |
| 1075 | +void to_json(json & j, const PublicationStage & x); | |
| 1076 | 1076 | |
| 1077 | - void from_json(const json & j, Right & x); | |
| 1078 | - void to_json(json & j, const Right & x); | |
| 1077 | +void from_json(const json & j, Right & x); | |
| 1078 | +void to_json(json & j, const Right & x); | |
| 1079 | 1079 | |
| 1080 | - void from_json(const json & j, RowsUpdatedBy & x); | |
| 1081 | - void to_json(json & j, const RowsUpdatedBy & x); | |
| 1082 | - | |
| 1083 | - void from_json(const json & j, ViewType & x); | |
| 1084 | - void to_json(json & j, const ViewType & x); | |
| 1080 | +void from_json(const json & j, RowsUpdatedBy & x); | |
| 1081 | +void to_json(json & j, const RowsUpdatedBy & x); | |
| 1085 | 1082 | |
| 1083 | +void from_json(const json & j, ViewType & x); | |
| 1084 | +void to_json(json & j, const ViewType & x); | |
| 1085 | +} | |
| 1086 | +namespace quicktype { | |
| 1086 | 1087 | inline void from_json(const json & j, Grant& x) { |
| 1087 | 1088 | x.set_flags(j.at("flags").get<std::vector<GrantFlag>>()); |
| 1088 | 1089 | x.set_inherited(j.at("inherited").get<bool>()); |
Test case
1 generated file · +22 −21test/inputs/json/misc/f22f5.json
Mcplusplusdefault / quicktype.hpp+22 −21
| @@ -483,36 +483,37 @@ namespace quicktype { | ||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | namespace quicktype { |
| 486 | - void from_json(const json & j, MediaEmbed & x); | |
| 487 | - void to_json(json & j, const MediaEmbed & x); | |
| 486 | +void from_json(const json & j, MediaEmbed & x); | |
| 487 | +void to_json(json & j, const MediaEmbed & x); | |
| 488 | 488 | |
| 489 | - void from_json(const json & j, ChildData & x); | |
| 490 | - void to_json(json & j, const ChildData & x); | |
| 489 | +void from_json(const json & j, ChildData & x); | |
| 490 | +void to_json(json & j, const ChildData & x); | |
| 491 | 491 | |
| 492 | - void from_json(const json & j, Child & x); | |
| 493 | - void to_json(json & j, const Child & x); | |
| 492 | +void from_json(const json & j, Child & x); | |
| 493 | +void to_json(json & j, const Child & x); | |
| 494 | 494 | |
| 495 | - void from_json(const json & j, TopLevelData & x); | |
| 496 | - void to_json(json & j, const TopLevelData & x); | |
| 495 | +void from_json(const json & j, TopLevelData & x); | |
| 496 | +void to_json(json & j, const TopLevelData & x); | |
| 497 | 497 | |
| 498 | - void from_json(const json & j, TopLevel & x); | |
| 499 | - void to_json(json & j, const TopLevel & x); | |
| 498 | +void from_json(const json & j, TopLevel & x); | |
| 499 | +void to_json(json & j, const TopLevel & x); | |
| 500 | 500 | |
| 501 | - void from_json(const json & j, Subreddit & x); | |
| 502 | - void to_json(json & j, const Subreddit & x); | |
| 501 | +void from_json(const json & j, Subreddit & x); | |
| 502 | +void to_json(json & j, const Subreddit & x); | |
| 503 | 503 | |
| 504 | - void from_json(const json & j, SubredditId & x); | |
| 505 | - void to_json(json & j, const SubredditId & x); | |
| 504 | +void from_json(const json & j, SubredditId & x); | |
| 505 | +void to_json(json & j, const SubredditId & x); | |
| 506 | 506 | |
| 507 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 508 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 507 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 508 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 509 | 509 | |
| 510 | - void from_json(const json & j, SubredditType & x); | |
| 511 | - void to_json(json & j, const SubredditType & x); | |
| 512 | - | |
| 513 | - void from_json(const json & j, Kind & x); | |
| 514 | - void to_json(json & j, const Kind & x); | |
| 510 | +void from_json(const json & j, SubredditType & x); | |
| 511 | +void to_json(json & j, const SubredditType & x); | |
| 515 | 512 | |
| 513 | +void from_json(const json & j, Kind & x); | |
| 514 | +void to_json(json & j, const Kind & x); | |
| 515 | +} | |
| 516 | +namespace quicktype { | |
| 516 | 517 | inline void from_json(const json & j, MediaEmbed& x) { |
| 517 | 518 | (void)j; |
| 518 | 519 | (void)x; |
Test case
1 generated file · +4 −3test/inputs/json/misc/f3139.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -54,9 +54,10 @@ namespace quicktype { | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | namespace quicktype { |
| 57 | - void from_json(const json & j, TopLevelElement & x); | |
| 58 | - void to_json(json & j, const TopLevelElement & x); | |
| 59 | - | |
| 57 | +void from_json(const json & j, TopLevelElement & x); | |
| 58 | +void to_json(json & j, const TopLevelElement & x); | |
| 59 | +} | |
| 60 | +namespace quicktype { | |
| 60 | 61 | inline void from_json(const json & j, TopLevelElement& x) { |
| 61 | 62 | x.set_id(j.at("id").get<std::string>()); |
| 62 | 63 | x.set_name(j.at("name").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/f3edf.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/f466a.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -76,12 +76,13 @@ namespace quicktype { | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | namespace quicktype { |
| 79 | - void from_json(const json & j, TopLevelElement & x); | |
| 80 | - void to_json(json & j, const TopLevelElement & x); | |
| 81 | - | |
| 82 | - void from_json(const json & j, Country & x); | |
| 83 | - void to_json(json & j, const Country & x); | |
| 79 | +void from_json(const json & j, TopLevelElement & x); | |
| 80 | +void to_json(json & j, const TopLevelElement & x); | |
| 84 | 81 | |
| 82 | +void from_json(const json & j, Country & x); | |
| 83 | +void to_json(json & j, const Country & x); | |
| 84 | +} | |
| 85 | +namespace quicktype { | |
| 85 | 86 | inline void from_json(const json & j, TopLevelElement& x) { |
| 86 | 87 | x.set_age(j.at("age").get<int64_t>()); |
| 87 | 88 | x.set_country(j.at("country").get<Country>()); |
Test case
1 generated file · +28 −27test/inputs/json/misc/f6a65.json
Mcplusplusdefault / quicktype.hpp+28 −27
| @@ -566,45 +566,46 @@ namespace quicktype { | ||
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | namespace quicktype { |
| 569 | - void from_json(const json & j, The480_WStill & x); | |
| 570 | - void to_json(json & j, const The480_WStill & x); | |
| 569 | +void from_json(const json & j, The480_WStill & x); | |
| 570 | +void to_json(json & j, const The480_WStill & x); | |
| 571 | 571 | |
| 572 | - void from_json(const json & j, DownsizedSmall & x); | |
| 573 | - void to_json(json & j, const DownsizedSmall & x); | |
| 572 | +void from_json(const json & j, DownsizedSmall & x); | |
| 573 | +void to_json(json & j, const DownsizedSmall & x); | |
| 574 | 574 | |
| 575 | - void from_json(const json & j, FixedHeight & x); | |
| 576 | - void to_json(json & j, const FixedHeight & x); | |
| 575 | +void from_json(const json & j, FixedHeight & x); | |
| 576 | +void to_json(json & j, const FixedHeight & x); | |
| 577 | 577 | |
| 578 | - void from_json(const json & j, Looping & x); | |
| 579 | - void to_json(json & j, const Looping & x); | |
| 578 | +void from_json(const json & j, Looping & x); | |
| 579 | +void to_json(json & j, const Looping & x); | |
| 580 | 580 | |
| 581 | - void from_json(const json & j, Images & x); | |
| 582 | - void to_json(json & j, const Images & x); | |
| 581 | +void from_json(const json & j, Images & x); | |
| 582 | +void to_json(json & j, const Images & x); | |
| 583 | 583 | |
| 584 | - void from_json(const json & j, User & x); | |
| 585 | - void to_json(json & j, const User & x); | |
| 584 | +void from_json(const json & j, User & x); | |
| 585 | +void to_json(json & j, const User & x); | |
| 586 | 586 | |
| 587 | - void from_json(const json & j, Datum & x); | |
| 588 | - void to_json(json & j, const Datum & x); | |
| 587 | +void from_json(const json & j, Datum & x); | |
| 588 | +void to_json(json & j, const Datum & x); | |
| 589 | 589 | |
| 590 | - void from_json(const json & j, Meta & x); | |
| 591 | - void to_json(json & j, const Meta & x); | |
| 590 | +void from_json(const json & j, Meta & x); | |
| 591 | +void to_json(json & j, const Meta & x); | |
| 592 | 592 | |
| 593 | - void from_json(const json & j, Pagination & x); | |
| 594 | - void to_json(json & j, const Pagination & x); | |
| 593 | +void from_json(const json & j, Pagination & x); | |
| 594 | +void to_json(json & j, const Pagination & x); | |
| 595 | 595 | |
| 596 | - void from_json(const json & j, TopLevel & x); | |
| 597 | - void to_json(json & j, const TopLevel & x); | |
| 596 | +void from_json(const json & j, TopLevel & x); | |
| 597 | +void to_json(json & j, const TopLevel & x); | |
| 598 | 598 | |
| 599 | - void from_json(const json & j, Rating & x); | |
| 600 | - void to_json(json & j, const Rating & x); | |
| 599 | +void from_json(const json & j, Rating & x); | |
| 600 | +void to_json(json & j, const Rating & x); | |
| 601 | 601 | |
| 602 | - void from_json(const json & j, Type & x); | |
| 603 | - void to_json(json & j, const Type & x); | |
| 604 | - | |
| 605 | - void from_json(const json & j, Username & x); | |
| 606 | - void to_json(json & j, const Username & x); | |
| 602 | +void from_json(const json & j, Type & x); | |
| 603 | +void to_json(json & j, const Type & x); | |
| 607 | 604 | |
| 605 | +void from_json(const json & j, Username & x); | |
| 606 | +void to_json(json & j, const Username & x); | |
| 607 | +} | |
| 608 | +namespace quicktype { | |
| 608 | 609 | inline void from_json(const json & j, The480_WStill& x) { |
| 609 | 610 | x.set_height(j.at("height").get<std::string>()); |
| 610 | 611 | x.set_size(get_stack_optional<std::string>(j, "size")); |
Test case
1 generated file · +32 −31test/inputs/json/misc/f82d9.json
Mcplusplusdefault / quicktype.hpp+32 −31
| @@ -381,51 +381,52 @@ namespace quicktype { | ||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | namespace quicktype { |
| 384 | - void from_json(const json & j, ClickUrl & x); | |
| 385 | - void to_json(json & j, const ClickUrl & x); | |
| 384 | +void from_json(const json & j, ClickUrl & x); | |
| 385 | +void to_json(json & j, const ClickUrl & x); | |
| 386 | 386 | |
| 387 | - void from_json(const json & j, Properties & x); | |
| 388 | - void to_json(json & j, const Properties & x); | |
| 387 | +void from_json(const json & j, Properties & x); | |
| 388 | +void to_json(json & j, const Properties & x); | |
| 389 | 389 | |
| 390 | - void from_json(const json & j, Report & x); | |
| 391 | - void to_json(json & j, const Report & x); | |
| 390 | +void from_json(const json & j, Report & x); | |
| 391 | +void to_json(json & j, const Report & x); | |
| 392 | 392 | |
| 393 | - void from_json(const json & j, Definitions & x); | |
| 394 | - void to_json(json & j, const Definitions & x); | |
| 393 | +void from_json(const json & j, Definitions & x); | |
| 394 | +void to_json(json & j, const Definitions & x); | |
| 395 | 395 | |
| 396 | - void from_json(const json & j, Info & x); | |
| 397 | - void to_json(json & j, const Info & x); | |
| 396 | +void from_json(const json & j, Info & x); | |
| 397 | +void to_json(json & j, const Info & x); | |
| 398 | 398 | |
| 399 | - void from_json(const json & j, Parameter & x); | |
| 400 | - void to_json(json & j, const Parameter & x); | |
| 399 | +void from_json(const json & j, Parameter & x); | |
| 400 | +void to_json(json & j, const Parameter & x); | |
| 401 | 401 | |
| 402 | - void from_json(const json & j, Items & x); | |
| 403 | - void to_json(json & j, const Items & x); | |
| 402 | +void from_json(const json & j, Items & x); | |
| 403 | +void to_json(json & j, const Items & x); | |
| 404 | 404 | |
| 405 | - void from_json(const json & j, Schema & x); | |
| 406 | - void to_json(json & j, const Schema & x); | |
| 405 | +void from_json(const json & j, Schema & x); | |
| 406 | +void to_json(json & j, const Schema & x); | |
| 407 | 407 | |
| 408 | - void from_json(const json & j, The200 & x); | |
| 409 | - void to_json(json & j, const The200 & x); | |
| 408 | +void from_json(const json & j, The200 & x); | |
| 409 | +void to_json(json & j, const The200 & x); | |
| 410 | 410 | |
| 411 | - void from_json(const json & j, Responses & x); | |
| 412 | - void to_json(json & j, const Responses & x); | |
| 411 | +void from_json(const json & j, Responses & x); | |
| 412 | +void to_json(json & j, const Responses & x); | |
| 413 | 413 | |
| 414 | - void from_json(const json & j, Get & x); | |
| 415 | - void to_json(json & j, const Get & x); | |
| 414 | +void from_json(const json & j, Get & x); | |
| 415 | +void to_json(json & j, const Get & x); | |
| 416 | 416 | |
| 417 | - void from_json(const json & j, MarketResearchLibrarySearch & x); | |
| 418 | - void to_json(json & j, const MarketResearchLibrarySearch & x); | |
| 417 | +void from_json(const json & j, MarketResearchLibrarySearch & x); | |
| 418 | +void to_json(json & j, const MarketResearchLibrarySearch & x); | |
| 419 | 419 | |
| 420 | - void from_json(const json & j, Paths & x); | |
| 421 | - void to_json(json & j, const Paths & x); | |
| 420 | +void from_json(const json & j, Paths & x); | |
| 421 | +void to_json(json & j, const Paths & x); | |
| 422 | 422 | |
| 423 | - void from_json(const json & j, TopLevel & x); | |
| 424 | - void to_json(json & j, const TopLevel & x); | |
| 425 | - | |
| 426 | - void from_json(const json & j, Type & x); | |
| 427 | - void to_json(json & j, const Type & x); | |
| 423 | +void from_json(const json & j, TopLevel & x); | |
| 424 | +void to_json(json & j, const TopLevel & x); | |
| 428 | 425 | |
| 426 | +void from_json(const json & j, Type & x); | |
| 427 | +void to_json(json & j, const Type & x); | |
| 428 | +} | |
| 429 | +namespace quicktype { | |
| 429 | 430 | inline void from_json(const json & j, ClickUrl& x) { |
| 430 | 431 | x.set_description(j.at("description").get<std::string>()); |
| 431 | 432 | x.set_type(j.at("type").get<Type>()); |
Test case
1 generated file · +4 −3test/inputs/json/misc/f974d.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -67,9 +67,10 @@ namespace quicktype { | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | namespace quicktype { |
| 70 | - void from_json(const json & j, TopLevel & x); | |
| 71 | - void to_json(json & j, const TopLevel & x); | |
| 72 | - | |
| 70 | +void from_json(const json & j, TopLevel & x); | |
| 71 | +void to_json(json & j, const TopLevel & x); | |
| 72 | +} | |
| 73 | +namespace quicktype { | |
| 73 | 74 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 75 | x.set_block_index(j.at("block_index").get<int64_t>()); |
| 75 | 76 | x.set_hash(j.at("hash").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/misc/faff5.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, Response & x); | |
| 70 | - void to_json(json & j, const Response & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, Response & x); | |
| 70 | +void to_json(json & j, const Response & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, Response& x) { |
| 76 | 77 | x.set_player_count(j.at("player_count").get<int64_t>()); |
| 77 | 78 | x.set_result(j.at("result").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/json/misc/fd329.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -100,15 +100,16 @@ namespace quicktype { | ||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | namespace quicktype { |
| 103 | - void from_json(const json & j, Datum & x); | |
| 104 | - void to_json(json & j, const Datum & x); | |
| 103 | +void from_json(const json & j, Datum & x); | |
| 104 | +void to_json(json & j, const Datum & x); | |
| 105 | 105 | |
| 106 | - void from_json(const json & j, Description & x); | |
| 107 | - void to_json(json & j, const Description & x); | |
| 108 | - | |
| 109 | - void from_json(const json & j, TopLevel & x); | |
| 110 | - void to_json(json & j, const TopLevel & x); | |
| 106 | +void from_json(const json & j, Description & x); | |
| 107 | +void to_json(json & j, const Description & x); | |
| 111 | 108 | |
| 109 | +void from_json(const json & j, TopLevel & x); | |
| 110 | +void to_json(json & j, const TopLevel & x); | |
| 111 | +} | |
| 112 | +namespace quicktype { | |
| 112 | 113 | inline void from_json(const json & j, Datum& x) { |
| 113 | 114 | x.set_anomaly(j.at("anomaly").get<std::string>()); |
| 114 | 115 | x.set_value(j.at("value").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/priority/blns-object.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -3004,18 +3004,19 @@ namespace quicktype { | ||
| 3004 | 3004 | } |
| 3005 | 3005 | |
| 3006 | 3006 | namespace quicktype { |
| 3007 | - void from_json(const json & j, A & x); | |
| 3008 | - void to_json(json & j, const A & x); | |
| 3007 | +void from_json(const json & j, A & x); | |
| 3008 | +void to_json(json & j, const A & x); | |
| 3009 | 3009 | |
| 3010 | - void from_json(const json & j, B & x); | |
| 3011 | - void to_json(json & j, const B & x); | |
| 3010 | +void from_json(const json & j, B & x); | |
| 3011 | +void to_json(json & j, const B & x); | |
| 3012 | 3012 | |
| 3013 | - void from_json(const json & j, C & x); | |
| 3014 | - void to_json(json & j, const C & x); | |
| 3015 | - | |
| 3016 | - void from_json(const json & j, TopLevel & x); | |
| 3017 | - void to_json(json & j, const TopLevel & x); | |
| 3013 | +void from_json(const json & j, C & x); | |
| 3014 | +void to_json(json & j, const C & x); | |
| 3018 | 3015 | |
| 3016 | +void from_json(const json & j, TopLevel & x); | |
| 3017 | +void to_json(json & j, const TopLevel & x); | |
| 3018 | +} | |
| 3019 | +namespace quicktype { | |
| 3019 | 3020 | inline void from_json(const json & j, A& x) { |
| 3020 | 3021 | x.set_12(j.at("パーティーへ行かないか").get<std::string>()); |
| 3021 | 3022 | x.set_13(j.at("和製漢語").get<std::string>()); |
Test case
1 generated file · +10 −9test/inputs/json/priority/bug2037.json
Mcplusplusdefault / quicktype.hpp+10 −9
| @@ -85,18 +85,19 @@ namespace quicktype { | ||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | namespace quicktype { |
| 88 | - void from_json(const json & j, Reward & x); | |
| 89 | - void to_json(json & j, const Reward & x); | |
| 88 | +void from_json(const json & j, Reward & x); | |
| 89 | +void to_json(json & j, const Reward & x); | |
| 90 | 90 | |
| 91 | - void from_json(const json & j, Objective & x); | |
| 92 | - void to_json(json & j, const Objective & x); | |
| 91 | +void from_json(const json & j, Objective & x); | |
| 92 | +void to_json(json & j, const Objective & x); | |
| 93 | 93 | |
| 94 | - void from_json(const json & j, MissionSpec & x); | |
| 95 | - void to_json(json & j, const MissionSpec & x); | |
| 96 | - | |
| 97 | - void from_json(const json & j, TopLevel & x); | |
| 98 | - void to_json(json & j, const TopLevel & x); | |
| 94 | +void from_json(const json & j, MissionSpec & x); | |
| 95 | +void to_json(json & j, const MissionSpec & x); | |
| 99 | 96 | |
| 97 | +void from_json(const json & j, TopLevel & x); | |
| 98 | +void to_json(json & j, const TopLevel & x); | |
| 99 | +} | |
| 100 | +namespace quicktype { | |
| 100 | 101 | inline void from_json(const json & j, Reward& x) { |
| 101 | 102 | (void)j; |
| 102 | 103 | (void)x; |
Test case
2 generated files · +12 −10test/inputs/json/priority/bug2521.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -123,12 +123,13 @@ namespace quicktype { | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | namespace quicktype { |
| 126 | - void from_json(const json & j, Option & x); | |
| 127 | - void to_json(json & j, const Option & x); | |
| 128 | - | |
| 129 | - void from_json(const json & j, TopLevel & x); | |
| 130 | - void to_json(json & j, const TopLevel & x); | |
| 126 | +void from_json(const json & j, Option & x); | |
| 127 | +void to_json(json & j, const Option & x); | |
| 131 | 128 | |
| 129 | +void from_json(const json & j, TopLevel & x); | |
| 130 | +void to_json(json & j, const TopLevel & x); | |
| 131 | +} | |
| 132 | +namespace quicktype { | |
| 132 | 133 | inline void from_json(const json & j, Option& x) { |
| 133 | 134 | x.set_foo(get_stack_optional<std::string>(j, "foo")); |
| 134 | 135 | x.set_name(j.at("name").get<std::string>()); |
Mcpluspluswstring-use-wstring--3909ec5a1524 / quicktype.hpp+6 −5
| @@ -193,12 +193,13 @@ namespace quicktype { | ||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | namespace quicktype { |
| 196 | - void from_json(const json & j, Option & x); | |
| 197 | - void to_json(json & j, const Option & x); | |
| 198 | - | |
| 199 | - void from_json(const json & j, TopLevel & x); | |
| 200 | - void to_json(json & j, const TopLevel & x); | |
| 196 | +void from_json(const json & j, Option & x); | |
| 197 | +void to_json(json & j, const Option & x); | |
| 201 | 198 | |
| 199 | +void from_json(const json & j, TopLevel & x); | |
| 200 | +void to_json(json & j, const TopLevel & x); | |
| 201 | +} | |
| 202 | +namespace quicktype { | |
| 202 | 203 | inline void from_json(const json & j, Option& x) { |
| 203 | 204 | x.set_foo(Utf16_Utf8<std::optional<std::string>, std::optional<std::wstring>>::convert(get_stack_optional<std::string>(j, Utf16_Utf8<std::wstring, std::string>::convert(L"foo")))); |
| 204 | 205 | x.set_name(Utf16_Utf8<std::string, std::wstring>::convert(j.at(Utf16_Utf8<std::wstring, std::string>::convert(L"name")).get<std::string>())); |
Test case
1 generated file · +6 −5test/inputs/json/priority/bug2590.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -125,12 +125,13 @@ namespace quicktype { | ||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | namespace quicktype { |
| 128 | - void from_json(const json & j, Invoice & x); | |
| 129 | - void to_json(json & j, const Invoice & x); | |
| 130 | - | |
| 131 | - void from_json(const json & j, TopLevel & x); | |
| 132 | - void to_json(json & j, const TopLevel & x); | |
| 128 | +void from_json(const json & j, Invoice & x); | |
| 129 | +void to_json(json & j, const Invoice & x); | |
| 133 | 130 | |
| 131 | +void from_json(const json & j, TopLevel & x); | |
| 132 | +void to_json(json & j, const TopLevel & x); | |
| 133 | +} | |
| 134 | +namespace quicktype { | |
| 134 | 135 | inline void from_json(const json & j, Invoice& x) { |
| 135 | 136 | x.set_created_at(get_stack_optional<std::string>(j, "createdAt")); |
| 136 | 137 | x.set_due_date(get_stack_optional<std::string>(j, "dueDate")); |
Test case
1 generated file · +4 −3test/inputs/json/priority/bug2663.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_birthday(j.at("birthday").get<std::string>()); |
| 65 | 66 | x.set_last_seen(j.at("lastSeen").get<std::string>()); |
Test case
1 generated file · +8 −7test/inputs/json/priority/bug2793.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -81,15 +81,16 @@ namespace quicktype { | ||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | namespace quicktype { |
| 84 | - void from_json(const json & j, Hints & x); | |
| 85 | - void to_json(json & j, const Hints & x); | |
| 84 | +void from_json(const json & j, Hints & x); | |
| 85 | +void to_json(json & j, const Hints & x); | |
| 86 | 86 | |
| 87 | - void from_json(const json & j, Labels & x); | |
| 88 | - void to_json(json & j, const Labels & x); | |
| 89 | - | |
| 90 | - void from_json(const json & j, TopLevel & x); | |
| 91 | - void to_json(json & j, const TopLevel & x); | |
| 87 | +void from_json(const json & j, Labels & x); | |
| 88 | +void to_json(json & j, const Labels & x); | |
| 92 | 89 | |
| 90 | +void from_json(const json & j, TopLevel & x); | |
| 91 | +void to_json(json & j, const TopLevel & x); | |
| 92 | +} | |
| 93 | +namespace quicktype { | |
| 93 | 94 | inline void from_json(const json & j, Hints& x) { |
| 94 | 95 | (void)j; |
| 95 | 96 | (void)x; |
Test case
1 generated file · +140 −139test/inputs/json/priority/bug427.json
Mcplusplusdefault / quicktype.hpp+140 −139
| @@ -2491,213 +2491,214 @@ namespace quicktype { | ||
| 2491 | 2491 | } |
| 2492 | 2492 | |
| 2493 | 2493 | namespace quicktype { |
| 2494 | - void from_json(const json & j, PurpleComment & x); | |
| 2495 | - void to_json(json & j, const PurpleComment & x); | |
| 2494 | +void from_json(const json & j, PurpleComment & x); | |
| 2495 | +void to_json(json & j, const PurpleComment & x); | |
| 2496 | 2496 | |
| 2497 | - void from_json(const json & j, PurpleFlags & x); | |
| 2498 | - void to_json(json & j, const PurpleFlags & x); | |
| 2497 | +void from_json(const json & j, PurpleFlags & x); | |
| 2498 | +void to_json(json & j, const PurpleFlags & x); | |
| 2499 | 2499 | |
| 2500 | - void from_json(const json & j, GetSignatureFlags & x); | |
| 2501 | - void to_json(json & j, const GetSignatureFlags & x); | |
| 2500 | +void from_json(const json & j, GetSignatureFlags & x); | |
| 2501 | +void to_json(json & j, const GetSignatureFlags & x); | |
| 2502 | 2502 | |
| 2503 | - void from_json(const json & j, ElementType & x); | |
| 2504 | - void to_json(json & j, const ElementType & x); | |
| 2503 | +void from_json(const json & j, ElementType & x); | |
| 2504 | +void to_json(json & j, const ElementType & x); | |
| 2505 | 2505 | |
| 2506 | - void from_json(const json & j, FluffyComment & x); | |
| 2507 | - void to_json(json & j, const FluffyComment & x); | |
| 2506 | +void from_json(const json & j, FluffyComment & x); | |
| 2507 | +void to_json(json & j, const FluffyComment & x); | |
| 2508 | 2508 | |
| 2509 | - void from_json(const json & j, FluffyFlags & x); | |
| 2510 | - void to_json(json & j, const FluffyFlags & x); | |
| 2509 | +void from_json(const json & j, FluffyFlags & x); | |
| 2510 | +void to_json(json & j, const FluffyFlags & x); | |
| 2511 | 2511 | |
| 2512 | - void from_json(const json & j, Source & x); | |
| 2513 | - void to_json(json & j, const Source & x); | |
| 2512 | +void from_json(const json & j, Source & x); | |
| 2513 | +void to_json(json & j, const Source & x); | |
| 2514 | 2514 | |
| 2515 | - void from_json(const json & j, GetSignatureComment & x); | |
| 2516 | - void to_json(json & j, const GetSignatureComment & x); | |
| 2515 | +void from_json(const json & j, GetSignatureComment & x); | |
| 2516 | +void to_json(json & j, const GetSignatureComment & x); | |
| 2517 | 2517 | |
| 2518 | - void from_json(const json & j, Group & x); | |
| 2519 | - void to_json(json & j, const Group & x); | |
| 2518 | +void from_json(const json & j, Group & x); | |
| 2519 | +void to_json(json & j, const Group & x); | |
| 2520 | 2520 | |
| 2521 | - void from_json(const json & j, TentacledComment & x); | |
| 2522 | - void to_json(json & j, const TentacledComment & x); | |
| 2521 | +void from_json(const json & j, TentacledComment & x); | |
| 2522 | +void to_json(json & j, const TentacledComment & x); | |
| 2523 | 2523 | |
| 2524 | - void from_json(const json & j, TentacledFlags & x); | |
| 2525 | - void to_json(json & j, const TentacledFlags & x); | |
| 2524 | +void from_json(const json & j, TentacledFlags & x); | |
| 2525 | +void to_json(json & j, const TentacledFlags & x); | |
| 2526 | 2526 | |
| 2527 | - void from_json(const json & j, FluffyType & x); | |
| 2528 | - void to_json(json & j, const FluffyType & x); | |
| 2527 | +void from_json(const json & j, FluffyType & x); | |
| 2528 | +void to_json(json & j, const FluffyType & x); | |
| 2529 | 2529 | |
| 2530 | - void from_json(const json & j, GetSignatureParameter & x); | |
| 2531 | - void to_json(json & j, const GetSignatureParameter & x); | |
| 2530 | +void from_json(const json & j, GetSignatureParameter & x); | |
| 2531 | +void to_json(json & j, const GetSignatureParameter & x); | |
| 2532 | 2532 | |
| 2533 | - void from_json(const json & j, GetSignatureType & x); | |
| 2534 | - void to_json(json & j, const GetSignatureType & x); | |
| 2533 | +void from_json(const json & j, GetSignatureType & x); | |
| 2534 | +void to_json(json & j, const GetSignatureType & x); | |
| 2535 | 2535 | |
| 2536 | - void from_json(const json & j, IndexSignatureElement & x); | |
| 2537 | - void to_json(json & j, const IndexSignatureElement & x); | |
| 2536 | +void from_json(const json & j, IndexSignatureElement & x); | |
| 2537 | +void to_json(json & j, const IndexSignatureElement & x); | |
| 2538 | 2538 | |
| 2539 | - void from_json(const json & j, PurpleType & x); | |
| 2540 | - void to_json(json & j, const PurpleType & x); | |
| 2539 | +void from_json(const json & j, PurpleType & x); | |
| 2540 | +void to_json(json & j, const PurpleType & x); | |
| 2541 | 2541 | |
| 2542 | - void from_json(const json & j, GetSignatureChild & x); | |
| 2543 | - void to_json(json & j, const GetSignatureChild & x); | |
| 2542 | +void from_json(const json & j, GetSignatureChild & x); | |
| 2543 | +void to_json(json & j, const GetSignatureChild & x); | |
| 2544 | 2544 | |
| 2545 | - void from_json(const json & j, GetSignature & x); | |
| 2546 | - void to_json(json & j, const GetSignature & x); | |
| 2545 | +void from_json(const json & j, GetSignature & x); | |
| 2546 | +void to_json(json & j, const GetSignature & x); | |
| 2547 | 2547 | |
| 2548 | - void from_json(const json & j, PurpleDeclaration & x); | |
| 2549 | - void to_json(json & j, const PurpleDeclaration & x); | |
| 2548 | +void from_json(const json & j, PurpleDeclaration & x); | |
| 2549 | +void to_json(json & j, const PurpleDeclaration & x); | |
| 2550 | 2550 | |
| 2551 | - void from_json(const json & j, TentacledType & x); | |
| 2552 | - void to_json(json & j, const TentacledType & x); | |
| 2551 | +void from_json(const json & j, TentacledType & x); | |
| 2552 | +void to_json(json & j, const TentacledType & x); | |
| 2553 | 2553 | |
| 2554 | - void from_json(const json & j, PurpleSignature & x); | |
| 2555 | - void to_json(json & j, const PurpleSignature & x); | |
| 2554 | +void from_json(const json & j, PurpleSignature & x); | |
| 2555 | +void to_json(json & j, const PurpleSignature & x); | |
| 2556 | 2556 | |
| 2557 | - void from_json(const json & j, TypeElement & x); | |
| 2558 | - void to_json(json & j, const TypeElement & x); | |
| 2557 | +void from_json(const json & j, TypeElement & x); | |
| 2558 | +void to_json(json & j, const TypeElement & x); | |
| 2559 | 2559 | |
| 2560 | - void from_json(const json & j, TentacledChild & x); | |
| 2561 | - void to_json(json & j, const TentacledChild & x); | |
| 2560 | +void from_json(const json & j, TentacledChild & x); | |
| 2561 | +void to_json(json & j, const TentacledChild & x); | |
| 2562 | 2562 | |
| 2563 | - void from_json(const json & j, Tag & x); | |
| 2564 | - void to_json(json & j, const Tag & x); | |
| 2563 | +void from_json(const json & j, Tag & x); | |
| 2564 | +void to_json(json & j, const Tag & x); | |
| 2565 | 2565 | |
| 2566 | - void from_json(const json & j, StickyComment & x); | |
| 2567 | - void to_json(json & j, const StickyComment & x); | |
| 2566 | +void from_json(const json & j, StickyComment & x); | |
| 2567 | +void to_json(json & j, const StickyComment & x); | |
| 2568 | 2568 | |
| 2569 | - void from_json(const json & j, StickyFlags & x); | |
| 2570 | - void to_json(json & j, const StickyFlags & x); | |
| 2569 | +void from_json(const json & j, StickyFlags & x); | |
| 2570 | +void to_json(json & j, const StickyFlags & x); | |
| 2571 | 2571 | |
| 2572 | - void from_json(const json & j, ExtendedBy & x); | |
| 2573 | - void to_json(json & j, const ExtendedBy & x); | |
| 2572 | +void from_json(const json & j, ExtendedBy & x); | |
| 2573 | +void to_json(json & j, const ExtendedBy & x); | |
| 2574 | 2574 | |
| 2575 | - void from_json(const json & j, IndigoFlags & x); | |
| 2576 | - void to_json(json & j, const IndigoFlags & x); | |
| 2575 | +void from_json(const json & j, IndigoFlags & x); | |
| 2576 | +void to_json(json & j, const IndigoFlags & x); | |
| 2577 | 2577 | |
| 2578 | - void from_json(const json & j, StickyType & x); | |
| 2579 | - void to_json(json & j, const StickyType & x); | |
| 2578 | +void from_json(const json & j, StickyType & x); | |
| 2579 | +void to_json(json & j, const StickyType & x); | |
| 2580 | 2580 | |
| 2581 | - void from_json(const json & j, PurpleParameter & x); | |
| 2582 | - void to_json(json & j, const PurpleParameter & x); | |
| 2581 | +void from_json(const json & j, PurpleParameter & x); | |
| 2582 | +void to_json(json & j, const PurpleParameter & x); | |
| 2583 | 2583 | |
| 2584 | - void from_json(const json & j, FluffySignature & x); | |
| 2585 | - void to_json(json & j, const FluffySignature & x); | |
| 2584 | +void from_json(const json & j, FluffySignature & x); | |
| 2585 | +void to_json(json & j, const FluffySignature & x); | |
| 2586 | 2586 | |
| 2587 | - void from_json(const json & j, IndecentType & x); | |
| 2588 | - void to_json(json & j, const IndecentType & x); | |
| 2587 | +void from_json(const json & j, IndecentType & x); | |
| 2588 | +void to_json(json & j, const IndecentType & x); | |
| 2589 | 2589 | |
| 2590 | - void from_json(const json & j, StickyChild & x); | |
| 2591 | - void to_json(json & j, const StickyChild & x); | |
| 2590 | +void from_json(const json & j, StickyChild & x); | |
| 2591 | +void to_json(json & j, const StickyChild & x); | |
| 2592 | 2592 | |
| 2593 | - void from_json(const json & j, HilariousType & x); | |
| 2594 | - void to_json(json & j, const HilariousType & x); | |
| 2593 | +void from_json(const json & j, HilariousType & x); | |
| 2594 | +void to_json(json & j, const HilariousType & x); | |
| 2595 | 2595 | |
| 2596 | - void from_json(const json & j, IndexSignature & x); | |
| 2597 | - void to_json(json & j, const IndexSignature & x); | |
| 2596 | +void from_json(const json & j, IndexSignature & x); | |
| 2597 | +void to_json(json & j, const IndexSignature & x); | |
| 2598 | 2598 | |
| 2599 | - void from_json(const json & j, IndigoComment & x); | |
| 2600 | - void to_json(json & j, const IndigoComment & x); | |
| 2599 | +void from_json(const json & j, IndigoComment & x); | |
| 2600 | +void to_json(json & j, const IndigoComment & x); | |
| 2601 | 2601 | |
| 2602 | - void from_json(const json & j, FluffyParameter & x); | |
| 2603 | - void to_json(json & j, const FluffyParameter & x); | |
| 2602 | +void from_json(const json & j, FluffyParameter & x); | |
| 2603 | +void to_json(json & j, const FluffyParameter & x); | |
| 2604 | 2604 | |
| 2605 | - void from_json(const json & j, TentacledSignature & x); | |
| 2606 | - void to_json(json & j, const TentacledSignature & x); | |
| 2605 | +void from_json(const json & j, TentacledSignature & x); | |
| 2606 | +void to_json(json & j, const TentacledSignature & x); | |
| 2607 | 2607 | |
| 2608 | - void from_json(const json & j, FluffyDeclaration & x); | |
| 2609 | - void to_json(json & j, const FluffyDeclaration & x); | |
| 2608 | +void from_json(const json & j, FluffyDeclaration & x); | |
| 2609 | +void to_json(json & j, const FluffyDeclaration & x); | |
| 2610 | 2610 | |
| 2611 | - void from_json(const json & j, PurpleTypeArgument & x); | |
| 2612 | - void to_json(json & j, const PurpleTypeArgument & x); | |
| 2611 | +void from_json(const json & j, PurpleTypeArgument & x); | |
| 2612 | +void to_json(json & j, const PurpleTypeArgument & x); | |
| 2613 | 2613 | |
| 2614 | - void from_json(const json & j, IndigoType & x); | |
| 2615 | - void to_json(json & j, const IndigoType & x); | |
| 2614 | +void from_json(const json & j, IndigoType & x); | |
| 2615 | +void to_json(json & j, const IndigoType & x); | |
| 2616 | 2616 | |
| 2617 | - void from_json(const json & j, FluffyChild & x); | |
| 2618 | - void to_json(json & j, const FluffyChild & x); | |
| 2617 | +void from_json(const json & j, FluffyChild & x); | |
| 2618 | +void to_json(json & j, const FluffyChild & x); | |
| 2619 | 2619 | |
| 2620 | - void from_json(const json & j, IndecentFlags & x); | |
| 2621 | - void to_json(json & j, const IndecentFlags & x); | |
| 2620 | +void from_json(const json & j, IndecentFlags & x); | |
| 2621 | +void to_json(json & j, const IndecentFlags & x); | |
| 2622 | 2622 | |
| 2623 | - void from_json(const json & j, IndigoChild & x); | |
| 2624 | - void to_json(json & j, const IndigoChild & x); | |
| 2623 | +void from_json(const json & j, IndigoChild & x); | |
| 2624 | +void to_json(json & j, const IndigoChild & x); | |
| 2625 | 2625 | |
| 2626 | - void from_json(const json & j, TentacledDeclaration & x); | |
| 2627 | - void to_json(json & j, const TentacledDeclaration & x); | |
| 2626 | +void from_json(const json & j, TentacledDeclaration & x); | |
| 2627 | +void to_json(json & j, const TentacledDeclaration & x); | |
| 2628 | 2628 | |
| 2629 | - void from_json(const json & j, AmbitiousType & x); | |
| 2630 | - void to_json(json & j, const AmbitiousType & x); | |
| 2629 | +void from_json(const json & j, AmbitiousType & x); | |
| 2630 | +void to_json(json & j, const AmbitiousType & x); | |
| 2631 | 2631 | |
| 2632 | - void from_json(const json & j, TentacledParameter & x); | |
| 2633 | - void to_json(json & j, const TentacledParameter & x); | |
| 2632 | +void from_json(const json & j, TentacledParameter & x); | |
| 2633 | +void to_json(json & j, const TentacledParameter & x); | |
| 2634 | 2634 | |
| 2635 | - void from_json(const json & j, CunningType & x); | |
| 2636 | - void to_json(json & j, const CunningType & x); | |
| 2635 | +void from_json(const json & j, CunningType & x); | |
| 2636 | +void to_json(json & j, const CunningType & x); | |
| 2637 | 2637 | |
| 2638 | - void from_json(const json & j, StickySignature & x); | |
| 2639 | - void to_json(json & j, const StickySignature & x); | |
| 2638 | +void from_json(const json & j, StickySignature & x); | |
| 2639 | +void to_json(json & j, const StickySignature & x); | |
| 2640 | 2640 | |
| 2641 | - void from_json(const json & j, IndigoDeclaration & x); | |
| 2642 | - void to_json(json & j, const IndigoDeclaration & x); | |
| 2641 | +void from_json(const json & j, IndigoDeclaration & x); | |
| 2642 | +void to_json(json & j, const IndigoDeclaration & x); | |
| 2643 | 2643 | |
| 2644 | - void from_json(const json & j, FriskyType & x); | |
| 2645 | - void to_json(json & j, const FriskyType & x); | |
| 2644 | +void from_json(const json & j, FriskyType & x); | |
| 2645 | +void to_json(json & j, const FriskyType & x); | |
| 2646 | 2646 | |
| 2647 | - void from_json(const json & j, IndecentChild & x); | |
| 2648 | - void to_json(json & j, const IndecentChild & x); | |
| 2647 | +void from_json(const json & j, IndecentChild & x); | |
| 2648 | +void to_json(json & j, const IndecentChild & x); | |
| 2649 | 2649 | |
| 2650 | - void from_json(const json & j, StickyDeclaration & x); | |
| 2651 | - void to_json(json & j, const StickyDeclaration & x); | |
| 2650 | +void from_json(const json & j, StickyDeclaration & x); | |
| 2651 | +void to_json(json & j, const StickyDeclaration & x); | |
| 2652 | 2652 | |
| 2653 | - void from_json(const json & j, FluffyTypeArgument & x); | |
| 2654 | - void to_json(json & j, const FluffyTypeArgument & x); | |
| 2653 | +void from_json(const json & j, FluffyTypeArgument & x); | |
| 2654 | +void to_json(json & j, const FluffyTypeArgument & x); | |
| 2655 | 2655 | |
| 2656 | - void from_json(const json & j, MagentaType & x); | |
| 2657 | - void to_json(json & j, const MagentaType & x); | |
| 2656 | +void from_json(const json & j, MagentaType & x); | |
| 2657 | +void to_json(json & j, const MagentaType & x); | |
| 2658 | 2658 | |
| 2659 | - void from_json(const json & j, MischievousType & x); | |
| 2660 | - void to_json(json & j, const MischievousType & x); | |
| 2659 | +void from_json(const json & j, MischievousType & x); | |
| 2660 | +void to_json(json & j, const MischievousType & x); | |
| 2661 | 2661 | |
| 2662 | - void from_json(const json & j, TypeParameter & x); | |
| 2663 | - void to_json(json & j, const TypeParameter & x); | |
| 2662 | +void from_json(const json & j, TypeParameter & x); | |
| 2663 | +void to_json(json & j, const TypeParameter & x); | |
| 2664 | 2664 | |
| 2665 | - void from_json(const json & j, PurpleChild & x); | |
| 2666 | - void to_json(json & j, const PurpleChild & x); | |
| 2665 | +void from_json(const json & j, PurpleChild & x); | |
| 2666 | +void to_json(json & j, const PurpleChild & x); | |
| 2667 | 2667 | |
| 2668 | - void from_json(const json & j, IndecentComment & x); | |
| 2669 | - void to_json(json & j, const IndecentComment & x); | |
| 2668 | +void from_json(const json & j, IndecentComment & x); | |
| 2669 | +void to_json(json & j, const IndecentComment & x); | |
| 2670 | 2670 | |
| 2671 | - void from_json(const json & j, TopLevelChild & x); | |
| 2672 | - void to_json(json & j, const TopLevelChild & x); | |
| 2671 | +void from_json(const json & j, TopLevelChild & x); | |
| 2672 | +void to_json(json & j, const TopLevelChild & x); | |
| 2673 | 2673 | |
| 2674 | - void from_json(const json & j, TopLevel & x); | |
| 2675 | - void to_json(json & j, const TopLevel & x); | |
| 2674 | +void from_json(const json & j, TopLevel & x); | |
| 2675 | +void to_json(json & j, const TopLevel & x); | |
| 2676 | 2676 | |
| 2677 | - void from_json(const json & j, PurpleKindString & x); | |
| 2678 | - void to_json(json & j, const PurpleKindString & x); | |
| 2677 | +void from_json(const json & j, PurpleKindString & x); | |
| 2678 | +void to_json(json & j, const PurpleKindString & x); | |
| 2679 | 2679 | |
| 2680 | - void from_json(const json & j, SignatureKindString & x); | |
| 2681 | - void to_json(json & j, const SignatureKindString & x); | |
| 2680 | +void from_json(const json & j, SignatureKindString & x); | |
| 2681 | +void to_json(json & j, const SignatureKindString & x); | |
| 2682 | 2682 | |
| 2683 | - void from_json(const json & j, Name & x); | |
| 2684 | - void to_json(json & j, const Name & x); | |
| 2683 | +void from_json(const json & j, Name & x); | |
| 2684 | +void to_json(json & j, const Name & x); | |
| 2685 | 2685 | |
| 2686 | - void from_json(const json & j, TypeEnum & x); | |
| 2687 | - void to_json(json & j, const TypeEnum & x); | |
| 2686 | +void from_json(const json & j, TypeEnum & x); | |
| 2687 | +void to_json(json & j, const TypeEnum & x); | |
| 2688 | 2688 | |
| 2689 | - void from_json(const json & j, FileName & x); | |
| 2690 | - void to_json(json & j, const FileName & x); | |
| 2689 | +void from_json(const json & j, FileName & x); | |
| 2690 | +void to_json(json & j, const FileName & x); | |
| 2691 | 2691 | |
| 2692 | - void from_json(const json & j, ParameterKindString & x); | |
| 2693 | - void to_json(json & j, const ParameterKindString & x); | |
| 2692 | +void from_json(const json & j, ParameterKindString & x); | |
| 2693 | +void to_json(json & j, const ParameterKindString & x); | |
| 2694 | 2694 | |
| 2695 | - void from_json(const json & j, FluffyKindString & x); | |
| 2696 | - void to_json(json & j, const FluffyKindString & x); | |
| 2697 | - | |
| 2698 | - void from_json(const json & j, TentacledKindString & x); | |
| 2699 | - void to_json(json & j, const TentacledKindString & x); | |
| 2695 | +void from_json(const json & j, FluffyKindString & x); | |
| 2696 | +void to_json(json & j, const FluffyKindString & x); | |
| 2700 | 2697 | |
| 2698 | +void from_json(const json & j, TentacledKindString & x); | |
| 2699 | +void to_json(json & j, const TentacledKindString & x); | |
| 2700 | +} | |
| 2701 | +namespace quicktype { | |
| 2701 | 2702 | inline void from_json(const json & j, PurpleComment& x) { |
| 2702 | 2703 | x.set_short_text(j.at("shortText").get<std::string>()); |
| 2703 | 2704 | } |
Test case
1 generated file · +4 −3test/inputs/json/priority/bug790.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -82,9 +82,10 @@ namespace quicktype { | ||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | namespace quicktype { |
| 85 | - void from_json(const json & j, TopLevel & x); | |
| 86 | - void to_json(json & j, const TopLevel & x); | |
| 87 | - | |
| 85 | +void from_json(const json & j, TopLevel & x); | |
| 86 | +void to_json(json & j, const TopLevel & x); | |
| 87 | +} | |
| 88 | +namespace quicktype { | |
| 88 | 89 | inline void from_json(const json & j, TopLevel& x) { |
| 89 | 90 | x.set_children_data(j.at("children_data").get<std::vector<TopLevel>>()); |
| 90 | 91 | x.set_id(j.at("id").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/bug855-short.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -69,9 +69,10 @@ namespace quicktype { | ||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | namespace quicktype { |
| 72 | - void from_json(const json & j, TopLevelValue & x); | |
| 73 | - void to_json(json & j, const TopLevelValue & x); | |
| 74 | - | |
| 72 | +void from_json(const json & j, TopLevelValue & x); | |
| 73 | +void to_json(json & j, const TopLevelValue & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, TopLevelValue& x) { |
| 76 | 77 | x.set_channel_id(j.at("channel_id").get<std::string>()); |
| 77 | 78 | x.set_channel_name(j.at("channel_name").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/json/priority/coin-pairs.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -101,12 +101,13 @@ namespace quicktype { | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | namespace quicktype { |
| 104 | - void from_json(const json & j, Pair & x); | |
| 105 | - void to_json(json & j, const Pair & x); | |
| 106 | - | |
| 107 | - void from_json(const json & j, TopLevel & x); | |
| 108 | - void to_json(json & j, const TopLevel & x); | |
| 104 | +void from_json(const json & j, Pair & x); | |
| 105 | +void to_json(json & j, const Pair & x); | |
| 109 | 106 | |
| 107 | +void from_json(const json & j, TopLevel & x); | |
| 108 | +void to_json(json & j, const TopLevel & x); | |
| 109 | +} | |
| 110 | +namespace quicktype { | |
| 110 | 111 | inline void from_json(const json & j, Pair& x) { |
| 111 | 112 | x.set_decimal_places(j.at("decimal_places").get<int64_t>()); |
| 112 | 113 | x.set_fee(j.at("fee").get<double>()); |
Test case
1 generated file · +8 −7test/inputs/json/priority/combined-enum.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -68,15 +68,16 @@ namespace quicktype { | ||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | namespace quicktype { |
| 71 | - void from_json(const json & j, Bar & x); | |
| 72 | - void to_json(json & j, const Bar & x); | |
| 71 | +void from_json(const json & j, Bar & x); | |
| 72 | +void to_json(json & j, const Bar & x); | |
| 73 | 73 | |
| 74 | - void from_json(const json & j, TopLevel & x); | |
| 75 | - void to_json(json & j, const TopLevel & x); | |
| 76 | - | |
| 77 | - void from_json(const json & j, X & x); | |
| 78 | - void to_json(json & j, const X & x); | |
| 74 | +void from_json(const json & j, TopLevel & x); | |
| 75 | +void to_json(json & j, const TopLevel & x); | |
| 79 | 76 | |
| 77 | +void from_json(const json & j, X & x); | |
| 78 | +void to_json(json & j, const X & x); | |
| 79 | +} | |
| 80 | +namespace quicktype { | |
| 80 | 81 | inline void from_json(const json & j, Bar& x) { |
| 81 | 82 | x.set_x(j.at("x").get<X>()); |
| 82 | 83 | } |
Test case
1 generated file · +4 −3test/inputs/json/priority/direct-recursive.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -124,9 +124,10 @@ namespace quicktype { | ||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | namespace quicktype { |
| 127 | - void from_json(const json & j, TopLevel & x); | |
| 128 | - void to_json(json & j, const TopLevel & x); | |
| 129 | - | |
| 127 | +void from_json(const json & j, TopLevel & x); | |
| 128 | +void to_json(json & j, const TopLevel & x); | |
| 129 | +} | |
| 130 | +namespace quicktype { | |
| 130 | 131 | inline void from_json(const json & j, TopLevel& x) { |
| 131 | 132 | x.set_also(get_heap_optional<TopLevel>(j, "also")); |
| 132 | 133 | x.set_bar(j.at("bar").get<bool>()); |
Test case
1 generated file · +6 −5test/inputs/json/priority/empty-enum.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -118,12 +118,13 @@ namespace quicktype { | ||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | namespace quicktype { |
| 121 | - void from_json(const json & j, Foo & x); | |
| 122 | - void to_json(json & j, const Foo & x); | |
| 123 | - | |
| 124 | - void from_json(const json & j, TopLevel & x); | |
| 125 | - void to_json(json & j, const TopLevel & x); | |
| 121 | +void from_json(const json & j, Foo & x); | |
| 122 | +void to_json(json & j, const Foo & x); | |
| 126 | 123 | |
| 124 | +void from_json(const json & j, TopLevel & x); | |
| 125 | +void to_json(json & j, const TopLevel & x); | |
| 126 | +} | |
| 127 | +namespace quicktype { | |
| 127 | 128 | inline void from_json(const json & j, Foo& x) { |
| 128 | 129 | x.set_bar(get_stack_optional<std::string>(j, "bar")); |
| 129 | 130 | } |
Test case
1 generated file · +16 −15test/inputs/json/priority/identifiers.json
Mcplusplusdefault / quicktype.hpp+16 −15
| @@ -167,27 +167,28 @@ namespace quicktype { | ||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | namespace quicktype { |
| 170 | - void from_json(const json & j, TopLevelBla & x); | |
| 171 | - void to_json(json & j, const TopLevelBla & x); | |
| 170 | +void from_json(const json & j, TopLevelBla & x); | |
| 171 | +void to_json(json & j, const TopLevelBla & x); | |
| 172 | 172 | |
| 173 | - void from_json(const json & j, Empty & x); | |
| 174 | - void to_json(json & j, const Empty & x); | |
| 173 | +void from_json(const json & j, Empty & x); | |
| 174 | +void to_json(json & j, const Empty & x); | |
| 175 | 175 | |
| 176 | - void from_json(const json & j, FooBla & x); | |
| 177 | - void to_json(json & j, const FooBla & x); | |
| 176 | +void from_json(const json & j, FooBla & x); | |
| 177 | +void to_json(json & j, const FooBla & x); | |
| 178 | 178 | |
| 179 | - void from_json(const json & j, Foo & x); | |
| 180 | - void to_json(json & j, const Foo & x); | |
| 179 | +void from_json(const json & j, Foo & x); | |
| 180 | +void to_json(json & j, const Foo & x); | |
| 181 | 181 | |
| 182 | - void from_json(const json & j, ThisIsAToughOne & x); | |
| 183 | - void to_json(json & j, const ThisIsAToughOne & x); | |
| 182 | +void from_json(const json & j, ThisIsAToughOne & x); | |
| 183 | +void to_json(json & j, const ThisIsAToughOne & x); | |
| 184 | 184 | |
| 185 | - void from_json(const json & j, EmptyClass & x); | |
| 186 | - void to_json(json & j, const EmptyClass & x); | |
| 187 | - | |
| 188 | - void from_json(const json & j, TopLevel & x); | |
| 189 | - void to_json(json & j, const TopLevel & x); | |
| 185 | +void from_json(const json & j, EmptyClass & x); | |
| 186 | +void to_json(json & j, const EmptyClass & x); | |
| 190 | 187 | |
| 188 | +void from_json(const json & j, TopLevel & x); | |
| 189 | +void to_json(json & j, const TopLevel & x); | |
| 190 | +} | |
| 191 | +namespace quicktype { | |
| 191 | 192 | inline void from_json(const json & j, TopLevelBla& x) { |
| 192 | 193 | x.set_bar(j.at("bar").get<int64_t>()); |
| 193 | 194 | } |
Test case
1 generated file · +4 −3test/inputs/json/priority/issue2680-object-array.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -49,9 +49,10 @@ namespace quicktype { | ||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | namespace quicktype { |
| 52 | - void from_json(const json & j, TopLevelElement & x); | |
| 53 | - void to_json(json & j, const TopLevelElement & x); | |
| 54 | - | |
| 52 | +void from_json(const json & j, TopLevelElement & x); | |
| 53 | +void to_json(json & j, const TopLevelElement & x); | |
| 54 | +} | |
| 55 | +namespace quicktype { | |
| 55 | 56 | inline void from_json(const json & j, TopLevelElement& x) { |
| 56 | 57 | x.set_key(j.at("key").get<std::string>()); |
| 57 | 58 | } |
Test case
1 generated file · +572 −571test/inputs/json/priority/keywords.json
Mcplusplusdefault / quicktype.hpp+572 −571
| @@ -5443,861 +5443,862 @@ namespace quicktype { | ||
| 5443 | 5443 | } |
| 5444 | 5444 | |
| 5445 | 5445 | namespace quicktype { |
| 5446 | - void from_json(const json & j, Abstract & x); | |
| 5447 | - void to_json(json & j, const Abstract & x); | |
| 5446 | +void from_json(const json & j, Abstract & x); | |
| 5447 | +void to_json(json & j, const Abstract & x); | |
| 5448 | 5448 | |
| 5449 | - void from_json(const json & j, Any & x); | |
| 5450 | - void to_json(json & j, const Any & x); | |
| 5449 | +void from_json(const json & j, Any & x); | |
| 5450 | +void to_json(json & j, const Any & x); | |
| 5451 | 5451 | |
| 5452 | - void from_json(const json & j, Array & x); | |
| 5453 | - void to_json(json & j, const Array & x); | |
| 5452 | +void from_json(const json & j, Array & x); | |
| 5453 | +void to_json(json & j, const Array & x); | |
| 5454 | 5454 | |
| 5455 | - void from_json(const json & j, As & x); | |
| 5456 | - void to_json(json & j, const As & x); | |
| 5455 | +void from_json(const json & j, As & x); | |
| 5456 | +void to_json(json & j, const As & x); | |
| 5457 | 5457 | |
| 5458 | - void from_json(const json & j, Assert & x); | |
| 5459 | - void to_json(json & j, const Assert & x); | |
| 5458 | +void from_json(const json & j, Assert & x); | |
| 5459 | +void to_json(json & j, const Assert & x); | |
| 5460 | 5460 | |
| 5461 | - void from_json(const json & j, Associatedtype & x); | |
| 5462 | - void to_json(json & j, const Associatedtype & x); | |
| 5461 | +void from_json(const json & j, Associatedtype & x); | |
| 5462 | +void to_json(json & j, const Associatedtype & x); | |
| 5463 | 5463 | |
| 5464 | - void from_json(const json & j, Associativity & x); | |
| 5465 | - void to_json(json & j, const Associativity & x); | |
| 5464 | +void from_json(const json & j, Associativity & x); | |
| 5465 | +void to_json(json & j, const Associativity & x); | |
| 5466 | 5466 | |
| 5467 | - void from_json(const json & j, Async & x); | |
| 5468 | - void to_json(json & j, const Async & x); | |
| 5467 | +void from_json(const json & j, Async & x); | |
| 5468 | +void to_json(json & j, const Async & x); | |
| 5469 | 5469 | |
| 5470 | - void from_json(const json & j, Atomic & x); | |
| 5471 | - void to_json(json & j, const Atomic & x); | |
| 5470 | +void from_json(const json & j, Atomic & x); | |
| 5471 | +void to_json(json & j, const Atomic & x); | |
| 5472 | 5472 | |
| 5473 | - void from_json(const json & j, Await & x); | |
| 5474 | - void to_json(json & j, const Await & x); | |
| 5473 | +void from_json(const json & j, Await & x); | |
| 5474 | +void to_json(json & j, const Await & x); | |
| 5475 | 5475 | |
| 5476 | - void from_json(const json & j, Base & x); | |
| 5477 | - void to_json(json & j, const Base & x); | |
| 5476 | +void from_json(const json & j, Base & x); | |
| 5477 | +void to_json(json & j, const Base & x); | |
| 5478 | 5478 | |
| 5479 | - void from_json(const json & j, Boolean & x); | |
| 5480 | - void to_json(json & j, const Boolean & x); | |
| 5479 | +void from_json(const json & j, Boolean & x); | |
| 5480 | +void to_json(json & j, const Boolean & x); | |
| 5481 | 5481 | |
| 5482 | - void from_json(const json & j, Bycopy & x); | |
| 5483 | - void to_json(json & j, const Bycopy & x); | |
| 5482 | +void from_json(const json & j, Bycopy & x); | |
| 5483 | +void to_json(json & j, const Bycopy & x); | |
| 5484 | 5484 | |
| 5485 | - void from_json(const json & j, Byref & x); | |
| 5486 | - void to_json(json & j, const Byref & x); | |
| 5485 | +void from_json(const json & j, Byref & x); | |
| 5486 | +void to_json(json & j, const Byref & x); | |
| 5487 | 5487 | |
| 5488 | - void from_json(const json & j, Byte & x); | |
| 5489 | - void to_json(json & j, const Byte & x); | |
| 5488 | +void from_json(const json & j, Byte & x); | |
| 5489 | +void to_json(json & j, const Byte & x); | |
| 5490 | 5490 | |
| 5491 | - void from_json(const json & j, Chan & x); | |
| 5492 | - void to_json(json & j, const Chan & x); | |
| 5491 | +void from_json(const json & j, Chan & x); | |
| 5492 | +void to_json(json & j, const Chan & x); | |
| 5493 | 5493 | |
| 5494 | - void from_json(const json & j, Checked & x); | |
| 5495 | - void to_json(json & j, const Checked & x); | |
| 5494 | +void from_json(const json & j, Checked & x); | |
| 5495 | +void to_json(json & j, const Checked & x); | |
| 5496 | 5496 | |
| 5497 | - void from_json(const json & j, Clone & x); | |
| 5498 | - void to_json(json & j, const Clone & x); | |
| 5497 | +void from_json(const json & j, Clone & x); | |
| 5498 | +void to_json(json & j, const Clone & x); | |
| 5499 | 5499 | |
| 5500 | - void from_json(const json & j, Complex & x); | |
| 5501 | - void to_json(json & j, const Complex & x); | |
| 5500 | +void from_json(const json & j, Complex & x); | |
| 5501 | +void to_json(json & j, const Complex & x); | |
| 5502 | 5502 | |
| 5503 | - void from_json(const json & j, Console & x); | |
| 5504 | - void to_json(json & j, const Console & x); | |
| 5503 | +void from_json(const json & j, Console & x); | |
| 5504 | +void to_json(json & j, const Console & x); | |
| 5505 | 5505 | |
| 5506 | - void from_json(const json & j, Constructor & x); | |
| 5507 | - void to_json(json & j, const Constructor & x); | |
| 5506 | +void from_json(const json & j, Constructor & x); | |
| 5507 | +void to_json(json & j, const Constructor & x); | |
| 5508 | 5508 | |
| 5509 | - void from_json(const json & j, Convenience & x); | |
| 5510 | - void to_json(json & j, const Convenience & x); | |
| 5509 | +void from_json(const json & j, Convenience & x); | |
| 5510 | +void to_json(json & j, const Convenience & x); | |
| 5511 | 5511 | |
| 5512 | - void from_json(const json & j, Convert & x); | |
| 5513 | - void to_json(json & j, const Convert & x); | |
| 5512 | +void from_json(const json & j, Convert & x); | |
| 5513 | +void to_json(json & j, const Convert & x); | |
| 5514 | 5514 | |
| 5515 | - void from_json(const json & j, Converter & x); | |
| 5516 | - void to_json(json & j, const Converter & x); | |
| 5515 | +void from_json(const json & j, Converter & x); | |
| 5516 | +void to_json(json & j, const Converter & x); | |
| 5517 | 5517 | |
| 5518 | - void from_json(const json & j, Date & x); | |
| 5519 | - void to_json(json & j, const Date & x); | |
| 5518 | +void from_json(const json & j, Date & x); | |
| 5519 | +void to_json(json & j, const Date & x); | |
| 5520 | 5520 | |
| 5521 | - void from_json(const json & j, DateParseHandling & x); | |
| 5522 | - void to_json(json & j, const DateParseHandling & x); | |
| 5521 | +void from_json(const json & j, DateParseHandling & x); | |
| 5522 | +void to_json(json & j, const DateParseHandling & x); | |
| 5523 | 5523 | |
| 5524 | - void from_json(const json & j, Debugger & x); | |
| 5525 | - void to_json(json & j, const Debugger & x); | |
| 5524 | +void from_json(const json & j, Debugger & x); | |
| 5525 | +void to_json(json & j, const Debugger & x); | |
| 5526 | 5526 | |
| 5527 | - void from_json(const json & j, Decimal & x); | |
| 5528 | - void to_json(json & j, const Decimal & x); | |
| 5527 | +void from_json(const json & j, Decimal & x); | |
| 5528 | +void to_json(json & j, const Decimal & x); | |
| 5529 | 5529 | |
| 5530 | - void from_json(const json & j, Declare & x); | |
| 5531 | - void to_json(json & j, const Declare & x); | |
| 5530 | +void from_json(const json & j, Declare & x); | |
| 5531 | +void to_json(json & j, const Declare & x); | |
| 5532 | 5532 | |
| 5533 | - void from_json(const json & j, DecodeString & x); | |
| 5534 | - void to_json(json & j, const DecodeString & x); | |
| 5533 | +void from_json(const json & j, DecodeString & x); | |
| 5534 | +void to_json(json & j, const DecodeString & x); | |
| 5535 | 5535 | |
| 5536 | - void from_json(const json & j, Empty & x); | |
| 5537 | - void to_json(json & j, const Empty & x); | |
| 5536 | +void from_json(const json & j, Empty & x); | |
| 5537 | +void to_json(json & j, const Empty & x); | |
| 5538 | 5538 | |
| 5539 | - void from_json(const json & j, Obj1Bool & x); | |
| 5540 | - void to_json(json & j, const Obj1Bool & x); | |
| 5539 | +void from_json(const json & j, Obj1Bool & x); | |
| 5540 | +void to_json(json & j, const Obj1Bool & x); | |
| 5541 | 5541 | |
| 5542 | - void from_json(const json & j, Imaginery & x); | |
| 5543 | - void to_json(json & j, const Imaginery & x); | |
| 5542 | +void from_json(const json & j, Imaginery & x); | |
| 5543 | +void to_json(json & j, const Imaginery & x); | |
| 5544 | 5544 | |
| 5545 | - void from_json(const json & j, Alignas & x); | |
| 5546 | - void to_json(json & j, const Alignas & x); | |
| 5545 | +void from_json(const json & j, Alignas & x); | |
| 5546 | +void to_json(json & j, const Alignas & x); | |
| 5547 | 5547 | |
| 5548 | - void from_json(const json & j, Alignof & x); | |
| 5549 | - void to_json(json & j, const Alignof & x); | |
| 5548 | +void from_json(const json & j, Alignof & x); | |
| 5549 | +void to_json(json & j, const Alignof & x); | |
| 5550 | 5550 | |
| 5551 | - void from_json(const json & j, And & x); | |
| 5552 | - void to_json(json & j, const And & x); | |
| 5551 | +void from_json(const json & j, And & x); | |
| 5552 | +void to_json(json & j, const And & x); | |
| 5553 | 5553 | |
| 5554 | - void from_json(const json & j, AndEq & x); | |
| 5555 | - void to_json(json & j, const AndEq & x); | |
| 5554 | +void from_json(const json & j, AndEq & x); | |
| 5555 | +void to_json(json & j, const AndEq & x); | |
| 5556 | 5556 | |
| 5557 | - void from_json(const json & j, AnyClass & x); | |
| 5558 | - void to_json(json & j, const AnyClass & x); | |
| 5557 | +void from_json(const json & j, AnyClass & x); | |
| 5558 | +void to_json(json & j, const AnyClass & x); | |
| 5559 | 5559 | |
| 5560 | - void from_json(const json & j, Asm & x); | |
| 5561 | - void to_json(json & j, const Asm & x); | |
| 5560 | +void from_json(const json & j, Asm & x); | |
| 5561 | +void to_json(json & j, const Asm & x); | |
| 5562 | 5562 | |
| 5563 | - void from_json(const json & j, AtomicCancel & x); | |
| 5564 | - void to_json(json & j, const AtomicCancel & x); | |
| 5563 | +void from_json(const json & j, AtomicCancel & x); | |
| 5564 | +void to_json(json & j, const AtomicCancel & x); | |
| 5565 | 5565 | |
| 5566 | - void from_json(const json & j, AtomicCommit & x); | |
| 5567 | - void to_json(json & j, const AtomicCommit & x); | |
| 5566 | +void from_json(const json & j, AtomicCommit & x); | |
| 5567 | +void to_json(json & j, const AtomicCommit & x); | |
| 5568 | 5568 | |
| 5569 | - void from_json(const json & j, AtomicNoexcept & x); | |
| 5570 | - void to_json(json & j, const AtomicNoexcept & x); | |
| 5569 | +void from_json(const json & j, AtomicNoexcept & x); | |
| 5570 | +void to_json(json & j, const AtomicNoexcept & x); | |
| 5571 | 5571 | |
| 5572 | - void from_json(const json & j, Auto & x); | |
| 5573 | - void to_json(json & j, const Auto & x); | |
| 5572 | +void from_json(const json & j, Auto & x); | |
| 5573 | +void to_json(json & j, const Auto & x); | |
| 5574 | 5574 | |
| 5575 | - void from_json(const json & j, Bitand & x); | |
| 5576 | - void to_json(json & j, const Bitand & x); | |
| 5575 | +void from_json(const json & j, Bitand & x); | |
| 5576 | +void to_json(json & j, const Bitand & x); | |
| 5577 | 5577 | |
| 5578 | - void from_json(const json & j, Bitor & x); | |
| 5579 | - void to_json(json & j, const Bitor & x); | |
| 5578 | +void from_json(const json & j, Bitor & x); | |
| 5579 | +void to_json(json & j, const Bitor & x); | |
| 5580 | 5580 | |
| 5581 | - void from_json(const json & j, Bool & x); | |
| 5582 | - void to_json(json & j, const Bool & x); | |
| 5581 | +void from_json(const json & j, Bool & x); | |
| 5582 | +void to_json(json & j, const Bool & x); | |
| 5583 | 5583 | |
| 5584 | - void from_json(const json & j, Break & x); | |
| 5585 | - void to_json(json & j, const Break & x); | |
| 5584 | +void from_json(const json & j, Break & x); | |
| 5585 | +void to_json(json & j, const Break & x); | |
| 5586 | 5586 | |
| 5587 | - void from_json(const json & j, Case & x); | |
| 5588 | - void to_json(json & j, const Case & x); | |
| 5587 | +void from_json(const json & j, Case & x); | |
| 5588 | +void to_json(json & j, const Case & x); | |
| 5589 | 5589 | |
| 5590 | - void from_json(const json & j, Catch & x); | |
| 5591 | - void to_json(json & j, const Catch & x); | |
| 5590 | +void from_json(const json & j, Catch & x); | |
| 5591 | +void to_json(json & j, const Catch & x); | |
| 5592 | 5592 | |
| 5593 | - void from_json(const json & j, Char & x); | |
| 5594 | - void to_json(json & j, const Char & x); | |
| 5593 | +void from_json(const json & j, Char & x); | |
| 5594 | +void to_json(json & j, const Char & x); | |
| 5595 | 5595 | |
| 5596 | - void from_json(const json & j, Char16T & x); | |
| 5597 | - void to_json(json & j, const Char16T & x); | |
| 5596 | +void from_json(const json & j, Char16T & x); | |
| 5597 | +void to_json(json & j, const Char16T & x); | |
| 5598 | 5598 | |
| 5599 | - void from_json(const json & j, Char32T & x); | |
| 5600 | - void to_json(json & j, const Char32T & x); | |
| 5599 | +void from_json(const json & j, Char32T & x); | |
| 5600 | +void to_json(json & j, const Char32T & x); | |
| 5601 | 5601 | |
| 5602 | - void from_json(const json & j, Class & x); | |
| 5603 | - void to_json(json & j, const Class & x); | |
| 5602 | +void from_json(const json & j, Class & x); | |
| 5603 | +void to_json(json & j, const Class & x); | |
| 5604 | 5604 | |
| 5605 | - void from_json(const json & j, CoAwait & x); | |
| 5606 | - void to_json(json & j, const CoAwait & x); | |
| 5605 | +void from_json(const json & j, CoAwait & x); | |
| 5606 | +void to_json(json & j, const CoAwait & x); | |
| 5607 | 5607 | |
| 5608 | - void from_json(const json & j, CoReturn & x); | |
| 5609 | - void to_json(json & j, const CoReturn & x); | |
| 5608 | +void from_json(const json & j, CoReturn & x); | |
| 5609 | +void to_json(json & j, const CoReturn & x); | |
| 5610 | 5610 | |
| 5611 | - void from_json(const json & j, CoYield & x); | |
| 5612 | - void to_json(json & j, const CoYield & x); | |
| 5611 | +void from_json(const json & j, CoYield & x); | |
| 5612 | +void to_json(json & j, const CoYield & x); | |
| 5613 | 5613 | |
| 5614 | - void from_json(const json & j, Compl & x); | |
| 5615 | - void to_json(json & j, const Compl & x); | |
| 5614 | +void from_json(const json & j, Compl & x); | |
| 5615 | +void to_json(json & j, const Compl & x); | |
| 5616 | 5616 | |
| 5617 | - void from_json(const json & j, Concept & x); | |
| 5618 | - void to_json(json & j, const Concept & x); | |
| 5617 | +void from_json(const json & j, Concept & x); | |
| 5618 | +void to_json(json & j, const Concept & x); | |
| 5619 | 5619 | |
| 5620 | - void from_json(const json & j, Const & x); | |
| 5621 | - void to_json(json & j, const Const & x); | |
| 5620 | +void from_json(const json & j, Const & x); | |
| 5621 | +void to_json(json & j, const Const & x); | |
| 5622 | 5622 | |
| 5623 | - void from_json(const json & j, ConstCast & x); | |
| 5624 | - void to_json(json & j, const ConstCast & x); | |
| 5623 | +void from_json(const json & j, ConstCast & x); | |
| 5624 | +void to_json(json & j, const ConstCast & x); | |
| 5625 | 5625 | |
| 5626 | - void from_json(const json & j, Constexpr & x); | |
| 5627 | - void to_json(json & j, const Constexpr & x); | |
| 5626 | +void from_json(const json & j, Constexpr & x); | |
| 5627 | +void to_json(json & j, const Constexpr & x); | |
| 5628 | 5628 | |
| 5629 | - void from_json(const json & j, Continue & x); | |
| 5630 | - void to_json(json & j, const Continue & x); | |
| 5629 | +void from_json(const json & j, Continue & x); | |
| 5630 | +void to_json(json & j, const Continue & x); | |
| 5631 | 5631 | |
| 5632 | - void from_json(const json & j, Decltype & x); | |
| 5633 | - void to_json(json & j, const Decltype & x); | |
| 5632 | +void from_json(const json & j, Decltype & x); | |
| 5633 | +void to_json(json & j, const Decltype & x); | |
| 5634 | 5634 | |
| 5635 | - void from_json(const json & j, BoolClass & x); | |
| 5636 | - void to_json(json & j, const BoolClass & x); | |
| 5635 | +void from_json(const json & j, BoolClass & x); | |
| 5636 | +void to_json(json & j, const BoolClass & x); | |
| 5637 | 5637 | |
| 5638 | - void from_json(const json & j, ClassClass & x); | |
| 5639 | - void to_json(json & j, const ClassClass & x); | |
| 5638 | +void from_json(const json & j, ClassClass & x); | |
| 5639 | +void to_json(json & j, const ClassClass & x); | |
| 5640 | 5640 | |
| 5641 | - void from_json(const json & j, Obj1 & x); | |
| 5642 | - void to_json(json & j, const Obj1 & x); | |
| 5641 | +void from_json(const json & j, Obj1 & x); | |
| 5642 | +void to_json(json & j, const Obj1 & x); | |
| 5643 | 5643 | |
| 5644 | - void from_json(const json & j, Def & x); | |
| 5645 | - void to_json(json & j, const Def & x); | |
| 5644 | +void from_json(const json & j, Def & x); | |
| 5645 | +void to_json(json & j, const Def & x); | |
| 5646 | 5646 | |
| 5647 | - void from_json(const json & j, Defer & x); | |
| 5648 | - void to_json(json & j, const Defer & x); | |
| 5647 | +void from_json(const json & j, Defer & x); | |
| 5648 | +void to_json(json & j, const Defer & x); | |
| 5649 | 5649 | |
| 5650 | - void from_json(const json & j, Deinit & x); | |
| 5651 | - void to_json(json & j, const Deinit & x); | |
| 5650 | +void from_json(const json & j, Deinit & x); | |
| 5651 | +void to_json(json & j, const Deinit & x); | |
| 5652 | 5652 | |
| 5653 | - void from_json(const json & j, Del & x); | |
| 5654 | - void to_json(json & j, const Del & x); | |
| 5653 | +void from_json(const json & j, Del & x); | |
| 5654 | +void to_json(json & j, const Del & x); | |
| 5655 | 5655 | |
| 5656 | - void from_json(const json & j, Delegate & x); | |
| 5657 | - void to_json(json & j, const Delegate & x); | |
| 5656 | +void from_json(const json & j, Delegate & x); | |
| 5657 | +void to_json(json & j, const Delegate & x); | |
| 5658 | 5658 | |
| 5659 | - void from_json(const json & j, Dict & x); | |
| 5660 | - void to_json(json & j, const Dict & x); | |
| 5659 | +void from_json(const json & j, Dict & x); | |
| 5660 | +void to_json(json & j, const Dict & x); | |
| 5661 | 5661 | |
| 5662 | - void from_json(const json & j, Dictionary & x); | |
| 5663 | - void to_json(json & j, const Dictionary & x); | |
| 5662 | +void from_json(const json & j, Dictionary & x); | |
| 5663 | +void to_json(json & j, const Dictionary & x); | |
| 5664 | 5664 | |
| 5665 | - void from_json(const json & j, DidSet & x); | |
| 5666 | - void to_json(json & j, const DidSet & x); | |
| 5665 | +void from_json(const json & j, DidSet & x); | |
| 5666 | +void to_json(json & j, const DidSet & x); | |
| 5667 | 5667 | |
| 5668 | - void from_json(const json & j, Dynamic & x); | |
| 5669 | - void to_json(json & j, const Dynamic & x); | |
| 5668 | +void from_json(const json & j, Dynamic & x); | |
| 5669 | +void to_json(json & j, const Dynamic & x); | |
| 5670 | 5670 | |
| 5671 | - void from_json(const json & j, Elif & x); | |
| 5672 | - void to_json(json & j, const Elif & x); | |
| 5671 | +void from_json(const json & j, Elif & x); | |
| 5672 | +void to_json(json & j, const Elif & x); | |
| 5673 | 5673 | |
| 5674 | - void from_json(const json & j, EncodeQuickType & x); | |
| 5675 | - void to_json(json & j, const EncodeQuickType & x); | |
| 5674 | +void from_json(const json & j, EncodeQuickType & x); | |
| 5675 | +void to_json(json & j, const EncodeQuickType & x); | |
| 5676 | 5676 | |
| 5677 | - void from_json(const json & j, EqualityContract & x); | |
| 5678 | - void to_json(json & j, const EqualityContract & x); | |
| 5677 | +void from_json(const json & j, EqualityContract & x); | |
| 5678 | +void to_json(json & j, const EqualityContract & x); | |
| 5679 | 5679 | |
| 5680 | - void from_json(const json & j, Event & x); | |
| 5681 | - void to_json(json & j, const Event & x); | |
| 5680 | +void from_json(const json & j, Event & x); | |
| 5681 | +void to_json(json & j, const Event & x); | |
| 5682 | 5682 | |
| 5683 | - void from_json(const json & j, Except & x); | |
| 5684 | - void to_json(json & j, const Except & x); | |
| 5683 | +void from_json(const json & j, Except & x); | |
| 5684 | +void to_json(json & j, const Except & x); | |
| 5685 | 5685 | |
| 5686 | - void from_json(const json & j, Exception & x); | |
| 5687 | - void to_json(json & j, const Exception & x); | |
| 5686 | +void from_json(const json & j, Exception & x); | |
| 5687 | +void to_json(json & j, const Exception & x); | |
| 5688 | 5688 | |
| 5689 | - void from_json(const json & j, Exposing & x); | |
| 5690 | - void to_json(json & j, const Exposing & x); | |
| 5689 | +void from_json(const json & j, Exposing & x); | |
| 5690 | +void to_json(json & j, const Exposing & x); | |
| 5691 | 5691 | |
| 5692 | - void from_json(const json & j, Extends & x); | |
| 5693 | - void to_json(json & j, const Extends & x); | |
| 5692 | +void from_json(const json & j, Extends & x); | |
| 5693 | +void to_json(json & j, const Extends & x); | |
| 5694 | 5694 | |
| 5695 | - void from_json(const json & j, Extension & x); | |
| 5696 | - void to_json(json & j, const Extension & x); | |
| 5695 | +void from_json(const json & j, Extension & x); | |
| 5696 | +void to_json(json & j, const Extension & x); | |
| 5697 | 5697 | |
| 5698 | - void from_json(const json & j, Fallthrough & x); | |
| 5699 | - void to_json(json & j, const Fallthrough & x); | |
| 5698 | +void from_json(const json & j, Fallthrough & x); | |
| 5699 | +void to_json(json & j, const Fallthrough & x); | |
| 5700 | 5700 | |
| 5701 | - void from_json(const json & j, Fileprivate & x); | |
| 5702 | - void to_json(json & j, const Fileprivate & x); | |
| 5701 | +void from_json(const json & j, Fileprivate & x); | |
| 5702 | +void to_json(json & j, const Fileprivate & x); | |
| 5703 | 5703 | |
| 5704 | - void from_json(const json & j, Finally & x); | |
| 5705 | - void to_json(json & j, const Finally & x); | |
| 5704 | +void from_json(const json & j, Finally & x); | |
| 5705 | +void to_json(json & j, const Finally & x); | |
| 5706 | 5706 | |
| 5707 | - void from_json(const json & j, Fixed & x); | |
| 5708 | - void to_json(json & j, const Fixed & x); | |
| 5707 | +void from_json(const json & j, Fixed & x); | |
| 5708 | +void to_json(json & j, const Fixed & x); | |
| 5709 | 5709 | |
| 5710 | - void from_json(const json & j, Foreach & x); | |
| 5711 | - void to_json(json & j, const Foreach & x); | |
| 5710 | +void from_json(const json & j, Foreach & x); | |
| 5711 | +void to_json(json & j, const Foreach & x); | |
| 5712 | 5712 | |
| 5713 | - void from_json(const json & j, From & x); | |
| 5714 | - void to_json(json & j, const From & x); | |
| 5713 | +void from_json(const json & j, From & x); | |
| 5714 | +void to_json(json & j, const From & x); | |
| 5715 | 5715 | |
| 5716 | - void from_json(const json & j, FromJson & x); | |
| 5717 | - void to_json(json & j, const FromJson & x); | |
| 5716 | +void from_json(const json & j, FromJson & x); | |
| 5717 | +void to_json(json & j, const FromJson & x); | |
| 5718 | 5718 | |
| 5719 | - void from_json(const json & j, Func & x); | |
| 5720 | - void to_json(json & j, const Func & x); | |
| 5719 | +void from_json(const json & j, Func & x); | |
| 5720 | +void to_json(json & j, const Func & x); | |
| 5721 | 5721 | |
| 5722 | - void from_json(const json & j, Function & x); | |
| 5723 | - void to_json(json & j, const Function & x); | |
| 5722 | +void from_json(const json & j, Function & x); | |
| 5723 | +void to_json(json & j, const Function & x); | |
| 5724 | 5724 | |
| 5725 | - void from_json(const json & j, Get & x); | |
| 5726 | - void to_json(json & j, const Get & x); | |
| 5725 | +void from_json(const json & j, Get & x); | |
| 5726 | +void to_json(json & j, const Get & x); | |
| 5727 | 5727 | |
| 5728 | - void from_json(const json & j, Global & x); | |
| 5729 | - void to_json(json & j, const Global & x); | |
| 5728 | +void from_json(const json & j, Global & x); | |
| 5729 | +void to_json(json & j, const Global & x); | |
| 5730 | 5730 | |
| 5731 | - void from_json(const json & j, Go & x); | |
| 5732 | - void to_json(json & j, const Go & x); | |
| 5731 | +void from_json(const json & j, Go & x); | |
| 5732 | +void to_json(json & j, const Go & x); | |
| 5733 | 5733 | |
| 5734 | - void from_json(const json & j, Guard & x); | |
| 5735 | - void to_json(json & j, const Guard & x); | |
| 5734 | +void from_json(const json & j, Guard & x); | |
| 5735 | +void to_json(json & j, const Guard & x); | |
| 5736 | 5736 | |
| 5737 | - void from_json(const json & j, HasOwnProperty & x); | |
| 5738 | - void to_json(json & j, const HasOwnProperty & x); | |
| 5737 | +void from_json(const json & j, HasOwnProperty & x); | |
| 5738 | +void to_json(json & j, const HasOwnProperty & x); | |
| 5739 | 5739 | |
| 5740 | - void from_json(const json & j, Id & x); | |
| 5741 | - void to_json(json & j, const Id & x); | |
| 5740 | +void from_json(const json & j, Id & x); | |
| 5741 | +void to_json(json & j, const Id & x); | |
| 5742 | 5742 | |
| 5743 | - void from_json(const json & j, Imp & x); | |
| 5744 | - void to_json(json & j, const Imp & x); | |
| 5743 | +void from_json(const json & j, Imp & x); | |
| 5744 | +void to_json(json & j, const Imp & x); | |
| 5745 | 5745 | |
| 5746 | - void from_json(const json & j, Implements & x); | |
| 5747 | - void to_json(json & j, const Implements & x); | |
| 5746 | +void from_json(const json & j, Implements & x); | |
| 5747 | +void to_json(json & j, const Implements & x); | |
| 5748 | 5748 | |
| 5749 | - void from_json(const json & j, Implicit & x); | |
| 5750 | - void to_json(json & j, const Implicit & x); | |
| 5749 | +void from_json(const json & j, Implicit & x); | |
| 5750 | +void to_json(json & j, const Implicit & x); | |
| 5751 | 5751 | |
| 5752 | - void from_json(const json & j, In & x); | |
| 5753 | - void to_json(json & j, const In & x); | |
| 5752 | +void from_json(const json & j, In & x); | |
| 5753 | +void to_json(json & j, const In & x); | |
| 5754 | 5754 | |
| 5755 | - void from_json(const json & j, Indirect & x); | |
| 5756 | - void to_json(json & j, const Indirect & x); | |
| 5755 | +void from_json(const json & j, Indirect & x); | |
| 5756 | +void to_json(json & j, const Indirect & x); | |
| 5757 | 5757 | |
| 5758 | - void from_json(const json & j, Infix & x); | |
| 5759 | - void to_json(json & j, const Infix & x); | |
| 5758 | +void from_json(const json & j, Infix & x); | |
| 5759 | +void to_json(json & j, const Infix & x); | |
| 5760 | 5760 | |
| 5761 | - void from_json(const json & j, Init & x); | |
| 5762 | - void to_json(json & j, const Init & x); | |
| 5761 | +void from_json(const json & j, Init & x); | |
| 5762 | +void to_json(json & j, const Init & x); | |
| 5763 | 5763 | |
| 5764 | - void from_json(const json & j, Inout & x); | |
| 5765 | - void to_json(json & j, const Inout & x); | |
| 5764 | +void from_json(const json & j, Inout & x); | |
| 5765 | +void to_json(json & j, const Inout & x); | |
| 5766 | 5766 | |
| 5767 | - void from_json(const json & j, Instanceof & x); | |
| 5768 | - void to_json(json & j, const Instanceof & x); | |
| 5767 | +void from_json(const json & j, Instanceof & x); | |
| 5768 | +void to_json(json & j, const Instanceof & x); | |
| 5769 | 5769 | |
| 5770 | - void from_json(const json & j, Interface & x); | |
| 5771 | - void to_json(json & j, const Interface & x); | |
| 5770 | +void from_json(const json & j, Interface & x); | |
| 5771 | +void to_json(json & j, const Interface & x); | |
| 5772 | 5772 | |
| 5773 | - void from_json(const json & j, Internal & x); | |
| 5774 | - void to_json(json & j, const Internal & x); | |
| 5773 | +void from_json(const json & j, Internal & x); | |
| 5774 | +void to_json(json & j, const Internal & x); | |
| 5775 | 5775 | |
| 5776 | - void from_json(const json & j, Default & x); | |
| 5777 | - void to_json(json & j, const Default & x); | |
| 5776 | +void from_json(const json & j, Default & x); | |
| 5777 | +void to_json(json & j, const Default & x); | |
| 5778 | 5778 | |
| 5779 | - void from_json(const json & j, Delete & x); | |
| 5780 | - void to_json(json & j, const Delete & x); | |
| 5779 | +void from_json(const json & j, Delete & x); | |
| 5780 | +void to_json(json & j, const Delete & x); | |
| 5781 | 5781 | |
| 5782 | - void from_json(const json & j, Do & x); | |
| 5783 | - void to_json(json & j, const Do & x); | |
| 5782 | +void from_json(const json & j, Do & x); | |
| 5783 | +void to_json(json & j, const Do & x); | |
| 5784 | 5784 | |
| 5785 | - void from_json(const json & j, Double & x); | |
| 5786 | - void to_json(json & j, const Double & x); | |
| 5785 | +void from_json(const json & j, Double & x); | |
| 5786 | +void to_json(json & j, const Double & x); | |
| 5787 | 5787 | |
| 5788 | - void from_json(const json & j, DynamicCast & x); | |
| 5789 | - void to_json(json & j, const DynamicCast & x); | |
| 5788 | +void from_json(const json & j, DynamicCast & x); | |
| 5789 | +void to_json(json & j, const DynamicCast & x); | |
| 5790 | 5790 | |
| 5791 | - void from_json(const json & j, Else & x); | |
| 5792 | - void to_json(json & j, const Else & x); | |
| 5791 | +void from_json(const json & j, Else & x); | |
| 5792 | +void to_json(json & j, const Else & x); | |
| 5793 | 5793 | |
| 5794 | - void from_json(const json & j, Enum & x); | |
| 5795 | - void to_json(json & j, const Enum & x); | |
| 5794 | +void from_json(const json & j, Enum & x); | |
| 5795 | +void to_json(json & j, const Enum & x); | |
| 5796 | 5796 | |
| 5797 | - void from_json(const json & j, Explicit & x); | |
| 5798 | - void to_json(json & j, const Explicit & x); | |
| 5797 | +void from_json(const json & j, Explicit & x); | |
| 5798 | +void to_json(json & j, const Explicit & x); | |
| 5799 | 5799 | |
| 5800 | - void from_json(const json & j, Export & x); | |
| 5801 | - void to_json(json & j, const Export & x); | |
| 5800 | +void from_json(const json & j, Export & x); | |
| 5801 | +void to_json(json & j, const Export & x); | |
| 5802 | 5802 | |
| 5803 | - void from_json(const json & j, Extern & x); | |
| 5804 | - void to_json(json & j, const Extern & x); | |
| 5803 | +void from_json(const json & j, Extern & x); | |
| 5804 | +void to_json(json & j, const Extern & x); | |
| 5805 | 5805 | |
| 5806 | - void from_json(const json & j, False & x); | |
| 5807 | - void to_json(json & j, const False & x); | |
| 5806 | +void from_json(const json & j, False & x); | |
| 5807 | +void to_json(json & j, const False & x); | |
| 5808 | 5808 | |
| 5809 | - void from_json(const json & j, Final & x); | |
| 5810 | - void to_json(json & j, const Final & x); | |
| 5809 | +void from_json(const json & j, Final & x); | |
| 5810 | +void to_json(json & j, const Final & x); | |
| 5811 | 5811 | |
| 5812 | - void from_json(const json & j, Float & x); | |
| 5813 | - void to_json(json & j, const Float & x); | |
| 5812 | +void from_json(const json & j, Float & x); | |
| 5813 | +void to_json(json & j, const Float & x); | |
| 5814 | 5814 | |
| 5815 | - void from_json(const json & j, For & x); | |
| 5816 | - void to_json(json & j, const For & x); | |
| 5815 | +void from_json(const json & j, For & x); | |
| 5816 | +void to_json(json & j, const For & x); | |
| 5817 | 5817 | |
| 5818 | - void from_json(const json & j, Friend & x); | |
| 5819 | - void to_json(json & j, const Friend & x); | |
| 5818 | +void from_json(const json & j, Friend & x); | |
| 5819 | +void to_json(json & j, const Friend & x); | |
| 5820 | 5820 | |
| 5821 | - void from_json(const json & j, Goto & x); | |
| 5822 | - void to_json(json & j, const Goto & x); | |
| 5821 | +void from_json(const json & j, Goto & x); | |
| 5822 | +void to_json(json & j, const Goto & x); | |
| 5823 | 5823 | |
| 5824 | - void from_json(const json & j, If & x); | |
| 5825 | - void to_json(json & j, const If & x); | |
| 5824 | +void from_json(const json & j, If & x); | |
| 5825 | +void to_json(json & j, const If & x); | |
| 5826 | 5826 | |
| 5827 | - void from_json(const json & j, Import & x); | |
| 5828 | - void to_json(json & j, const Import & x); | |
| 5827 | +void from_json(const json & j, Import & x); | |
| 5828 | +void to_json(json & j, const Import & x); | |
| 5829 | 5829 | |
| 5830 | - void from_json(const json & j, Inline & x); | |
| 5831 | - void to_json(json & j, const Inline & x); | |
| 5830 | +void from_json(const json & j, Inline & x); | |
| 5831 | +void to_json(json & j, const Inline & x); | |
| 5832 | 5832 | |
| 5833 | - void from_json(const json & j, Int & x); | |
| 5834 | - void to_json(json & j, const Int & x); | |
| 5833 | +void from_json(const json & j, Int & x); | |
| 5834 | +void to_json(json & j, const Int & x); | |
| 5835 | 5835 | |
| 5836 | - void from_json(const json & j, FalseClass & x); | |
| 5837 | - void to_json(json & j, const FalseClass & x); | |
| 5836 | +void from_json(const json & j, FalseClass & x); | |
| 5837 | +void to_json(json & j, const FalseClass & x); | |
| 5838 | 5838 | |
| 5839 | - void from_json(const json & j, Obj2 & x); | |
| 5840 | - void to_json(json & j, const Obj2 & x); | |
| 5839 | +void from_json(const json & j, Obj2 & x); | |
| 5840 | +void to_json(json & j, const Obj2 & x); | |
| 5841 | 5841 | |
| 5842 | - void from_json(const json & j, Is & x); | |
| 5843 | - void to_json(json & j, const Is & x); | |
| 5842 | +void from_json(const json & j, Is & x); | |
| 5843 | +void to_json(json & j, const Is & x); | |
| 5844 | 5844 | |
| 5845 | - void from_json(const json & j, Iterable & x); | |
| 5846 | - void to_json(json & j, const Iterable & x); | |
| 5845 | +void from_json(const json & j, Iterable & x); | |
| 5846 | +void to_json(json & j, const Iterable & x); | |
| 5847 | 5847 | |
| 5848 | - void from_json(const json & j, Jdec & x); | |
| 5849 | - void to_json(json & j, const Jdec & x); | |
| 5848 | +void from_json(const json & j, Jdec & x); | |
| 5849 | +void to_json(json & j, const Jdec & x); | |
| 5850 | 5850 | |
| 5851 | - void from_json(const json & j, Jenc & x); | |
| 5852 | - void to_json(json & j, const Jenc & x); | |
| 5851 | +void from_json(const json & j, Jenc & x); | |
| 5852 | +void to_json(json & j, const Jenc & x); | |
| 5853 | 5853 | |
| 5854 | - void from_json(const json & j, Jpipe & x); | |
| 5855 | - void to_json(json & j, const Jpipe & x); | |
| 5854 | +void from_json(const json & j, Jpipe & x); | |
| 5855 | +void to_json(json & j, const Jpipe & x); | |
| 5856 | 5856 | |
| 5857 | - void from_json(const json & j, Json & x); | |
| 5858 | - void to_json(json & j, const Json & x); | |
| 5857 | +void from_json(const json & j, Json & x); | |
| 5858 | +void to_json(json & j, const Json & x); | |
| 5859 | 5859 | |
| 5860 | - void from_json(const json & j, JsonConverter & x); | |
| 5861 | - void to_json(json & j, const JsonConverter & x); | |
| 5860 | +void from_json(const json & j, JsonConverter & x); | |
| 5861 | +void to_json(json & j, const JsonConverter & x); | |
| 5862 | 5862 | |
| 5863 | - void from_json(const json & j, JsonSerializer & x); | |
| 5864 | - void to_json(json & j, const JsonSerializer & x); | |
| 5863 | +void from_json(const json & j, JsonSerializer & x); | |
| 5864 | +void to_json(json & j, const JsonSerializer & x); | |
| 5865 | 5865 | |
| 5866 | - void from_json(const json & j, JsonToken & x); | |
| 5867 | - void to_json(json & j, const JsonToken & x); | |
| 5866 | +void from_json(const json & j, JsonToken & x); | |
| 5867 | +void to_json(json & j, const JsonToken & x); | |
| 5868 | 5868 | |
| 5869 | - void from_json(const json & j, JsonWriter & x); | |
| 5870 | - void to_json(json & j, const JsonWriter & x); | |
| 5869 | +void from_json(const json & j, JsonWriter & x); | |
| 5870 | +void to_json(json & j, const JsonWriter & x); | |
| 5871 | 5871 | |
| 5872 | - void from_json(const json & j, Lambda & x); | |
| 5873 | - void to_json(json & j, const Lambda & x); | |
| 5872 | +void from_json(const json & j, Lambda & x); | |
| 5873 | +void to_json(json & j, const Lambda & x); | |
| 5874 | 5874 | |
| 5875 | - void from_json(const json & j, Lazy & x); | |
| 5876 | - void to_json(json & j, const Lazy & x); | |
| 5875 | +void from_json(const json & j, Lazy & x); | |
| 5876 | +void to_json(json & j, const Lazy & x); | |
| 5877 | 5877 | |
| 5878 | - void from_json(const json & j, Left & x); | |
| 5879 | - void to_json(json & j, const Left & x); | |
| 5878 | +void from_json(const json & j, Left & x); | |
| 5879 | +void to_json(json & j, const Left & x); | |
| 5880 | 5880 | |
| 5881 | - void from_json(const json & j, Let & x); | |
| 5882 | - void to_json(json & j, const Let & x); | |
| 5881 | +void from_json(const json & j, Let & x); | |
| 5882 | +void to_json(json & j, const Let & x); | |
| 5883 | 5883 | |
| 5884 | - void from_json(const json & j, List & x); | |
| 5885 | - void to_json(json & j, const List & x); | |
| 5884 | +void from_json(const json & j, List & x); | |
| 5885 | +void to_json(json & j, const List & x); | |
| 5886 | 5886 | |
| 5887 | - void from_json(const json & j, Lock & x); | |
| 5888 | - void to_json(json & j, const Lock & x); | |
| 5887 | +void from_json(const json & j, Lock & x); | |
| 5888 | +void to_json(json & j, const Lock & x); | |
| 5889 | 5889 | |
| 5890 | - void from_json(const json & j, Map & x); | |
| 5891 | - void to_json(json & j, const Map & x); | |
| 5890 | +void from_json(const json & j, Map & x); | |
| 5891 | +void to_json(json & j, const Map & x); | |
| 5892 | 5892 | |
| 5893 | - void from_json(const json & j, MetadataPropertyHandling & x); | |
| 5894 | - void to_json(json & j, const MetadataPropertyHandling & x); | |
| 5893 | +void from_json(const json & j, MetadataPropertyHandling & x); | |
| 5894 | +void to_json(json & j, const MetadataPropertyHandling & x); | |
| 5895 | 5895 | |
| 5896 | - void from_json(const json & j, Mutating & x); | |
| 5897 | - void to_json(json & j, const Mutating & x); | |
| 5896 | +void from_json(const json & j, Mutating & x); | |
| 5897 | +void to_json(json & j, const Mutating & x); | |
| 5898 | 5898 | |
| 5899 | - void from_json(const json & j, Native & x); | |
| 5900 | - void to_json(json & j, const Native & x); | |
| 5899 | +void from_json(const json & j, Native & x); | |
| 5900 | +void to_json(json & j, const Native & x); | |
| 5901 | 5901 | |
| 5902 | - void from_json(const json & j, Newtonsoft & x); | |
| 5903 | - void to_json(json & j, const Newtonsoft & x); | |
| 5902 | +void from_json(const json & j, Newtonsoft & x); | |
| 5903 | +void to_json(json & j, const Newtonsoft & x); | |
| 5904 | 5904 | |
| 5905 | - void from_json(const json & j, Nil & x); | |
| 5906 | - void to_json(json & j, const Nil & x); | |
| 5905 | +void from_json(const json & j, Nil & x); | |
| 5906 | +void to_json(json & j, const Nil & x); | |
| 5907 | 5907 | |
| 5908 | - void from_json(const json & j, No & x); | |
| 5909 | - void to_json(json & j, const No & x); | |
| 5908 | +void from_json(const json & j, No & x); | |
| 5909 | +void to_json(json & j, const No & x); | |
| 5910 | 5910 | |
| 5911 | - void from_json(const json & j, Nonatomic & x); | |
| 5912 | - void to_json(json & j, const Nonatomic & x); | |
| 5911 | +void from_json(const json & j, Nonatomic & x); | |
| 5912 | +void to_json(json & j, const Nonatomic & x); | |
| 5913 | 5913 | |
| 5914 | - void from_json(const json & j, None & x); | |
| 5915 | - void to_json(json & j, const None & x); | |
| 5914 | +void from_json(const json & j, None & x); | |
| 5915 | +void to_json(json & j, const None & x); | |
| 5916 | 5916 | |
| 5917 | - void from_json(const json & j, Nonlocal & x); | |
| 5918 | - void to_json(json & j, const Nonlocal & x); | |
| 5917 | +void from_json(const json & j, Nonlocal & x); | |
| 5918 | +void to_json(json & j, const Nonlocal & x); | |
| 5919 | 5919 | |
| 5920 | - void from_json(const json & j, Nonmutating & x); | |
| 5921 | - void to_json(json & j, const Nonmutating & x); | |
| 5920 | +void from_json(const json & j, Nonmutating & x); | |
| 5921 | +void to_json(json & j, const Nonmutating & x); | |
| 5922 | 5922 | |
| 5923 | - void from_json(const json & j, NsString & x); | |
| 5924 | - void to_json(json & j, const NsString & x); | |
| 5923 | +void from_json(const json & j, NsString & x); | |
| 5924 | +void to_json(json & j, const NsString & x); | |
| 5925 | 5925 | |
| 5926 | - void from_json(const json & j, Null & x); | |
| 5927 | - void to_json(json & j, const Null & x); | |
| 5926 | +void from_json(const json & j, Null & x); | |
| 5927 | +void to_json(json & j, const Null & x); | |
| 5928 | 5928 | |
| 5929 | - void from_json(const json & j, Number & x); | |
| 5930 | - void to_json(json & j, const Number & x); | |
| 5929 | +void from_json(const json & j, Number & x); | |
| 5930 | +void to_json(json & j, const Number & x); | |
| 5931 | 5931 | |
| 5932 | - void from_json(const json & j, Long & x); | |
| 5933 | - void to_json(json & j, const Long & x); | |
| 5932 | +void from_json(const json & j, Long & x); | |
| 5933 | +void to_json(json & j, const Long & x); | |
| 5934 | 5934 | |
| 5935 | - void from_json(const json & j, Module & x); | |
| 5936 | - void to_json(json & j, const Module & x); | |
| 5935 | +void from_json(const json & j, Module & x); | |
| 5936 | +void to_json(json & j, const Module & x); | |
| 5937 | 5937 | |
| 5938 | - void from_json(const json & j, Mutable & x); | |
| 5939 | - void to_json(json & j, const Mutable & x); | |
| 5938 | +void from_json(const json & j, Mutable & x); | |
| 5939 | +void to_json(json & j, const Mutable & x); | |
| 5940 | 5940 | |
| 5941 | - void from_json(const json & j, Namespace & x); | |
| 5942 | - void to_json(json & j, const Namespace & x); | |
| 5941 | +void from_json(const json & j, Namespace & x); | |
| 5942 | +void to_json(json & j, const Namespace & x); | |
| 5943 | 5943 | |
| 5944 | - void from_json(const json & j, New & x); | |
| 5945 | - void to_json(json & j, const New & x); | |
| 5944 | +void from_json(const json & j, New & x); | |
| 5945 | +void to_json(json & j, const New & x); | |
| 5946 | 5946 | |
| 5947 | - void from_json(const json & j, Noexcept & x); | |
| 5948 | - void to_json(json & j, const Noexcept & x); | |
| 5947 | +void from_json(const json & j, Noexcept & x); | |
| 5948 | +void to_json(json & j, const Noexcept & x); | |
| 5949 | 5949 | |
| 5950 | - void from_json(const json & j, NoneClass & x); | |
| 5951 | - void to_json(json & j, const NoneClass & x); | |
| 5950 | +void from_json(const json & j, NoneClass & x); | |
| 5951 | +void to_json(json & j, const NoneClass & x); | |
| 5952 | 5952 | |
| 5953 | - void from_json(const json & j, Not & x); | |
| 5954 | - void to_json(json & j, const Not & x); | |
| 5953 | +void from_json(const json & j, Not & x); | |
| 5954 | +void to_json(json & j, const Not & x); | |
| 5955 | 5955 | |
| 5956 | - void from_json(const json & j, NotEq & x); | |
| 5957 | - void to_json(json & j, const NotEq & x); | |
| 5956 | +void from_json(const json & j, NotEq & x); | |
| 5957 | +void to_json(json & j, const NotEq & x); | |
| 5958 | 5958 | |
| 5959 | - void from_json(const json & j, NullClass & x); | |
| 5960 | - void to_json(json & j, const NullClass & x); | |
| 5959 | +void from_json(const json & j, NullClass & x); | |
| 5960 | +void to_json(json & j, const NullClass & x); | |
| 5961 | 5961 | |
| 5962 | - void from_json(const json & j, Nullptr & x); | |
| 5963 | - void to_json(json & j, const Nullptr & x); | |
| 5962 | +void from_json(const json & j, Nullptr & x); | |
| 5963 | +void to_json(json & j, const Nullptr & x); | |
| 5964 | 5964 | |
| 5965 | - void from_json(const json & j, Operator & x); | |
| 5966 | - void to_json(json & j, const Operator & x); | |
| 5965 | +void from_json(const json & j, Operator & x); | |
| 5966 | +void to_json(json & j, const Operator & x); | |
| 5967 | 5967 | |
| 5968 | - void from_json(const json & j, Or & x); | |
| 5969 | - void to_json(json & j, const Or & x); | |
| 5968 | +void from_json(const json & j, Or & x); | |
| 5969 | +void to_json(json & j, const Or & x); | |
| 5970 | 5970 | |
| 5971 | - void from_json(const json & j, OrEq & x); | |
| 5972 | - void to_json(json & j, const OrEq & x); | |
| 5971 | +void from_json(const json & j, OrEq & x); | |
| 5972 | +void to_json(json & j, const OrEq & x); | |
| 5973 | 5973 | |
| 5974 | - void from_json(const json & j, Override & x); | |
| 5975 | - void to_json(json & j, const Override & x); | |
| 5974 | +void from_json(const json & j, Override & x); | |
| 5975 | +void to_json(json & j, const Override & x); | |
| 5976 | 5976 | |
| 5977 | - void from_json(const json & j, Private & x); | |
| 5978 | - void to_json(json & j, const Private & x); | |
| 5977 | +void from_json(const json & j, Private & x); | |
| 5978 | +void to_json(json & j, const Private & x); | |
| 5979 | 5979 | |
| 5980 | - void from_json(const json & j, Protected & x); | |
| 5981 | - void to_json(json & j, const Protected & x); | |
| 5980 | +void from_json(const json & j, Protected & x); | |
| 5981 | +void to_json(json & j, const Protected & x); | |
| 5982 | 5982 | |
| 5983 | - void from_json(const json & j, ProtocolClass & x); | |
| 5984 | - void to_json(json & j, const ProtocolClass & x); | |
| 5983 | +void from_json(const json & j, ProtocolClass & x); | |
| 5984 | +void to_json(json & j, const ProtocolClass & x); | |
| 5985 | 5985 | |
| 5986 | - void from_json(const json & j, Object & x); | |
| 5987 | - void to_json(json & j, const Object & x); | |
| 5986 | +void from_json(const json & j, Object & x); | |
| 5987 | +void to_json(json & j, const Object & x); | |
| 5988 | 5988 | |
| 5989 | - void from_json(const json & j, Of & x); | |
| 5990 | - void to_json(json & j, const Of & x); | |
| 5989 | +void from_json(const json & j, Of & x); | |
| 5990 | +void to_json(json & j, const Of & x); | |
| 5991 | 5991 | |
| 5992 | - void from_json(const json & j, Oneway & x); | |
| 5993 | - void to_json(json & j, const Oneway & x); | |
| 5992 | +void from_json(const json & j, Oneway & x); | |
| 5993 | +void to_json(json & j, const Oneway & x); | |
| 5994 | 5994 | |
| 5995 | - void from_json(const json & j, Open & x); | |
| 5996 | - void to_json(json & j, const Open & x); | |
| 5995 | +void from_json(const json & j, Open & x); | |
| 5996 | +void to_json(json & j, const Open & x); | |
| 5997 | 5997 | |
| 5998 | - void from_json(const json & j, Optional & x); | |
| 5999 | - void to_json(json & j, const Optional & x); | |
| 5998 | +void from_json(const json & j, Optional & x); | |
| 5999 | +void to_json(json & j, const Optional & x); | |
| 6000 | 6000 | |
| 6001 | - void from_json(const json & j, Out & x); | |
| 6002 | - void to_json(json & j, const Out & x); | |
| 6001 | +void from_json(const json & j, Out & x); | |
| 6002 | +void to_json(json & j, const Out & x); | |
| 6003 | 6003 | |
| 6004 | - void from_json(const json & j, Package & x); | |
| 6005 | - void to_json(json & j, const Package & x); | |
| 6004 | +void from_json(const json & j, Package & x); | |
| 6005 | +void to_json(json & j, const Package & x); | |
| 6006 | 6006 | |
| 6007 | - void from_json(const json & j, Params & x); | |
| 6008 | - void to_json(json & j, const Params & x); | |
| 6007 | +void from_json(const json & j, Params & x); | |
| 6008 | +void to_json(json & j, const Params & x); | |
| 6009 | 6009 | |
| 6010 | - void from_json(const json & j, Pass & x); | |
| 6011 | - void to_json(json & j, const Pass & x); | |
| 6010 | +void from_json(const json & j, Pass & x); | |
| 6011 | +void to_json(json & j, const Pass & x); | |
| 6012 | 6012 | |
| 6013 | - void from_json(const json & j, Port & x); | |
| 6014 | - void to_json(json & j, const Port & x); | |
| 6013 | +void from_json(const json & j, Port & x); | |
| 6014 | +void to_json(json & j, const Port & x); | |
| 6015 | 6015 | |
| 6016 | - void from_json(const json & j, Postfix & x); | |
| 6017 | - void to_json(json & j, const Postfix & x); | |
| 6016 | +void from_json(const json & j, Postfix & x); | |
| 6017 | +void to_json(json & j, const Postfix & x); | |
| 6018 | 6018 | |
| 6019 | - void from_json(const json & j, Precedence & x); | |
| 6020 | - void to_json(json & j, const Precedence & x); | |
| 6019 | +void from_json(const json & j, Precedence & x); | |
| 6020 | +void to_json(json & j, const Precedence & x); | |
| 6021 | 6021 | |
| 6022 | - void from_json(const json & j, Prefix & x); | |
| 6023 | - void to_json(json & j, const Prefix & x); | |
| 6022 | +void from_json(const json & j, Prefix & x); | |
| 6023 | +void to_json(json & j, const Prefix & x); | |
| 6024 | 6024 | |
| 6025 | - void from_json(const json & j, Print & x); | |
| 6026 | - void to_json(json & j, const Print & x); | |
| 6025 | +void from_json(const json & j, Print & x); | |
| 6026 | +void to_json(json & j, const Print & x); | |
| 6027 | 6027 | |
| 6028 | - void from_json(const json & j, PrintMembers & x); | |
| 6029 | - void to_json(json & j, const PrintMembers & x); | |
| 6028 | +void from_json(const json & j, PrintMembers & x); | |
| 6029 | +void to_json(json & j, const PrintMembers & x); | |
| 6030 | 6030 | |
| 6031 | - void from_json(const json & j, Printf & x); | |
| 6032 | - void to_json(json & j, const Printf & x); | |
| 6031 | +void from_json(const json & j, Printf & x); | |
| 6032 | +void to_json(json & j, const Printf & x); | |
| 6033 | 6033 | |
| 6034 | - void from_json(const json & j, Protocol & x); | |
| 6035 | - void to_json(json & j, const Protocol & x); | |
| 6034 | +void from_json(const json & j, Protocol & x); | |
| 6035 | +void to_json(json & j, const Protocol & x); | |
| 6036 | 6036 | |
| 6037 | - void from_json(const json & j, Obj3 & x); | |
| 6038 | - void to_json(json & j, const Obj3 & x); | |
| 6037 | +void from_json(const json & j, Obj3 & x); | |
| 6038 | +void to_json(json & j, const Obj3 & x); | |
| 6039 | 6039 | |
| 6040 | - void from_json(const json & j, Public & x); | |
| 6041 | - void to_json(json & j, const Public & x); | |
| 6040 | +void from_json(const json & j, Public & x); | |
| 6041 | +void to_json(json & j, const Public & x); | |
| 6042 | 6042 | |
| 6043 | - void from_json(const json & j, Register & x); | |
| 6044 | - void to_json(json & j, const Register & x); | |
| 6043 | +void from_json(const json & j, Register & x); | |
| 6044 | +void to_json(json & j, const Register & x); | |
| 6045 | 6045 | |
| 6046 | - void from_json(const json & j, ReinterpretCast & x); | |
| 6047 | - void to_json(json & j, const ReinterpretCast & x); | |
| 6046 | +void from_json(const json & j, ReinterpretCast & x); | |
| 6047 | +void to_json(json & j, const ReinterpretCast & x); | |
| 6048 | 6048 | |
| 6049 | - void from_json(const json & j, Requires & x); | |
| 6050 | - void to_json(json & j, const Requires & x); | |
| 6049 | +void from_json(const json & j, Requires & x); | |
| 6050 | +void to_json(json & j, const Requires & x); | |
| 6051 | 6051 | |
| 6052 | - void from_json(const json & j, Return & x); | |
| 6053 | - void to_json(json & j, const Return & x); | |
| 6052 | +void from_json(const json & j, Return & x); | |
| 6053 | +void to_json(json & j, const Return & x); | |
| 6054 | 6054 | |
| 6055 | - void from_json(const json & j, SelfClass & x); | |
| 6056 | - void to_json(json & j, const SelfClass & x); | |
| 6055 | +void from_json(const json & j, SelfClass & x); | |
| 6056 | +void to_json(json & j, const SelfClass & x); | |
| 6057 | 6057 | |
| 6058 | - void from_json(const json & j, Short & x); | |
| 6059 | - void to_json(json & j, const Short & x); | |
| 6058 | +void from_json(const json & j, Short & x); | |
| 6059 | +void to_json(json & j, const Short & x); | |
| 6060 | 6060 | |
| 6061 | - void from_json(const json & j, Signed & x); | |
| 6062 | - void to_json(json & j, const Signed & x); | |
| 6061 | +void from_json(const json & j, Signed & x); | |
| 6062 | +void to_json(json & j, const Signed & x); | |
| 6063 | 6063 | |
| 6064 | - void from_json(const json & j, Sizeof & x); | |
| 6065 | - void to_json(json & j, const Sizeof & x); | |
| 6064 | +void from_json(const json & j, Sizeof & x); | |
| 6065 | +void to_json(json & j, const Sizeof & x); | |
| 6066 | 6066 | |
| 6067 | - void from_json(const json & j, Static & x); | |
| 6068 | - void to_json(json & j, const Static & x); | |
| 6067 | +void from_json(const json & j, Static & x); | |
| 6068 | +void to_json(json & j, const Static & x); | |
| 6069 | 6069 | |
| 6070 | - void from_json(const json & j, StaticAssert & x); | |
| 6071 | - void to_json(json & j, const StaticAssert & x); | |
| 6070 | +void from_json(const json & j, StaticAssert & x); | |
| 6071 | +void to_json(json & j, const StaticAssert & x); | |
| 6072 | 6072 | |
| 6073 | - void from_json(const json & j, StaticCast & x); | |
| 6074 | - void to_json(json & j, const StaticCast & x); | |
| 6073 | +void from_json(const json & j, StaticCast & x); | |
| 6074 | +void to_json(json & j, const StaticCast & x); | |
| 6075 | 6075 | |
| 6076 | - void from_json(const json & j, Struct & x); | |
| 6077 | - void to_json(json & j, const Struct & x); | |
| 6076 | +void from_json(const json & j, Struct & x); | |
| 6077 | +void to_json(json & j, const Struct & x); | |
| 6078 | 6078 | |
| 6079 | - void from_json(const json & j, Switch & x); | |
| 6080 | - void to_json(json & j, const Switch & x); | |
| 6079 | +void from_json(const json & j, Switch & x); | |
| 6080 | +void to_json(json & j, const Switch & x); | |
| 6081 | 6081 | |
| 6082 | - void from_json(const json & j, Synchronized & x); | |
| 6083 | - void to_json(json & j, const Synchronized & x); | |
| 6082 | +void from_json(const json & j, Synchronized & x); | |
| 6083 | +void to_json(json & j, const Synchronized & x); | |
| 6084 | 6084 | |
| 6085 | - void from_json(const json & j, Template & x); | |
| 6086 | - void to_json(json & j, const Template & x); | |
| 6085 | +void from_json(const json & j, Template & x); | |
| 6086 | +void to_json(json & j, const Template & x); | |
| 6087 | 6087 | |
| 6088 | - void from_json(const json & j, This & x); | |
| 6089 | - void to_json(json & j, const This & x); | |
| 6088 | +void from_json(const json & j, This & x); | |
| 6089 | +void to_json(json & j, const This & x); | |
| 6090 | 6090 | |
| 6091 | - void from_json(const json & j, ThreadLocal & x); | |
| 6092 | - void to_json(json & j, const ThreadLocal & x); | |
| 6091 | +void from_json(const json & j, ThreadLocal & x); | |
| 6092 | +void to_json(json & j, const ThreadLocal & x); | |
| 6093 | 6093 | |
| 6094 | - void from_json(const json & j, Throw & x); | |
| 6095 | - void to_json(json & j, const Throw & x); | |
| 6094 | +void from_json(const json & j, Throw & x); | |
| 6095 | +void to_json(json & j, const Throw & x); | |
| 6096 | 6096 | |
| 6097 | - void from_json(const json & j, True & x); | |
| 6098 | - void to_json(json & j, const True & x); | |
| 6097 | +void from_json(const json & j, True & x); | |
| 6098 | +void to_json(json & j, const True & x); | |
| 6099 | 6099 | |
| 6100 | - void from_json(const json & j, Try & x); | |
| 6101 | - void to_json(json & j, const Try & x); | |
| 6100 | +void from_json(const json & j, Try & x); | |
| 6101 | +void to_json(json & j, const Try & x); | |
| 6102 | 6102 | |
| 6103 | - void from_json(const json & j, TypeClass & x); | |
| 6104 | - void to_json(json & j, const TypeClass & x); | |
| 6103 | +void from_json(const json & j, TypeClass & x); | |
| 6104 | +void to_json(json & j, const TypeClass & x); | |
| 6105 | 6105 | |
| 6106 | - void from_json(const json & j, Typedef & x); | |
| 6107 | - void to_json(json & j, const Typedef & x); | |
| 6106 | +void from_json(const json & j, Typedef & x); | |
| 6107 | +void to_json(json & j, const Typedef & x); | |
| 6108 | 6108 | |
| 6109 | - void from_json(const json & j, Typeid & x); | |
| 6110 | - void to_json(json & j, const Typeid & x); | |
| 6109 | +void from_json(const json & j, Typeid & x); | |
| 6110 | +void to_json(json & j, const Typeid & x); | |
| 6111 | 6111 | |
| 6112 | - void from_json(const json & j, Typename & x); | |
| 6113 | - void to_json(json & j, const Typename & x); | |
| 6112 | +void from_json(const json & j, Typename & x); | |
| 6113 | +void to_json(json & j, const Typename & x); | |
| 6114 | 6114 | |
| 6115 | - void from_json(const json & j, TrueClass & x); | |
| 6116 | - void to_json(json & j, const TrueClass & x); | |
| 6115 | +void from_json(const json & j, TrueClass & x); | |
| 6116 | +void to_json(json & j, const TrueClass & x); | |
| 6117 | 6117 | |
| 6118 | - void from_json(const json & j, Quicktype & x); | |
| 6119 | - void to_json(json & j, const Quicktype & x); | |
| 6118 | +void from_json(const json & j, Quicktype & x); | |
| 6119 | +void to_json(json & j, const Quicktype & x); | |
| 6120 | 6120 | |
| 6121 | - void from_json(const json & j, Raise & x); | |
| 6122 | - void to_json(json & j, const Raise & x); | |
| 6121 | +void from_json(const json & j, Raise & x); | |
| 6122 | +void to_json(json & j, const Raise & x); | |
| 6123 | 6123 | |
| 6124 | - void from_json(const json & j, Range & x); | |
| 6125 | - void to_json(json & j, const Range & x); | |
| 6124 | +void from_json(const json & j, Range & x); | |
| 6125 | +void to_json(json & j, const Range & x); | |
| 6126 | 6126 | |
| 6127 | - void from_json(const json & j, Readonly & x); | |
| 6128 | - void to_json(json & j, const Readonly & x); | |
| 6127 | +void from_json(const json & j, Readonly & x); | |
| 6128 | +void to_json(json & j, const Readonly & x); | |
| 6129 | 6129 | |
| 6130 | - void from_json(const json & j, Ref & x); | |
| 6131 | - void to_json(json & j, const Ref & x); | |
| 6130 | +void from_json(const json & j, Ref & x); | |
| 6131 | +void to_json(json & j, const Ref & x); | |
| 6132 | 6132 | |
| 6133 | - void from_json(const json & j, Repeat & x); | |
| 6134 | - void to_json(json & j, const Repeat & x); | |
| 6133 | +void from_json(const json & j, Repeat & x); | |
| 6134 | +void to_json(json & j, const Repeat & x); | |
| 6135 | 6135 | |
| 6136 | - void from_json(const json & j, Require & x); | |
| 6137 | - void to_json(json & j, const Require & x); | |
| 6136 | +void from_json(const json & j, Require & x); | |
| 6137 | +void to_json(json & j, const Require & x); | |
| 6138 | 6138 | |
| 6139 | - void from_json(const json & j, Required & x); | |
| 6140 | - void to_json(json & j, const Required & x); | |
| 6139 | +void from_json(const json & j, Required & x); | |
| 6140 | +void to_json(json & j, const Required & x); | |
| 6141 | 6141 | |
| 6142 | - void from_json(const json & j, Restrict & x); | |
| 6143 | - void to_json(json & j, const Restrict & x); | |
| 6142 | +void from_json(const json & j, Restrict & x); | |
| 6143 | +void to_json(json & j, const Restrict & x); | |
| 6144 | 6144 | |
| 6145 | - void from_json(const json & j, Retain & x); | |
| 6146 | - void to_json(json & j, const Retain & x); | |
| 6145 | +void from_json(const json & j, Retain & x); | |
| 6146 | +void to_json(json & j, const Retain & x); | |
| 6147 | 6147 | |
| 6148 | - void from_json(const json & j, Rethrows & x); | |
| 6149 | - void to_json(json & j, const Rethrows & x); | |
| 6148 | +void from_json(const json & j, Rethrows & x); | |
| 6149 | +void to_json(json & j, const Rethrows & x); | |
| 6150 | 6150 | |
| 6151 | - void from_json(const json & j, Right & x); | |
| 6152 | - void to_json(json & j, const Right & x); | |
| 6151 | +void from_json(const json & j, Right & x); | |
| 6152 | +void to_json(json & j, const Right & x); | |
| 6153 | 6153 | |
| 6154 | - void from_json(const json & j, Sbyte & x); | |
| 6155 | - void to_json(json & j, const Sbyte & x); | |
| 6154 | +void from_json(const json & j, Sbyte & x); | |
| 6155 | +void to_json(json & j, const Sbyte & x); | |
| 6156 | 6156 | |
| 6157 | - void from_json(const json & j, Sealed & x); | |
| 6158 | - void to_json(json & j, const Sealed & x); | |
| 6157 | +void from_json(const json & j, Sealed & x); | |
| 6158 | +void to_json(json & j, const Sealed & x); | |
| 6159 | 6159 | |
| 6160 | - void from_json(const json & j, Sel & x); | |
| 6161 | - void to_json(json & j, const Sel & x); | |
| 6160 | +void from_json(const json & j, Sel & x); | |
| 6161 | +void to_json(json & j, const Sel & x); | |
| 6162 | 6162 | |
| 6163 | - void from_json(const json & j, Select & x); | |
| 6164 | - void to_json(json & j, const Select & x); | |
| 6163 | +void from_json(const json & j, Select & x); | |
| 6164 | +void to_json(json & j, const Select & x); | |
| 6165 | 6165 | |
| 6166 | - void from_json(const json & j, Self & x); | |
| 6167 | - void to_json(json & j, const Self & x); | |
| 6166 | +void from_json(const json & j, Self & x); | |
| 6167 | +void to_json(json & j, const Self & x); | |
| 6168 | 6168 | |
| 6169 | - void from_json(const json & j, Serialize & x); | |
| 6170 | - void to_json(json & j, const Serialize & x); | |
| 6169 | +void from_json(const json & j, Serialize & x); | |
| 6170 | +void to_json(json & j, const Serialize & x); | |
| 6171 | 6171 | |
| 6172 | - void from_json(const json & j, Set & x); | |
| 6173 | - void to_json(json & j, const Set & x); | |
| 6172 | +void from_json(const json & j, Set & x); | |
| 6173 | +void to_json(json & j, const Set & x); | |
| 6174 | 6174 | |
| 6175 | - void from_json(const json & j, Stackalloc & x); | |
| 6176 | - void to_json(json & j, const Stackalloc & x); | |
| 6175 | +void from_json(const json & j, Stackalloc & x); | |
| 6176 | +void to_json(json & j, const Stackalloc & x); | |
| 6177 | 6177 | |
| 6178 | - void from_json(const json & j, Strictfp & x); | |
| 6179 | - void to_json(json & j, const Strictfp & x); | |
| 6178 | +void from_json(const json & j, Strictfp & x); | |
| 6179 | +void to_json(json & j, const Strictfp & x); | |
| 6180 | 6180 | |
| 6181 | - void from_json(const json & j, String & x); | |
| 6182 | - void to_json(json & j, const String & x); | |
| 6181 | +void from_json(const json & j, String & x); | |
| 6182 | +void to_json(json & j, const String & x); | |
| 6183 | 6183 | |
| 6184 | - void from_json(const json & j, Subscript & x); | |
| 6185 | - void to_json(json & j, const Subscript & x); | |
| 6184 | +void from_json(const json & j, Subscript & x); | |
| 6185 | +void to_json(json & j, const Subscript & x); | |
| 6186 | 6186 | |
| 6187 | - void from_json(const json & j, Super & x); | |
| 6188 | - void to_json(json & j, const Super & x); | |
| 6187 | +void from_json(const json & j, Super & x); | |
| 6188 | +void to_json(json & j, const Super & x); | |
| 6189 | 6189 | |
| 6190 | - void from_json(const json & j, Symbol & x); | |
| 6191 | - void to_json(json & j, const Symbol & x); | |
| 6190 | +void from_json(const json & j, Symbol & x); | |
| 6191 | +void to_json(json & j, const Symbol & x); | |
| 6192 | 6192 | |
| 6193 | - void from_json(const json & j, System & x); | |
| 6194 | - void to_json(json & j, const System & x); | |
| 6193 | +void from_json(const json & j, System & x); | |
| 6194 | +void to_json(json & j, const System & x); | |
| 6195 | 6195 | |
| 6196 | - void from_json(const json & j, Then & x); | |
| 6197 | - void to_json(json & j, const Then & x); | |
| 6196 | +void from_json(const json & j, Then & x); | |
| 6197 | +void to_json(json & j, const Then & x); | |
| 6198 | 6198 | |
| 6199 | - void from_json(const json & j, Throws & x); | |
| 6200 | - void to_json(json & j, const Throws & x); | |
| 6199 | +void from_json(const json & j, Throws & x); | |
| 6200 | +void to_json(json & j, const Throws & x); | |
| 6201 | 6201 | |
| 6202 | - void from_json(const json & j, ToJson & x); | |
| 6203 | - void to_json(json & j, const ToJson & x); | |
| 6202 | +void from_json(const json & j, ToJson & x); | |
| 6203 | +void to_json(json & j, const ToJson & x); | |
| 6204 | 6204 | |
| 6205 | - void from_json(const json & j, TopLevelClass & x); | |
| 6206 | - void to_json(json & j, const TopLevelClass & x); | |
| 6205 | +void from_json(const json & j, TopLevelClass & x); | |
| 6206 | +void to_json(json & j, const TopLevelClass & x); | |
| 6207 | 6207 | |
| 6208 | - void from_json(const json & j, Transient & x); | |
| 6209 | - void to_json(json & j, const Transient & x); | |
| 6208 | +void from_json(const json & j, Transient & x); | |
| 6209 | +void to_json(json & j, const Transient & x); | |
| 6210 | 6210 | |
| 6211 | - void from_json(const json & j, Type & x); | |
| 6212 | - void to_json(json & j, const Type & x); | |
| 6211 | +void from_json(const json & j, Type & x); | |
| 6212 | +void to_json(json & j, const Type & x); | |
| 6213 | 6213 | |
| 6214 | - void from_json(const json & j, Typealias & x); | |
| 6215 | - void to_json(json & j, const Typealias & x); | |
| 6214 | +void from_json(const json & j, Typealias & x); | |
| 6215 | +void to_json(json & j, const Typealias & x); | |
| 6216 | 6216 | |
| 6217 | - void from_json(const json & j, Typeof & x); | |
| 6218 | - void to_json(json & j, const Typeof & x); | |
| 6217 | +void from_json(const json & j, Typeof & x); | |
| 6218 | +void to_json(json & j, const Typeof & x); | |
| 6219 | 6219 | |
| 6220 | - void from_json(const json & j, Uint & x); | |
| 6221 | - void to_json(json & j, const Uint & x); | |
| 6220 | +void from_json(const json & j, Uint & x); | |
| 6221 | +void to_json(json & j, const Uint & x); | |
| 6222 | 6222 | |
| 6223 | - void from_json(const json & j, Ulong & x); | |
| 6224 | - void to_json(json & j, const Ulong & x); | |
| 6223 | +void from_json(const json & j, Ulong & x); | |
| 6224 | +void to_json(json & j, const Ulong & x); | |
| 6225 | 6225 | |
| 6226 | - void from_json(const json & j, Unchecked & x); | |
| 6227 | - void to_json(json & j, const Unchecked & x); | |
| 6226 | +void from_json(const json & j, Unchecked & x); | |
| 6227 | +void to_json(json & j, const Unchecked & x); | |
| 6228 | 6228 | |
| 6229 | - void from_json(const json & j, Undefined & x); | |
| 6230 | - void to_json(json & j, const Undefined & x); | |
| 6229 | +void from_json(const json & j, Undefined & x); | |
| 6230 | +void to_json(json & j, const Undefined & x); | |
| 6231 | 6231 | |
| 6232 | - void from_json(const json & j, Obj4 & x); | |
| 6233 | - void to_json(json & j, const Obj4 & x); | |
| 6232 | +void from_json(const json & j, Obj4 & x); | |
| 6233 | +void to_json(json & j, const Obj4 & x); | |
| 6234 | 6234 | |
| 6235 | - void from_json(const json & j, Union & x); | |
| 6236 | - void to_json(json & j, const Union & x); | |
| 6235 | +void from_json(const json & j, Union & x); | |
| 6236 | +void to_json(json & j, const Union & x); | |
| 6237 | 6237 | |
| 6238 | - void from_json(const json & j, Unsigned & x); | |
| 6239 | - void to_json(json & j, const Unsigned & x); | |
| 6238 | +void from_json(const json & j, Unsigned & x); | |
| 6239 | +void to_json(json & j, const Unsigned & x); | |
| 6240 | 6240 | |
| 6241 | - void from_json(const json & j, Using & x); | |
| 6242 | - void to_json(json & j, const Using & x); | |
| 6241 | +void from_json(const json & j, Using & x); | |
| 6242 | +void to_json(json & j, const Using & x); | |
| 6243 | 6243 | |
| 6244 | - void from_json(const json & j, Virtual & x); | |
| 6245 | - void to_json(json & j, const Virtual & x); | |
| 6244 | +void from_json(const json & j, Virtual & x); | |
| 6245 | +void to_json(json & j, const Virtual & x); | |
| 6246 | 6246 | |
| 6247 | - void from_json(const json & j, Void & x); | |
| 6248 | - void to_json(json & j, const Void & x); | |
| 6247 | +void from_json(const json & j, Void & x); | |
| 6248 | +void to_json(json & j, const Void & x); | |
| 6249 | 6249 | |
| 6250 | - void from_json(const json & j, Volatile & x); | |
| 6251 | - void to_json(json & j, const Volatile & x); | |
| 6250 | +void from_json(const json & j, Volatile & x); | |
| 6251 | +void to_json(json & j, const Volatile & x); | |
| 6252 | 6252 | |
| 6253 | - void from_json(const json & j, WcharT & x); | |
| 6254 | - void to_json(json & j, const WcharT & x); | |
| 6253 | +void from_json(const json & j, WcharT & x); | |
| 6254 | +void to_json(json & j, const WcharT & x); | |
| 6255 | 6255 | |
| 6256 | - void from_json(const json & j, While & x); | |
| 6257 | - void to_json(json & j, const While & x); | |
| 6256 | +void from_json(const json & j, While & x); | |
| 6257 | +void to_json(json & j, const While & x); | |
| 6258 | 6258 | |
| 6259 | - void from_json(const json & j, Xor & x); | |
| 6260 | - void to_json(json & j, const Xor & x); | |
| 6259 | +void from_json(const json & j, Xor & x); | |
| 6260 | +void to_json(json & j, const Xor & x); | |
| 6261 | 6261 | |
| 6262 | - void from_json(const json & j, XorEq & x); | |
| 6263 | - void to_json(json & j, const XorEq & x); | |
| 6262 | +void from_json(const json & j, XorEq & x); | |
| 6263 | +void to_json(json & j, const XorEq & x); | |
| 6264 | 6264 | |
| 6265 | - void from_json(const json & j, Unowned & x); | |
| 6266 | - void to_json(json & j, const Unowned & x); | |
| 6265 | +void from_json(const json & j, Unowned & x); | |
| 6266 | +void to_json(json & j, const Unowned & x); | |
| 6267 | 6267 | |
| 6268 | - void from_json(const json & j, Unsafe & x); | |
| 6269 | - void to_json(json & j, const Unsafe & x); | |
| 6268 | +void from_json(const json & j, Unsafe & x); | |
| 6269 | +void to_json(json & j, const Unsafe & x); | |
| 6270 | 6270 | |
| 6271 | - void from_json(const json & j, Ushort & x); | |
| 6272 | - void to_json(json & j, const Ushort & x); | |
| 6271 | +void from_json(const json & j, Ushort & x); | |
| 6272 | +void to_json(json & j, const Ushort & x); | |
| 6273 | 6273 | |
| 6274 | - void from_json(const json & j, Var & x); | |
| 6275 | - void to_json(json & j, const Var & x); | |
| 6274 | +void from_json(const json & j, Var & x); | |
| 6275 | +void to_json(json & j, const Var & x); | |
| 6276 | 6276 | |
| 6277 | - void from_json(const json & j, Weak & x); | |
| 6278 | - void to_json(json & j, const Weak & x); | |
| 6277 | +void from_json(const json & j, Weak & x); | |
| 6278 | +void to_json(json & j, const Weak & x); | |
| 6279 | 6279 | |
| 6280 | - void from_json(const json & j, Where & x); | |
| 6281 | - void to_json(json & j, const Where & x); | |
| 6280 | +void from_json(const json & j, Where & x); | |
| 6281 | +void to_json(json & j, const Where & x); | |
| 6282 | 6282 | |
| 6283 | - void from_json(const json & j, WillSet & x); | |
| 6284 | - void to_json(json & j, const WillSet & x); | |
| 6283 | +void from_json(const json & j, WillSet & x); | |
| 6284 | +void to_json(json & j, const WillSet & x); | |
| 6285 | 6285 | |
| 6286 | - void from_json(const json & j, With & x); | |
| 6287 | - void to_json(json & j, const With & x); | |
| 6286 | +void from_json(const json & j, With & x); | |
| 6287 | +void to_json(json & j, const With & x); | |
| 6288 | 6288 | |
| 6289 | - void from_json(const json & j, Yes & x); | |
| 6290 | - void to_json(json & j, const Yes & x); | |
| 6289 | +void from_json(const json & j, Yes & x); | |
| 6290 | +void to_json(json & j, const Yes & x); | |
| 6291 | 6291 | |
| 6292 | - void from_json(const json & j, Yield & x); | |
| 6293 | - void to_json(json & j, const Yield & x); | |
| 6292 | +void from_json(const json & j, Yield & x); | |
| 6293 | +void to_json(json & j, const Yield & x); | |
| 6294 | 6294 | |
| 6295 | - void from_json(const json & j, Obj5 & x); | |
| 6296 | - void to_json(json & j, const Obj5 & x); | |
| 6297 | - | |
| 6298 | - void from_json(const json & j, TopLevel & x); | |
| 6299 | - void to_json(json & j, const TopLevel & x); | |
| 6295 | +void from_json(const json & j, Obj5 & x); | |
| 6296 | +void to_json(json & j, const Obj5 & x); | |
| 6300 | 6297 | |
| 6298 | +void from_json(const json & j, TopLevel & x); | |
| 6299 | +void to_json(json & j, const TopLevel & x); | |
| 6300 | +} | |
| 6301 | +namespace quicktype { | |
| 6301 | 6302 | inline void from_json(const json & j, Abstract& x) { |
| 6302 | 6303 | x.set_abstract(j.at("abstract").get<int64_t>()); |
| 6303 | 6304 | } |
Test case
1 generated file · +6 −5test/inputs/json/priority/kotlin-enum-class-case-collision.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -51,12 +51,13 @@ namespace quicktype { | ||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | namespace quicktype { |
| 54 | - void from_json(const json & j, TopLevelElement & x); | |
| 55 | - void to_json(json & j, const TopLevelElement & x); | |
| 56 | - | |
| 57 | - void from_json(const json & j, Category & x); | |
| 58 | - void to_json(json & j, const Category & x); | |
| 54 | +void from_json(const json & j, TopLevelElement & x); | |
| 55 | +void to_json(json & j, const TopLevelElement & x); | |
| 59 | 56 | |
| 57 | +void from_json(const json & j, Category & x); | |
| 58 | +void to_json(json & j, const Category & x); | |
| 59 | +} | |
| 60 | +namespace quicktype { | |
| 60 | 61 | inline void from_json(const json & j, TopLevelElement& x) { |
| 61 | 62 | x.set_category(j.at("category").get<Category>()); |
| 62 | 63 | } |
Test case
1 generated file · +4 −3test/inputs/json/priority/list.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -107,9 +107,10 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_data(j.at("data").get<int64_t>()); |
| 115 | 116 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
Test case
1 generated file · +4 −3test/inputs/json/priority/name-style.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -77,9 +77,10 @@ namespace quicktype { | ||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | namespace quicktype { |
| 80 | - void from_json(const json & j, TopLevel & x); | |
| 81 | - void to_json(json & j, const TopLevel & x); | |
| 82 | - | |
| 80 | +void from_json(const json & j, TopLevel & x); | |
| 81 | +void to_json(json & j, const TopLevel & x); | |
| 82 | +} | |
| 83 | +namespace quicktype { | |
| 83 | 84 | inline void from_json(const json & j, TopLevel& x) { |
| 84 | 85 | x.set_an_easy_one(j.at("anEasyOne").get<int64_t>()); |
| 85 | 86 | x.set_is_mnist_letter(j.at("isMNISTLetter").get<bool>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/nested-objects.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_a(j.at("a").get<std::map<std::string, int64_t>>()); |
| 60 | 61 | x.set_b(j.at("b").get<std::map<std::string, int64_t>>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/number-map.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_foo(j.at("foo").get<std::map<std::string, double>>()); |
| 55 | 56 | } |
Test case
1 generated file · +6 −5test/inputs/json/priority/omit-empty.json
Mcplusplusdefault / quicktype.hpp+6 −5
| @@ -123,12 +123,13 @@ namespace quicktype { | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | namespace quicktype { |
| 126 | - void from_json(const json & j, Result & x); | |
| 127 | - void to_json(json & j, const Result & x); | |
| 128 | - | |
| 129 | - void from_json(const json & j, TopLevel & x); | |
| 130 | - void to_json(json & j, const TopLevel & x); | |
| 126 | +void from_json(const json & j, Result & x); | |
| 127 | +void to_json(json & j, const Result & x); | |
| 131 | 128 | |
| 129 | +void from_json(const json & j, TopLevel & x); | |
| 130 | +void to_json(json & j, const TopLevel & x); | |
| 131 | +} | |
| 132 | +namespace quicktype { | |
| 132 | 133 | inline void from_json(const json & j, Result& x) { |
| 133 | 134 | x.set_age(j.at("age").get<int64_t>()); |
| 134 | 135 | x.set_name(get_untyped(j, "name")); |
Test case
1 generated file · +4 −3test/inputs/json/priority/php-validation.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -67,9 +67,10 @@ namespace quicktype { | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | namespace quicktype { |
| 70 | - void from_json(const json & j, TopLevel & x); | |
| 71 | - void to_json(json & j, const TopLevel & x); | |
| 72 | - | |
| 70 | +void from_json(const json & j, TopLevel & x); | |
| 71 | +void to_json(json & j, const TopLevel & x); | |
| 72 | +} | |
| 73 | +namespace quicktype { | |
| 73 | 74 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 75 | x.set_boolean(j.at("boolean").get<bool>()); |
| 75 | 76 | x.set_integer(j.at("integer").get<int64_t>()); |
Test case
1 generated file · +36 −35test/inputs/json/priority/recursive.json
Mcplusplusdefault / quicktype.hpp+36 −35
| @@ -607,57 +607,58 @@ namespace quicktype { | ||
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | namespace quicktype { |
| 610 | - void from_json(const json & j, LinkLink & x); | |
| 611 | - void to_json(json & j, const LinkLink & x); | |
| 610 | +void from_json(const json & j, LinkLink & x); | |
| 611 | +void to_json(json & j, const LinkLink & x); | |
| 612 | 612 | |
| 613 | - void from_json(const json & j, LinkElement & x); | |
| 614 | - void to_json(json & j, const LinkElement & x); | |
| 613 | +void from_json(const json & j, LinkElement & x); | |
| 614 | +void to_json(json & j, const LinkElement & x); | |
| 615 | 615 | |
| 616 | - void from_json(const json & j, CategoryThumbnail & x); | |
| 617 | - void to_json(json & j, const CategoryThumbnail & x); | |
| 616 | +void from_json(const json & j, CategoryThumbnail & x); | |
| 617 | +void to_json(json & j, const CategoryThumbnail & x); | |
| 618 | 618 | |
| 619 | - void from_json(const json & j, Category & x); | |
| 620 | - void to_json(json & j, const Category & x); | |
| 619 | +void from_json(const json & j, Category & x); | |
| 620 | +void to_json(json & j, const Category & x); | |
| 621 | 621 | |
| 622 | - void from_json(const json & j, Eonandyear & x); | |
| 623 | - void to_json(json & j, const Eonandyear & x); | |
| 622 | +void from_json(const json & j, Eonandyear & x); | |
| 623 | +void to_json(json & j, const Eonandyear & x); | |
| 624 | 624 | |
| 625 | - void from_json(const json & j, Xmlschematype & x); | |
| 626 | - void to_json(json & j, const Xmlschematype & x); | |
| 625 | +void from_json(const json & j, Xmlschematype & x); | |
| 626 | +void to_json(json & j, const Xmlschematype & x); | |
| 627 | 627 | |
| 628 | - void from_json(const json & j, Date & x); | |
| 629 | - void to_json(json & j, const Date & x); | |
| 628 | +void from_json(const json & j, Date & x); | |
| 629 | +void to_json(json & j, const Date & x); | |
| 630 | 630 | |
| 631 | - void from_json(const json & j, Details & x); | |
| 632 | - void to_json(json & j, const Details & x); | |
| 631 | +void from_json(const json & j, Details & x); | |
| 632 | +void to_json(json & j, const Details & x); | |
| 633 | 633 | |
| 634 | - void from_json(const json & j, Currency & x); | |
| 635 | - void to_json(json & j, const Currency & x); | |
| 634 | +void from_json(const json & j, Currency & x); | |
| 635 | +void to_json(json & j, const Currency & x); | |
| 636 | 636 | |
| 637 | - void from_json(const json & j, Useraveragerating & x); | |
| 638 | - void to_json(json & j, const Useraveragerating & x); | |
| 637 | +void from_json(const json & j, Useraveragerating & x); | |
| 638 | +void to_json(json & j, const Useraveragerating & x); | |
| 639 | 639 | |
| 640 | - void from_json(const json & j, Rating & x); | |
| 641 | - void to_json(json & j, const Rating & x); | |
| 640 | +void from_json(const json & j, Rating & x); | |
| 641 | +void to_json(json & j, const Rating & x); | |
| 642 | 642 | |
| 643 | - void from_json(const json & j, Specification & x); | |
| 644 | - void to_json(json & j, const Specification & x); | |
| 643 | +void from_json(const json & j, Specification & x); | |
| 644 | +void to_json(json & j, const Specification & x); | |
| 645 | 645 | |
| 646 | - void from_json(const json & j, Format & x); | |
| 647 | - void to_json(json & j, const Format & x); | |
| 646 | +void from_json(const json & j, Format & x); | |
| 647 | +void to_json(json & j, const Format & x); | |
| 648 | 648 | |
| 649 | - void from_json(const json & j, FormatsClass & x); | |
| 650 | - void to_json(json & j, const FormatsClass & x); | |
| 649 | +void from_json(const json & j, FormatsClass & x); | |
| 650 | +void to_json(json & j, const FormatsClass & x); | |
| 651 | 651 | |
| 652 | - void from_json(const json & j, ProductProduct & x); | |
| 653 | - void to_json(json & j, const ProductProduct & x); | |
| 652 | +void from_json(const json & j, ProductProduct & x); | |
| 653 | +void to_json(json & j, const ProductProduct & x); | |
| 654 | 654 | |
| 655 | - void from_json(const json & j, ProductElement & x); | |
| 656 | - void to_json(json & j, const ProductElement & x); | |
| 657 | - | |
| 658 | - void from_json(const json & j, TopLevel & x); | |
| 659 | - void to_json(json & j, const TopLevel & x); | |
| 655 | +void from_json(const json & j, ProductElement & x); | |
| 656 | +void to_json(json & j, const ProductElement & x); | |
| 660 | 657 | |
| 658 | +void from_json(const json & j, TopLevel & x); | |
| 659 | +void to_json(json & j, const TopLevel & x); | |
| 660 | +} | |
| 661 | +namespace quicktype { | |
| 661 | 662 | inline void from_json(const json & j, LinkLink& x) { |
| 662 | 663 | x.set_type(j.at("type").get<std::string>()); |
| 663 | 664 | x.set_url(j.at("url").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/simple-identifiers.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -87,9 +87,10 @@ namespace quicktype { | ||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | namespace quicktype { |
| 90 | - void from_json(const json & j, TopLevel & x); | |
| 91 | - void to_json(json & j, const TopLevel & x); | |
| 92 | - | |
| 90 | +void from_json(const json & j, TopLevel & x); | |
| 91 | +void to_json(json & j, const TopLevel & x); | |
| 92 | +} | |
| 93 | +namespace quicktype { | |
| 93 | 94 | inline void from_json(const json & j, TopLevel& x) { |
| 94 | 95 | x.set_empty(j.at("").get<std::string>()); |
| 95 | 96 | x.set_null(j.at("null").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/url.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_from_url(j.at("fromURL").get<std::string>()); |
| 60 | 61 | x.set_url(j.at("url").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/priority/uuids.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -72,9 +72,10 @@ namespace quicktype { | ||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | namespace quicktype { |
| 75 | - void from_json(const json & j, TopLevel & x); | |
| 76 | - void to_json(json & j, const TopLevel & x); | |
| 77 | - | |
| 75 | +void from_json(const json & j, TopLevel & x); | |
| 76 | +void to_json(json & j, const TopLevel & x); | |
| 77 | +} | |
| 78 | +namespace quicktype { | |
| 78 | 79 | inline void from_json(const json & j, TopLevel& x) { |
| 79 | 80 | x.set_boolean_value(j.at("booleanValue").get<bool>()); |
| 80 | 81 | x.set_double_value(j.at("doubleValue").get<double>()); |
Test case
1 generated file · +4 −3test/inputs/json/samples/bitcoin-block.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -67,9 +67,10 @@ namespace quicktype { | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | namespace quicktype { |
| 70 | - void from_json(const json & j, TopLevel & x); | |
| 71 | - void to_json(json & j, const TopLevel & x); | |
| 72 | - | |
| 70 | +void from_json(const json & j, TopLevel & x); | |
| 71 | +void to_json(json & j, const TopLevel & x); | |
| 72 | +} | |
| 73 | +namespace quicktype { | |
| 73 | 74 | inline void from_json(const json & j, TopLevel& x) { |
| 74 | 75 | x.set_block_index(j.at("block_index").get<int64_t>()); |
| 75 | 76 | x.set_hash(j.at("hash").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/json/samples/getting-started.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_greeting(j.at("greeting").get<std::string>()); |
| 60 | 61 | x.set_instructions(j.at("instructions").get<std::vector<std::string>>()); |
Test case
1 generated file · +38 −37test/inputs/json/samples/github-events.json
Mcplusplusdefault / quicktype.hpp+38 −37
| @@ -1419,60 +1419,61 @@ namespace quicktype { | ||
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | namespace quicktype { |
| 1422 | - void from_json(const json & j, Actor & x); | |
| 1423 | - void to_json(json & j, const Actor & x); | |
| 1422 | +void from_json(const json & j, Actor & x); | |
| 1423 | +void to_json(json & j, const Actor & x); | |
| 1424 | 1424 | |
| 1425 | - void from_json(const json & j, User & x); | |
| 1426 | - void to_json(json & j, const User & x); | |
| 1425 | +void from_json(const json & j, User & x); | |
| 1426 | +void to_json(json & j, const User & x); | |
| 1427 | 1427 | |
| 1428 | - void from_json(const json & j, Comment & x); | |
| 1429 | - void to_json(json & j, const Comment & x); | |
| 1428 | +void from_json(const json & j, Comment & x); | |
| 1429 | +void to_json(json & j, const Comment & x); | |
| 1430 | 1430 | |
| 1431 | - void from_json(const json & j, Author & x); | |
| 1432 | - void to_json(json & j, const Author & x); | |
| 1431 | +void from_json(const json & j, Author & x); | |
| 1432 | +void to_json(json & j, const Author & x); | |
| 1433 | 1433 | |
| 1434 | - void from_json(const json & j, Commit & x); | |
| 1435 | - void to_json(json & j, const Commit & x); | |
| 1434 | +void from_json(const json & j, Commit & x); | |
| 1435 | +void to_json(json & j, const Commit & x); | |
| 1436 | 1436 | |
| 1437 | - void from_json(const json & j, Label & x); | |
| 1438 | - void to_json(json & j, const Label & x); | |
| 1437 | +void from_json(const json & j, Label & x); | |
| 1438 | +void to_json(json & j, const Label & x); | |
| 1439 | 1439 | |
| 1440 | - void from_json(const json & j, Milestone & x); | |
| 1441 | - void to_json(json & j, const Milestone & x); | |
| 1440 | +void from_json(const json & j, Milestone & x); | |
| 1441 | +void to_json(json & j, const Milestone & x); | |
| 1442 | 1442 | |
| 1443 | - void from_json(const json & j, IssuePullRequest & x); | |
| 1444 | - void to_json(json & j, const IssuePullRequest & x); | |
| 1443 | +void from_json(const json & j, IssuePullRequest & x); | |
| 1444 | +void to_json(json & j, const IssuePullRequest & x); | |
| 1445 | 1445 | |
| 1446 | - void from_json(const json & j, Issue & x); | |
| 1447 | - void to_json(json & j, const Issue & x); | |
| 1446 | +void from_json(const json & j, Issue & x); | |
| 1447 | +void to_json(json & j, const Issue & x); | |
| 1448 | 1448 | |
| 1449 | - void from_json(const json & j, BaseRepo & x); | |
| 1450 | - void to_json(json & j, const BaseRepo & x); | |
| 1449 | +void from_json(const json & j, BaseRepo & x); | |
| 1450 | +void to_json(json & j, const BaseRepo & x); | |
| 1451 | 1451 | |
| 1452 | - void from_json(const json & j, Base & x); | |
| 1453 | - void to_json(json & j, const Base & x); | |
| 1452 | +void from_json(const json & j, Base & x); | |
| 1453 | +void to_json(json & j, const Base & x); | |
| 1454 | 1454 | |
| 1455 | - void from_json(const json & j, Comments & x); | |
| 1456 | - void to_json(json & j, const Comments & x); | |
| 1455 | +void from_json(const json & j, Comments & x); | |
| 1456 | +void to_json(json & j, const Comments & x); | |
| 1457 | 1457 | |
| 1458 | - void from_json(const json & j, Links & x); | |
| 1459 | - void to_json(json & j, const Links & x); | |
| 1458 | +void from_json(const json & j, Links & x); | |
| 1459 | +void to_json(json & j, const Links & x); | |
| 1460 | 1460 | |
| 1461 | - void from_json(const json & j, PayloadPullRequest & x); | |
| 1462 | - void to_json(json & j, const PayloadPullRequest & x); | |
| 1461 | +void from_json(const json & j, PayloadPullRequest & x); | |
| 1462 | +void to_json(json & j, const PayloadPullRequest & x); | |
| 1463 | 1463 | |
| 1464 | - void from_json(const json & j, Payload & x); | |
| 1465 | - void to_json(json & j, const Payload & x); | |
| 1464 | +void from_json(const json & j, Payload & x); | |
| 1465 | +void to_json(json & j, const Payload & x); | |
| 1466 | 1466 | |
| 1467 | - void from_json(const json & j, TopLevelRepo & x); | |
| 1468 | - void to_json(json & j, const TopLevelRepo & x); | |
| 1467 | +void from_json(const json & j, TopLevelRepo & x); | |
| 1468 | +void to_json(json & j, const TopLevelRepo & x); | |
| 1469 | 1469 | |
| 1470 | - void from_json(const json & j, TopLevelElement & x); | |
| 1471 | - void to_json(json & j, const TopLevelElement & x); | |
| 1472 | - | |
| 1473 | - void from_json(const json & j, Type & x); | |
| 1474 | - void to_json(json & j, const Type & x); | |
| 1470 | +void from_json(const json & j, TopLevelElement & x); | |
| 1471 | +void to_json(json & j, const TopLevelElement & x); | |
| 1475 | 1472 | |
| 1473 | +void from_json(const json & j, Type & x); | |
| 1474 | +void to_json(json & j, const Type & x); | |
| 1475 | +} | |
| 1476 | +namespace quicktype { | |
| 1476 | 1477 | inline void from_json(const json & j, Actor& x) { |
| 1477 | 1478 | x.set_avatar_url(j.at("avatar_url").get<std::string>()); |
| 1478 | 1479 | x.set_display_login(get_stack_optional<std::string>(j, "display_login")); |
Test case
1 generated file · +8 −7test/inputs/json/samples/null-safe.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -156,15 +156,16 @@ namespace quicktype { | ||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | namespace quicktype { |
| 159 | - void from_json(const json & j, Address & x); | |
| 160 | - void to_json(json & j, const Address & x); | |
| 159 | +void from_json(const json & j, Address & x); | |
| 160 | +void to_json(json & j, const Address & x); | |
| 161 | 161 | |
| 162 | - void from_json(const json & j, Item & x); | |
| 163 | - void to_json(json & j, const Item & x); | |
| 164 | - | |
| 165 | - void from_json(const json & j, TopLevel & x); | |
| 166 | - void to_json(json & j, const TopLevel & x); | |
| 162 | +void from_json(const json & j, Item & x); | |
| 163 | +void to_json(json & j, const Item & x); | |
| 167 | 164 | |
| 165 | +void from_json(const json & j, TopLevel & x); | |
| 166 | +void to_json(json & j, const TopLevel & x); | |
| 167 | +} | |
| 168 | +namespace quicktype { | |
| 168 | 169 | inline void from_json(const json & j, Address& x) { |
| 169 | 170 | x.set_city(j.at("city").get<std::string>()); |
| 170 | 171 | x.set_country(j.at("country").get<std::string>()); |
Test case
3 generated files · +36 −33test/inputs/json/samples/pokedex.json
Mcplusplus-multi-sourcedefault / Generators.hpp+12 −11
| @@ -19,21 +19,22 @@ | ||
| 19 | 19 | #include "Egg.hpp" |
| 20 | 20 | |
| 21 | 21 | namespace quicktype { |
| 22 | - void from_json(const json & j, Evolution & x); | |
| 23 | - void to_json(json & j, const Evolution & x); | |
| 22 | +void from_json(const json & j, Evolution & x); | |
| 23 | +void to_json(json & j, const Evolution & x); | |
| 24 | 24 | |
| 25 | - void from_json(const json & j, Pokemon & x); | |
| 26 | - void to_json(json & j, const Pokemon & x); | |
| 25 | +void from_json(const json & j, Pokemon & x); | |
| 26 | +void to_json(json & j, const Pokemon & x); | |
| 27 | 27 | |
| 28 | - void from_json(const json & j, TopLevel & x); | |
| 29 | - void to_json(json & j, const TopLevel & x); | |
| 28 | +void from_json(const json & j, TopLevel & x); | |
| 29 | +void to_json(json & j, const TopLevel & x); | |
| 30 | 30 | |
| 31 | - void from_json(const json & j, Egg & x); | |
| 32 | - void to_json(json & j, const Egg & x); | |
| 33 | - | |
| 34 | - void from_json(const json & j, Type & x); | |
| 35 | - void to_json(json & j, const Type & x); | |
| 31 | +void from_json(const json & j, Egg & x); | |
| 32 | +void to_json(json & j, const Egg & x); | |
| 36 | 33 | |
| 34 | +void from_json(const json & j, Type & x); | |
| 35 | +void to_json(json & j, const Type & x); | |
| 36 | +} | |
| 37 | +namespace quicktype { | |
| 37 | 38 | inline void from_json(const json & j, Evolution& x) { |
| 38 | 39 | x.set_name(j.at("name").get<std::string>()); |
| 39 | 40 | x.set_num(j.at("num").get<std::string>()); |
Mcplusplusboost-true--bed8626e10e6 / quicktype.hpp+12 −11
| @@ -222,21 +222,22 @@ namespace quicktype { | ||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | namespace quicktype { |
| 225 | - void from_json(const json & j, Evolution & x); | |
| 226 | - void to_json(json & j, const Evolution & x); | |
| 225 | +void from_json(const json & j, Evolution & x); | |
| 226 | +void to_json(json & j, const Evolution & x); | |
| 227 | 227 | |
| 228 | - void from_json(const json & j, Pokemon & x); | |
| 229 | - void to_json(json & j, const Pokemon & x); | |
| 228 | +void from_json(const json & j, Pokemon & x); | |
| 229 | +void to_json(json & j, const Pokemon & x); | |
| 230 | 230 | |
| 231 | - void from_json(const json & j, TopLevel & x); | |
| 232 | - void to_json(json & j, const TopLevel & x); | |
| 231 | +void from_json(const json & j, TopLevel & x); | |
| 232 | +void to_json(json & j, const TopLevel & x); | |
| 233 | 233 | |
| 234 | - void from_json(const json & j, Egg & x); | |
| 235 | - void to_json(json & j, const Egg & x); | |
| 236 | - | |
| 237 | - void from_json(const json & j, Type & x); | |
| 238 | - void to_json(json & j, const Type & x); | |
| 234 | +void from_json(const json & j, Egg & x); | |
| 235 | +void to_json(json & j, const Egg & x); | |
| 239 | 236 | |
| 237 | +void from_json(const json & j, Type & x); | |
| 238 | +void to_json(json & j, const Type & x); | |
| 239 | +} | |
| 240 | +namespace quicktype { | |
| 240 | 241 | inline void from_json(const json & j, Evolution& x) { |
| 241 | 242 | x.set_name(j.at("name").get<std::string>()); |
| 242 | 243 | x.set_num(j.at("num").get<std::string>()); |
Mcplusplusdefault / quicktype.hpp+12 −11
| @@ -221,21 +221,22 @@ namespace quicktype { | ||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | namespace quicktype { |
| 224 | - void from_json(const json & j, Evolution & x); | |
| 225 | - void to_json(json & j, const Evolution & x); | |
| 224 | +void from_json(const json & j, Evolution & x); | |
| 225 | +void to_json(json & j, const Evolution & x); | |
| 226 | 226 | |
| 227 | - void from_json(const json & j, Pokemon & x); | |
| 228 | - void to_json(json & j, const Pokemon & x); | |
| 227 | +void from_json(const json & j, Pokemon & x); | |
| 228 | +void to_json(json & j, const Pokemon & x); | |
| 229 | 229 | |
| 230 | - void from_json(const json & j, TopLevel & x); | |
| 231 | - void to_json(json & j, const TopLevel & x); | |
| 230 | +void from_json(const json & j, TopLevel & x); | |
| 231 | +void to_json(json & j, const TopLevel & x); | |
| 232 | 232 | |
| 233 | - void from_json(const json & j, Egg & x); | |
| 234 | - void to_json(json & j, const Egg & x); | |
| 235 | - | |
| 236 | - void from_json(const json & j, Type & x); | |
| 237 | - void to_json(json & j, const Type & x); | |
| 233 | +void from_json(const json & j, Egg & x); | |
| 234 | +void to_json(json & j, const Egg & x); | |
| 238 | 235 | |
| 236 | +void from_json(const json & j, Type & x); | |
| 237 | +void to_json(json & j, const Type & x); | |
| 238 | +} | |
| 239 | +namespace quicktype { | |
| 239 | 240 | inline void from_json(const json & j, Evolution& x) { |
| 240 | 241 | x.set_name(j.at("name").get<std::string>()); |
| 241 | 242 | x.set_num(j.at("num").get<std::string>()); |
Test case
1 generated file · +38 −37test/inputs/json/samples/reddit.json
Mcplusplusdefault / quicktype.hpp+38 −37
| @@ -627,60 +627,61 @@ namespace quicktype { | ||
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | namespace quicktype { |
| 630 | - void from_json(const json & j, MediaEmbed & x); | |
| 631 | - void to_json(json & j, const MediaEmbed & x); | |
| 630 | +void from_json(const json & j, MediaEmbed & x); | |
| 631 | +void to_json(json & j, const MediaEmbed & x); | |
| 632 | 632 | |
| 633 | - void from_json(const json & j, Source & x); | |
| 634 | - void to_json(json & j, const Source & x); | |
| 633 | +void from_json(const json & j, Source & x); | |
| 634 | +void to_json(json & j, const Source & x); | |
| 635 | 635 | |
| 636 | - void from_json(const json & j, Gif & x); | |
| 637 | - void to_json(json & j, const Gif & x); | |
| 636 | +void from_json(const json & j, Gif & x); | |
| 637 | +void to_json(json & j, const Gif & x); | |
| 638 | 638 | |
| 639 | - void from_json(const json & j, Variants & x); | |
| 640 | - void to_json(json & j, const Variants & x); | |
| 639 | +void from_json(const json & j, Variants & x); | |
| 640 | +void to_json(json & j, const Variants & x); | |
| 641 | 641 | |
| 642 | - void from_json(const json & j, Image & x); | |
| 643 | - void to_json(json & j, const Image & x); | |
| 642 | +void from_json(const json & j, Image & x); | |
| 643 | +void to_json(json & j, const Image & x); | |
| 644 | 644 | |
| 645 | - void from_json(const json & j, Preview & x); | |
| 646 | - void to_json(json & j, const Preview & x); | |
| 645 | +void from_json(const json & j, Preview & x); | |
| 646 | +void to_json(json & j, const Preview & x); | |
| 647 | 647 | |
| 648 | - void from_json(const json & j, ChildData & x); | |
| 649 | - void to_json(json & j, const ChildData & x); | |
| 648 | +void from_json(const json & j, ChildData & x); | |
| 649 | +void to_json(json & j, const ChildData & x); | |
| 650 | 650 | |
| 651 | - void from_json(const json & j, Child & x); | |
| 652 | - void to_json(json & j, const Child & x); | |
| 651 | +void from_json(const json & j, Child & x); | |
| 652 | +void to_json(json & j, const Child & x); | |
| 653 | 653 | |
| 654 | - void from_json(const json & j, TopLevelData & x); | |
| 655 | - void to_json(json & j, const TopLevelData & x); | |
| 654 | +void from_json(const json & j, TopLevelData & x); | |
| 655 | +void to_json(json & j, const TopLevelData & x); | |
| 656 | 656 | |
| 657 | - void from_json(const json & j, TopLevel & x); | |
| 658 | - void to_json(json & j, const TopLevel & x); | |
| 657 | +void from_json(const json & j, TopLevel & x); | |
| 658 | +void to_json(json & j, const TopLevel & x); | |
| 659 | 659 | |
| 660 | - void from_json(const json & j, Domain & x); | |
| 661 | - void to_json(json & j, const Domain & x); | |
| 660 | +void from_json(const json & j, Domain & x); | |
| 661 | +void to_json(json & j, const Domain & x); | |
| 662 | 662 | |
| 663 | - void from_json(const json & j, WhitelistStatus & x); | |
| 664 | - void to_json(json & j, const WhitelistStatus & x); | |
| 663 | +void from_json(const json & j, WhitelistStatus & x); | |
| 664 | +void to_json(json & j, const WhitelistStatus & x); | |
| 665 | 665 | |
| 666 | - void from_json(const json & j, PostHint & x); | |
| 667 | - void to_json(json & j, const PostHint & x); | |
| 666 | +void from_json(const json & j, PostHint & x); | |
| 667 | +void to_json(json & j, const PostHint & x); | |
| 668 | 668 | |
| 669 | - void from_json(const json & j, Subreddit & x); | |
| 670 | - void to_json(json & j, const Subreddit & x); | |
| 669 | +void from_json(const json & j, Subreddit & x); | |
| 670 | +void to_json(json & j, const Subreddit & x); | |
| 671 | 671 | |
| 672 | - void from_json(const json & j, SubredditId & x); | |
| 673 | - void to_json(json & j, const SubredditId & x); | |
| 672 | +void from_json(const json & j, SubredditId & x); | |
| 673 | +void to_json(json & j, const SubredditId & x); | |
| 674 | 674 | |
| 675 | - void from_json(const json & j, SubredditNamePrefixed & x); | |
| 676 | - void to_json(json & j, const SubredditNamePrefixed & x); | |
| 675 | +void from_json(const json & j, SubredditNamePrefixed & x); | |
| 676 | +void to_json(json & j, const SubredditNamePrefixed & x); | |
| 677 | 677 | |
| 678 | - void from_json(const json & j, SubredditType & x); | |
| 679 | - void to_json(json & j, const SubredditType & x); | |
| 680 | - | |
| 681 | - void from_json(const json & j, Kind & x); | |
| 682 | - void to_json(json & j, const Kind & x); | |
| 678 | +void from_json(const json & j, SubredditType & x); | |
| 679 | +void to_json(json & j, const SubredditType & x); | |
| 683 | 680 | |
| 681 | +void from_json(const json & j, Kind & x); | |
| 682 | +void to_json(json & j, const Kind & x); | |
| 683 | +} | |
| 684 | +namespace quicktype { | |
| 684 | 685 | inline void from_json(const json & j, MediaEmbed& x) { |
| 685 | 686 | (void)j; |
| 686 | 687 | (void)x; |
Test case
1 generated file · +4 −3test/inputs/json/samples/simple-object.json
Mcplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_date(j.at("date").get<int64_t>()); |
| 65 | 66 | x.set_title(j.at("title").get<std::string>()); |
Test case
1 generated file · +18 −17test/inputs/json/samples/spotify-album.json
Mcplusplusdefault / quicktype.hpp+18 −17
| @@ -355,30 +355,31 @@ namespace quicktype { | ||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | namespace quicktype { |
| 358 | - void from_json(const json & j, ExternalUrls & x); | |
| 359 | - void to_json(json & j, const ExternalUrls & x); | |
| 358 | +void from_json(const json & j, ExternalUrls & x); | |
| 359 | +void to_json(json & j, const ExternalUrls & x); | |
| 360 | 360 | |
| 361 | - void from_json(const json & j, Artist & x); | |
| 362 | - void to_json(json & j, const Artist & x); | |
| 361 | +void from_json(const json & j, Artist & x); | |
| 362 | +void to_json(json & j, const Artist & x); | |
| 363 | 363 | |
| 364 | - void from_json(const json & j, Copyright & x); | |
| 365 | - void to_json(json & j, const Copyright & x); | |
| 364 | +void from_json(const json & j, Copyright & x); | |
| 365 | +void to_json(json & j, const Copyright & x); | |
| 366 | 366 | |
| 367 | - void from_json(const json & j, ExternalIds & x); | |
| 368 | - void to_json(json & j, const ExternalIds & x); | |
| 367 | +void from_json(const json & j, ExternalIds & x); | |
| 368 | +void to_json(json & j, const ExternalIds & x); | |
| 369 | 369 | |
| 370 | - void from_json(const json & j, Image & x); | |
| 371 | - void to_json(json & j, const Image & x); | |
| 370 | +void from_json(const json & j, Image & x); | |
| 371 | +void to_json(json & j, const Image & x); | |
| 372 | 372 | |
| 373 | - void from_json(const json & j, Item & x); | |
| 374 | - void to_json(json & j, const Item & x); | |
| 373 | +void from_json(const json & j, Item & x); | |
| 374 | +void to_json(json & j, const Item & x); | |
| 375 | 375 | |
| 376 | - void from_json(const json & j, Tracks & x); | |
| 377 | - void to_json(json & j, const Tracks & x); | |
| 378 | - | |
| 379 | - void from_json(const json & j, TopLevel & x); | |
| 380 | - void to_json(json & j, const TopLevel & x); | |
| 376 | +void from_json(const json & j, Tracks & x); | |
| 377 | +void to_json(json & j, const Tracks & x); | |
| 381 | 378 | |
| 379 | +void from_json(const json & j, TopLevel & x); | |
| 380 | +void to_json(json & j, const TopLevel & x); | |
| 381 | +} | |
| 382 | +namespace quicktype { | |
| 382 | 383 | inline void from_json(const json & j, ExternalUrls& x) { |
| 383 | 384 | x.set_spotify(j.at("spotify").get<std::string>()); |
| 384 | 385 | } |
Test case
1 generated file · +8 −7test/inputs/json/samples/us-avg-temperatures.json
Mcplusplusdefault / quicktype.hpp+8 −7
| @@ -100,15 +100,16 @@ namespace quicktype { | ||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | namespace quicktype { |
| 103 | - void from_json(const json & j, Datum & x); | |
| 104 | - void to_json(json & j, const Datum & x); | |
| 103 | +void from_json(const json & j, Datum & x); | |
| 104 | +void to_json(json & j, const Datum & x); | |
| 105 | 105 | |
| 106 | - void from_json(const json & j, Description & x); | |
| 107 | - void to_json(json & j, const Description & x); | |
| 108 | - | |
| 109 | - void from_json(const json & j, TopLevel & x); | |
| 110 | - void to_json(json & j, const TopLevel & x); | |
| 106 | +void from_json(const json & j, Description & x); | |
| 107 | +void to_json(json & j, const Description & x); | |
| 111 | 108 | |
| 109 | +void from_json(const json & j, TopLevel & x); | |
| 110 | +void to_json(json & j, const TopLevel & x); | |
| 111 | +} | |
| 112 | +namespace quicktype { | |
| 112 | 113 | inline void from_json(const json & j, Datum& x) { |
| 113 | 114 | x.set_anomaly(j.at("anomaly").get<std::string>()); |
| 114 | 115 | x.set_value(j.at("value").get<std::string>()); |
Test case
1 generated file · +34 −33test/inputs/json/samples/us-senators.json
Mcplusplusdefault / quicktype.hpp+34 −33
| @@ -398,54 +398,55 @@ namespace quicktype { | ||
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | namespace quicktype { |
| 401 | - void from_json(const json & j, Meta & x); | |
| 402 | - void to_json(json & j, const Meta & x); | |
| 401 | +void from_json(const json & j, Meta & x); | |
| 402 | +void to_json(json & j, const Meta & x); | |
| 403 | 403 | |
| 404 | - void from_json(const json & j, Extra & x); | |
| 405 | - void to_json(json & j, const Extra & x); | |
| 404 | +void from_json(const json & j, Extra & x); | |
| 405 | +void to_json(json & j, const Extra & x); | |
| 406 | 406 | |
| 407 | - void from_json(const json & j, Person & x); | |
| 408 | - void to_json(json & j, const Person & x); | |
| 407 | +void from_json(const json & j, Person & x); | |
| 408 | +void to_json(json & j, const Person & x); | |
| 409 | 409 | |
| 410 | - void from_json(const json & j, Object & x); | |
| 411 | - void to_json(json & j, const Object & x); | |
| 410 | +void from_json(const json & j, Object & x); | |
| 411 | +void to_json(json & j, const Object & x); | |
| 412 | 412 | |
| 413 | - void from_json(const json & j, TopLevel & x); | |
| 414 | - void to_json(json & j, const TopLevel & x); | |
| 413 | +void from_json(const json & j, TopLevel & x); | |
| 414 | +void to_json(json & j, const TopLevel & x); | |
| 415 | 415 | |
| 416 | - void from_json(const json & j, Party & x); | |
| 417 | - void to_json(json & j, const Party & x); | |
| 416 | +void from_json(const json & j, Party & x); | |
| 417 | +void to_json(json & j, const Party & x); | |
| 418 | 418 | |
| 419 | - void from_json(const json & j, Gender & x); | |
| 420 | - void to_json(json & j, const Gender & x); | |
| 419 | +void from_json(const json & j, Gender & x); | |
| 420 | +void to_json(json & j, const Gender & x); | |
| 421 | 421 | |
| 422 | - void from_json(const json & j, GenderLabel & x); | |
| 423 | - void to_json(json & j, const GenderLabel & x); | |
| 422 | +void from_json(const json & j, GenderLabel & x); | |
| 423 | +void to_json(json & j, const GenderLabel & x); | |
| 424 | 424 | |
| 425 | - void from_json(const json & j, Namemod & x); | |
| 426 | - void to_json(json & j, const Namemod & x); | |
| 425 | +void from_json(const json & j, Namemod & x); | |
| 426 | +void to_json(json & j, const Namemod & x); | |
| 427 | 427 | |
| 428 | - void from_json(const json & j, RoleType & x); | |
| 429 | - void to_json(json & j, const RoleType & x); | |
| 428 | +void from_json(const json & j, RoleType & x); | |
| 429 | +void to_json(json & j, const RoleType & x); | |
| 430 | 430 | |
| 431 | - void from_json(const json & j, RoleTypeLabel & x); | |
| 432 | - void to_json(json & j, const RoleTypeLabel & x); | |
| 431 | +void from_json(const json & j, RoleTypeLabel & x); | |
| 432 | +void to_json(json & j, const RoleTypeLabel & x); | |
| 433 | 433 | |
| 434 | - void from_json(const json & j, SenatorClass & x); | |
| 435 | - void to_json(json & j, const SenatorClass & x); | |
| 434 | +void from_json(const json & j, SenatorClass & x); | |
| 435 | +void to_json(json & j, const SenatorClass & x); | |
| 436 | 436 | |
| 437 | - void from_json(const json & j, SenatorClassLabel & x); | |
| 438 | - void to_json(json & j, const SenatorClassLabel & x); | |
| 437 | +void from_json(const json & j, SenatorClassLabel & x); | |
| 438 | +void to_json(json & j, const SenatorClassLabel & x); | |
| 439 | 439 | |
| 440 | - void from_json(const json & j, SenatorRank & x); | |
| 441 | - void to_json(json & j, const SenatorRank & x); | |
| 440 | +void from_json(const json & j, SenatorRank & x); | |
| 441 | +void to_json(json & j, const SenatorRank & x); | |
| 442 | 442 | |
| 443 | - void from_json(const json & j, SenatorRankLabel & x); | |
| 444 | - void to_json(json & j, const SenatorRankLabel & x); | |
| 445 | - | |
| 446 | - void from_json(const json & j, Title & x); | |
| 447 | - void to_json(json & j, const Title & x); | |
| 443 | +void from_json(const json & j, SenatorRankLabel & x); | |
| 444 | +void to_json(json & j, const SenatorRankLabel & x); | |
| 448 | 445 | |
| 446 | +void from_json(const json & j, Title & x); | |
| 447 | +void to_json(json & j, const Title & x); | |
| 448 | +} | |
| 449 | +namespace quicktype { | |
| 449 | 450 | inline void from_json(const json & j, Meta& x) { |
| 450 | 451 | x.set_limit(j.at("limit").get<int64_t>()); |
| 451 | 452 | x.set_offset(j.at("offset").get<int64_t>()); |
Test case
1 generated file · +8 −7test/inputs/schema/all-of-additional-properties-false.schema
Mschema-cplusplusdefault / quicktype.hpp+8 −7
| @@ -123,15 +123,16 @@ namespace quicktype { | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | namespace quicktype { |
| 126 | - void from_json(const json & j, TopLevel & x); | |
| 127 | - void to_json(json & j, const TopLevel & x); | |
| 126 | +void from_json(const json & j, TopLevel & x); | |
| 127 | +void to_json(json & j, const TopLevel & x); | |
| 128 | 128 | |
| 129 | - void from_json(const json & j, Frequency & x); | |
| 130 | - void to_json(json & j, const Frequency & x); | |
| 131 | - | |
| 132 | - void from_json(const json & j, Type & x); | |
| 133 | - void to_json(json & j, const Type & x); | |
| 129 | +void from_json(const json & j, Frequency & x); | |
| 130 | +void to_json(json & j, const Frequency & x); | |
| 134 | 131 | |
| 132 | +void from_json(const json & j, Type & x); | |
| 133 | +void to_json(json & j, const Type & x); | |
| 134 | +} | |
| 135 | +namespace quicktype { | |
| 135 | 136 | inline void from_json(const json & j, TopLevel& x) { |
| 136 | 137 | x.set_amount(j.at("amount").get<double>()); |
| 137 | 138 | x.set_frequency(j.at("frequency").get<Frequency>()); |
Test case
1 generated file · +4 −3test/inputs/schema/any.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_foo(get_untyped(j, "foo")); |
| 60 | 61 | x.set_values(j.at("values").get<std::map<std::string, nlohmann::json>>()); |
Test case
1 generated file · +4 −3test/inputs/schema/boolean-subschema.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -119,9 +119,10 @@ namespace quicktype { | ||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | namespace quicktype { |
| 122 | - void from_json(const json & j, TopLevel & x); | |
| 123 | - void to_json(json & j, const TopLevel & x); | |
| 124 | - | |
| 122 | +void from_json(const json & j, TopLevel & x); | |
| 123 | +void to_json(json & j, const TopLevel & x); | |
| 124 | +} | |
| 125 | +namespace quicktype { | |
| 125 | 126 | inline void from_json(const json & j, TopLevel& x) { |
| 126 | 127 | x.set_disallowed(get_untyped(j, "disallowed")); |
| 127 | 128 | x.set_empty(j.at("empty").get<std::vector<nlohmann::json>>()); |
Test case
1 generated file · +4 −3test/inputs/schema/camelCase.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -109,9 +109,10 @@ namespace quicktype { | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | namespace quicktype { |
| 112 | - void from_json(const json & j, TopLevel & x); | |
| 113 | - void to_json(json & j, const TopLevel & x); | |
| 114 | - | |
| 112 | +void from_json(const json & j, TopLevel & x); | |
| 113 | +void to_json(json & j, const TopLevel & x); | |
| 114 | +} | |
| 115 | +namespace quicktype { | |
| 115 | 116 | inline void from_json(const json & j, TopLevel& x) { |
| 116 | 117 | x.set_my_property(get_stack_optional<std::string>(j, "myProperty")); |
| 117 | 118 | x.set_second_property(get_stack_optional<std::string>(j, "secondProperty")); |
Test case
1 generated file · +6 −5test/inputs/schema/comment-injection-enum-nested-comment.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -61,12 +61,13 @@ namespace quicktype { | ||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | namespace quicktype { |
| 64 | - void from_json(const json & j, TopLevel & x); | |
| 65 | - void to_json(json & j, const TopLevel & x); | |
| 66 | - | |
| 67 | - void from_json(const json & j, Kind & x); | |
| 68 | - void to_json(json & j, const Kind & x); | |
| 64 | +void from_json(const json & j, TopLevel & x); | |
| 65 | +void to_json(json & j, const TopLevel & x); | |
| 69 | 66 | |
| 67 | +void from_json(const json & j, Kind & x); | |
| 68 | +void to_json(json & j, const Kind & x); | |
| 69 | +} | |
| 70 | +namespace quicktype { | |
| 70 | 71 | inline void from_json(const json & j, TopLevel& x) { |
| 71 | 72 | x.set_kind(j.at("kind").get<Kind>()); |
| 72 | 73 | } |
Test case
1 generated file · +6 −5test/inputs/schema/comment-injection-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -67,12 +67,13 @@ namespace quicktype { | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | namespace quicktype { |
| 70 | - void from_json(const json & j, TopLevel & x); | |
| 71 | - void to_json(json & j, const TopLevel & x); | |
| 72 | - | |
| 73 | - void from_json(const json & j, Kind & x); | |
| 74 | - void to_json(json & j, const Kind & x); | |
| 70 | +void from_json(const json & j, TopLevel & x); | |
| 71 | +void to_json(json & j, const TopLevel & x); | |
| 75 | 72 | |
| 73 | +void from_json(const json & j, Kind & x); | |
| 74 | +void to_json(json & j, const Kind & x); | |
| 75 | +} | |
| 76 | +namespace quicktype { | |
| 76 | 77 | inline void from_json(const json & j, TopLevel& x) { |
| 77 | 78 | x.set_kind(j.at("kind").get<Kind>()); |
| 78 | 79 | } |
Test case
1 generated file · +4 −3test/inputs/schema/comment-injection-nested-comment.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -59,9 +59,10 @@ namespace quicktype { | ||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | namespace quicktype { |
| 62 | - void from_json(const json & j, TopLevel & x); | |
| 63 | - void to_json(json & j, const TopLevel & x); | |
| 64 | - | |
| 62 | +void from_json(const json & j, TopLevel & x); | |
| 63 | +void to_json(json & j, const TopLevel & x); | |
| 64 | +} | |
| 65 | +namespace quicktype { | |
| 65 | 66 | inline void from_json(const json & j, TopLevel& x) { |
| 66 | 67 | x.set_value(j.at("value").get<std::string>()); |
| 67 | 68 | } |
Test case
1 generated file · +4 −3test/inputs/schema/comment-injection.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -156,9 +156,10 @@ namespace quicktype { | ||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | namespace quicktype { |
| 159 | - void from_json(const json & j, TopLevel & x); | |
| 160 | - void to_json(json & j, const TopLevel & x); | |
| 161 | - | |
| 159 | +void from_json(const json & j, TopLevel & x); | |
| 160 | +void to_json(json & j, const TopLevel & x); | |
| 161 | +} | |
| 162 | +namespace quicktype { | |
| 162 | 163 | inline void from_json(const json & j, TopLevel& x) { |
| 163 | 164 | x.set_trailing_backslash(get_stack_optional<std::string>(j, "trailingBackslash")); |
| 164 | 165 | x.set_trailing_quote(get_stack_optional<std::string>(j, "trailingQuote")); |
Test case
1 generated file · +6 −5test/inputs/schema/const-non-string.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -69,12 +69,13 @@ namespace quicktype { | ||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | namespace quicktype { |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 74 | - | |
| 75 | - void from_json(const json & j, Kind & x); | |
| 76 | - void to_json(json & j, const Kind & x); | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 77 | 74 | |
| 75 | +void from_json(const json & j, Kind & x); | |
| 76 | +void to_json(json & j, const Kind & x); | |
| 77 | +} | |
| 78 | +namespace quicktype { | |
| 78 | 79 | inline void from_json(const json & j, TopLevel& x) { |
| 79 | 80 | x.set_amount(j.at("amount").get<int64_t>()); |
| 80 | 81 | x.set_enabled(j.at("enabled").get<bool>()); |
Test case
1 generated file · +4 −3test/inputs/schema/cut-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_foo(j.at("foo").get<int64_t>()); |
| 55 | 56 | } |
Test case
1 generated file · +4 −3test/inputs/schema/date-time-or-string.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_bar(j.at("bar").get<std::string>()); |
| 60 | 61 | x.set_foo(j.at("foo").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/schema/default-value.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -50,9 +50,10 @@ namespace quicktype { | ||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | namespace quicktype { |
| 53 | - void from_json(const json & j, TopLevel & x); | |
| 54 | - void to_json(json & j, const TopLevel & x); | |
| 55 | - | |
| 53 | +void from_json(const json & j, TopLevel & x); | |
| 54 | +void to_json(json & j, const TopLevel & x); | |
| 55 | +} | |
| 56 | +namespace quicktype { | |
| 56 | 57 | inline void from_json(const json & j, TopLevel& x) { |
| 57 | 58 | x.set_id(j.at("id").get<int64_t>()); |
| 58 | 59 | } |
Test case
1 generated file · +4 −3test/inputs/schema/description-with-double-quotes.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -107,9 +107,10 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_foo(get_stack_optional<bool>(j, "foo")); |
| 115 | 116 | } |
Test case
1 generated file · +8 −7test/inputs/schema/enum-large.schema
Mschema-cplusplusdefault / quicktype.hpp+8 −7
| @@ -57,15 +57,16 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | 62 | |
| 63 | - void from_json(const json & j, Callsign & x); | |
| 64 | - void to_json(json & j, const Callsign & x); | |
| 65 | - | |
| 66 | - void from_json(const json & j, Priority & x); | |
| 67 | - void to_json(json & j, const Priority & x); | |
| 63 | +void from_json(const json & j, Callsign & x); | |
| 64 | +void to_json(json & j, const Callsign & x); | |
| 68 | 65 | |
| 66 | +void from_json(const json & j, Priority & x); | |
| 67 | +void to_json(json & j, const Priority & x); | |
| 68 | +} | |
| 69 | +namespace quicktype { | |
| 69 | 70 | inline void from_json(const json & j, TopLevel& x) { |
| 70 | 71 | x.set_callsign(j.at("callsign").get<Callsign>()); |
| 71 | 72 | x.set_priority(j.at("priority").get<Priority>()); |
Test case
1 generated file · +6 −5test/inputs/schema/enum-with-null.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -104,12 +104,13 @@ namespace quicktype { | ||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | namespace quicktype { |
| 107 | - void from_json(const json & j, TopLevel & x); | |
| 108 | - void to_json(json & j, const TopLevel & x); | |
| 109 | - | |
| 110 | - void from_json(const json & j, Enum & x); | |
| 111 | - void to_json(json & j, const Enum & x); | |
| 107 | +void from_json(const json & j, TopLevel & x); | |
| 108 | +void to_json(json & j, const TopLevel & x); | |
| 112 | 109 | |
| 110 | +void from_json(const json & j, Enum & x); | |
| 111 | +void to_json(json & j, const Enum & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_top_level_enum(get_stack_optional<Enum>(j, "enum")); |
| 115 | 116 | } |
Test case
1 generated file · +6 −5test/inputs/schema/enum-with-values.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -49,12 +49,13 @@ namespace quicktype { | ||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | namespace quicktype { |
| 52 | - void from_json(const json & j, TopLevel & x); | |
| 53 | - void to_json(json & j, const TopLevel & x); | |
| 54 | - | |
| 55 | - void from_json(const json & j, Weekdays & x); | |
| 56 | - void to_json(json & j, const Weekdays & x); | |
| 52 | +void from_json(const json & j, TopLevel & x); | |
| 53 | +void to_json(json & j, const TopLevel & x); | |
| 57 | 54 | |
| 55 | +void from_json(const json & j, Weekdays & x); | |
| 56 | +void to_json(json & j, const Weekdays & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_weekdays(j.at("weekdays").get<Weekdays>()); |
| 60 | 61 | } |
Test case
1 generated file · +4 −3test/inputs/schema/go-schema-pattern-properties.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_map(j.at("map").get<std::map<std::string, int64_t>>()); |
| 55 | 56 | } |
Test case
1 generated file · +6 −5test/inputs/schema/haskell-enum-forbidden.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -49,12 +49,13 @@ namespace quicktype { | ||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | namespace quicktype { |
| 52 | - void from_json(const json & j, TopLevel & x); | |
| 53 | - void to_json(json & j, const TopLevel & x); | |
| 54 | - | |
| 55 | - void from_json(const json & j, Health & x); | |
| 56 | - void to_json(json & j, const Health & x); | |
| 52 | +void from_json(const json & j, TopLevel & x); | |
| 53 | +void to_json(json & j, const TopLevel & x); | |
| 57 | 54 | |
| 55 | +void from_json(const json & j, Health & x); | |
| 56 | +void to_json(json & j, const Health & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_health(j.at("health").get<Health>()); |
| 60 | 61 | } |
Test case
1 generated file · +4 −3test/inputs/schema/id-no-address.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_item(j.at("item").get<int64_t>()); |
| 55 | 56 | } |
Test case
1 generated file · +4 −3test/inputs/schema/id-root.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_bar(j.at("bar").get<int64_t>()); |
| 55 | 56 | } |
Test case
1 generated file · +6 −5test/inputs/schema/ie-suffix-singularization.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -66,12 +66,13 @@ namespace quicktype { | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | namespace quicktype { |
| 69 | - void from_json(const json & j, Cookie & x); | |
| 70 | - void to_json(json & j, const Cookie & x); | |
| 71 | - | |
| 72 | - void from_json(const json & j, TopLevel & x); | |
| 73 | - void to_json(json & j, const TopLevel & x); | |
| 69 | +void from_json(const json & j, Cookie & x); | |
| 70 | +void to_json(json & j, const Cookie & x); | |
| 74 | 71 | |
| 72 | +void from_json(const json & j, TopLevel & x); | |
| 73 | +void to_json(json & j, const TopLevel & x); | |
| 74 | +} | |
| 75 | +namespace quicktype { | |
| 75 | 76 | inline void from_json(const json & j, Cookie& x) { |
| 76 | 77 | x.set_name(j.at("name").get<std::string>()); |
| 77 | 78 | x.set_value(j.at("value").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/schema/implicit-all-of.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_foo(j.at("foo").get<int64_t>()); |
| 65 | 66 | x.set_bar(j.at("bar").get<bool>()); |
Test case
1 generated file · +4 −3test/inputs/schema/implicit-one-of.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -114,9 +114,10 @@ namespace quicktype { | ||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | namespace quicktype { |
| 117 | - void from_json(const json & j, TopLevel & x); | |
| 118 | - void to_json(json & j, const TopLevel & x); | |
| 119 | - | |
| 117 | +void from_json(const json & j, TopLevel & x); | |
| 118 | +void to_json(json & j, const TopLevel & x); | |
| 119 | +} | |
| 120 | +namespace quicktype { | |
| 120 | 121 | inline void from_json(const json & j, TopLevel& x) { |
| 121 | 122 | x.set_foo(j.at("foo").get<int64_t>()); |
| 122 | 123 | x.set_bar(get_stack_optional<bool>(j, "bar")); |
Test case
1 generated file · +4 −3test/inputs/schema/integer-type.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -235,9 +235,10 @@ namespace quicktype { | ||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | namespace quicktype { |
| 238 | - void from_json(const json & j, TopLevel & x); | |
| 239 | - void to_json(json & j, const TopLevel & x); | |
| 240 | - | |
| 238 | +void from_json(const json & j, TopLevel & x); | |
| 239 | +void to_json(json & j, const TopLevel & x); | |
| 240 | +} | |
| 241 | +namespace quicktype { | |
| 241 | 242 | inline void from_json(const json & j, TopLevel& x) { |
| 242 | 243 | x.set_above_i32_max(j.at("above_i32_max").get<int64_t>()); |
| 243 | 244 | x.set_below_i32_min(j.at("below_i32_min").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/schema/intersection-nested.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -104,9 +104,10 @@ namespace quicktype { | ||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | namespace quicktype { |
| 107 | - void from_json(const json & j, TopLevel & x); | |
| 108 | - void to_json(json & j, const TopLevel & x); | |
| 109 | - | |
| 107 | +void from_json(const json & j, TopLevel & x); | |
| 108 | +void to_json(json & j, const TopLevel & x); | |
| 109 | +} | |
| 110 | +namespace quicktype { | |
| 110 | 111 | inline void from_json(const json & j, TopLevel& x) { |
| 111 | 112 | x.set_intersection(get_stack_optional<double>(j, "intersection")); |
| 112 | 113 | } |
Test case
1 generated file · +6 −5test/inputs/schema/intersection.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -123,12 +123,13 @@ namespace quicktype { | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | namespace quicktype { |
| 126 | - void from_json(const json & j, Intersection & x); | |
| 127 | - void to_json(json & j, const Intersection & x); | |
| 128 | - | |
| 129 | - void from_json(const json & j, TopLevel & x); | |
| 130 | - void to_json(json & j, const TopLevel & x); | |
| 126 | +void from_json(const json & j, Intersection & x); | |
| 127 | +void to_json(json & j, const Intersection & x); | |
| 131 | 128 | |
| 129 | +void from_json(const json & j, TopLevel & x); | |
| 130 | +void to_json(json & j, const TopLevel & x); | |
| 131 | +} | |
| 132 | +namespace quicktype { | |
| 132 | 133 | inline void from_json(const json & j, Intersection& x) { |
| 133 | 134 | x.set_foo(j.at("foo").get<double>()); |
| 134 | 135 | x.set_bar(get_stack_optional<std::string>(j, "bar")); |
Test case
1 generated file · +6 −5test/inputs/schema/keyword-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -107,12 +107,13 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 113 | - void from_json(const json & j, Enum & x); | |
| 114 | - void to_json(json & j, const Enum & x); | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 115 | 112 | |
| 113 | +void from_json(const json & j, Enum & x); | |
| 114 | +void to_json(json & j, const Enum & x); | |
| 115 | +} | |
| 116 | +namespace quicktype { | |
| 116 | 117 | inline void from_json(const json & j, TopLevel& x) { |
| 117 | 118 | x.set_top_level_enum(get_stack_optional<Enum>(j, "enum")); |
| 118 | 119 | } |
Test case
1 generated file · +6 −5test/inputs/schema/light.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -71,12 +71,13 @@ namespace quicktype { | ||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | namespace quicktype { |
| 74 | - void from_json(const json & j, LightParams & x); | |
| 75 | - void to_json(json & j, const LightParams & x); | |
| 76 | - | |
| 77 | - void from_json(const json & j, TopLevel & x); | |
| 78 | - void to_json(json & j, const TopLevel & x); | |
| 74 | +void from_json(const json & j, LightParams & x); | |
| 75 | +void to_json(json & j, const LightParams & x); | |
| 79 | 76 | |
| 77 | +void from_json(const json & j, TopLevel & x); | |
| 78 | +void to_json(json & j, const TopLevel & x); | |
| 79 | +} | |
| 80 | +namespace quicktype { | |
| 80 | 81 | inline void from_json(const json & j, LightParams& x) { |
| 81 | 82 | x.set_app_id(j.at("app_id").get<std::string>()); |
| 82 | 83 | x.set_outlet_id(j.at("outlet_id").get<std::string>()); |
Test case
1 generated file · +4 −3test/inputs/schema/list.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -107,9 +107,10 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
| 115 | 116 | } |
Test case
1 generated file · +4 −3test/inputs/schema/minmax-integer.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -226,9 +226,10 @@ namespace quicktype { | ||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | namespace quicktype { |
| 229 | - void from_json(const json & j, TopLevel & x); | |
| 230 | - void to_json(json & j, const TopLevel & x); | |
| 231 | - | |
| 229 | +void from_json(const json & j, TopLevel & x); | |
| 230 | +void to_json(json & j, const TopLevel & x); | |
| 231 | +} | |
| 232 | +namespace quicktype { | |
| 232 | 233 | inline void from_json(const json & j, TopLevel& x) { |
| 233 | 234 | x.set_free(j.at("free").get<int64_t>()); |
| 234 | 235 | x.set_intersection(j.at("intersection").get<int64_t>()); |
Test case
1 generated file · +4 −3test/inputs/schema/minmax.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -226,9 +226,10 @@ namespace quicktype { | ||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | namespace quicktype { |
| 229 | - void from_json(const json & j, TopLevel & x); | |
| 230 | - void to_json(json & j, const TopLevel & x); | |
| 231 | - | |
| 229 | +void from_json(const json & j, TopLevel & x); | |
| 230 | +void to_json(json & j, const TopLevel & x); | |
| 231 | +} | |
| 232 | +namespace quicktype { | |
| 232 | 233 | inline void from_json(const json & j, TopLevel& x) { |
| 233 | 234 | x.set_free(j.at("free").get<double>()); |
| 234 | 235 | x.set_intersection(j.at("intersection").get<double>()); |
Test case
1 generated file · +4 −3test/inputs/schema/non-standard-ref.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -57,9 +57,10 @@ namespace quicktype { | ||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | namespace quicktype { |
| 60 | - void from_json(const json & j, TopLevel & x); | |
| 61 | - void to_json(json & j, const TopLevel & x); | |
| 62 | - | |
| 60 | +void from_json(const json & j, TopLevel & x); | |
| 61 | +void to_json(json & j, const TopLevel & x); | |
| 62 | +} | |
| 63 | +namespace quicktype { | |
| 63 | 64 | inline void from_json(const json & j, TopLevel& x) { |
| 64 | 65 | x.set_bar(j.at("bar").get<int64_t>()); |
| 65 | 66 | x.set_foo(j.at("foo").get<int64_t>()); |
Test case
1 generated file · +6 −5test/inputs/schema/nullable-optional-one-of.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -110,12 +110,13 @@ namespace quicktype { | ||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | namespace quicktype { |
| 113 | - void from_json(const json & j, TopLevel & x); | |
| 114 | - void to_json(json & j, const TopLevel & x); | |
| 115 | - | |
| 116 | - void from_json(const json & j, Kind & x); | |
| 117 | - void to_json(json & j, const Kind & x); | |
| 113 | +void from_json(const json & j, TopLevel & x); | |
| 114 | +void to_json(json & j, const TopLevel & x); | |
| 118 | 115 | |
| 116 | +void from_json(const json & j, Kind & x); | |
| 117 | +void to_json(json & j, const Kind & x); | |
| 118 | +} | |
| 119 | +namespace quicktype { | |
| 119 | 120 | inline void from_json(const json & j, TopLevel& x) { |
| 120 | 121 | x.set_b(get_stack_optional<std::string>(j, "b")); |
| 121 | 122 | x.set_kind(j.at("kind").get<Kind>()); |
Test case
1 generated file · +4 −3test/inputs/schema/object-type-required.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -109,9 +109,10 @@ namespace quicktype { | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | namespace quicktype { |
| 112 | - void from_json(const json & j, TopLevel & x); | |
| 113 | - void to_json(json & j, const TopLevel & x); | |
| 114 | - | |
| 112 | +void from_json(const json & j, TopLevel & x); | |
| 113 | +void to_json(json & j, const TopLevel & x); | |
| 114 | +} | |
| 115 | +namespace quicktype { | |
| 115 | 116 | inline void from_json(const json & j, TopLevel& x) { |
| 116 | 117 | x.set_foo(j.at("foo").get<std::string>()); |
| 117 | 118 | x.set_bar(get_stack_optional<std::string>(j, "bar")); |
Test case
2 generated files · +8 −6test/inputs/schema/optional-any.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -109,9 +109,10 @@ namespace quicktype { | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | namespace quicktype { |
| 112 | - void from_json(const json & j, TopLevel & x); | |
| 113 | - void to_json(json & j, const TopLevel & x); | |
| 114 | - | |
| 112 | +void from_json(const json & j, TopLevel & x); | |
| 113 | +void to_json(json & j, const TopLevel & x); | |
| 114 | +} | |
| 115 | +namespace quicktype { | |
| 115 | 116 | inline void from_json(const json & j, TopLevel& x) { |
| 116 | 117 | x.set_bar(j.at("bar").get<bool>()); |
| 117 | 118 | x.set_foo(get_untyped(j, "foo")); |
Mschema-cplusplushide-null-optional-true--b100cdb5877d / quicktype.hpp+4 −3
| @@ -109,9 +109,10 @@ namespace quicktype { | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | namespace quicktype { |
| 112 | - void from_json(const json & j, TopLevel & x); | |
| 113 | - void to_json(json & j, const TopLevel & x); | |
| 114 | - | |
| 112 | +void from_json(const json & j, TopLevel & x); | |
| 113 | +void to_json(json & j, const TopLevel & x); | |
| 114 | +} | |
| 115 | +namespace quicktype { | |
| 115 | 116 | inline void from_json(const json & j, TopLevel& x) { |
| 116 | 117 | x.set_bar(j.at("bar").get<bool>()); |
| 117 | 118 | x.set_foo(get_untyped(j, "foo")); |
Test case
1 generated file · +6 −5test/inputs/schema/optional-const-ref.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -295,12 +295,13 @@ namespace quicktype { | ||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | namespace quicktype { |
| 298 | - void from_json(const json & j, Coordinate & x); | |
| 299 | - void to_json(json & j, const Coordinate & x); | |
| 300 | - | |
| 301 | - void from_json(const json & j, TopLevel & x); | |
| 302 | - void to_json(json & j, const TopLevel & x); | |
| 298 | +void from_json(const json & j, Coordinate & x); | |
| 299 | +void to_json(json & j, const Coordinate & x); | |
| 303 | 300 | |
| 301 | +void from_json(const json & j, TopLevel & x); | |
| 302 | +void to_json(json & j, const TopLevel & x); | |
| 303 | +} | |
| 304 | +namespace quicktype { | |
| 304 | 305 | inline void from_json(const json & j, Coordinate& x) { |
| 305 | 306 | x.set_latitude(j.at("latitude").get<double>()); |
| 306 | 307 | x.set_longitude(j.at("longitude").get<double>()); |
Test case
1 generated file · +4 −3test/inputs/schema/optional-constraints.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -266,9 +266,10 @@ namespace quicktype { | ||
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | namespace quicktype { |
| 269 | - void from_json(const json & j, TopLevel & x); | |
| 270 | - void to_json(json & j, const TopLevel & x); | |
| 271 | - | |
| 269 | +void from_json(const json & j, TopLevel & x); | |
| 270 | +void to_json(json & j, const TopLevel & x); | |
| 271 | +} | |
| 272 | +namespace quicktype { | |
| 272 | 273 | inline void from_json(const json & j, TopLevel& x) { |
| 273 | 274 | x.set_opt_double(get_stack_optional<double>(j, "optDouble")); |
| 274 | 275 | x.set_opt_int(get_stack_optional<int64_t>(j, "optInt")); |
Test case
1 generated file · +4 −3test/inputs/schema/optional-date-time.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -129,9 +129,10 @@ namespace quicktype { | ||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | namespace quicktype { |
| 132 | - void from_json(const json & j, TopLevel & x); | |
| 133 | - void to_json(json & j, const TopLevel & x); | |
| 134 | - | |
| 132 | +void from_json(const json & j, TopLevel & x); | |
| 133 | +void to_json(json & j, const TopLevel & x); | |
| 134 | +} | |
| 135 | +namespace quicktype { | |
| 135 | 136 | inline void from_json(const json & j, TopLevel& x) { |
| 136 | 137 | x.set_optional_date(get_stack_optional<std::string>(j, "optional-date")); |
| 137 | 138 | x.set_optional_date_time(get_stack_optional<std::string>(j, "optional-date-time")); |
Test case
1 generated file · +6 −5test/inputs/schema/optional-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -111,12 +111,13 @@ namespace quicktype { | ||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | namespace quicktype { |
| 114 | - void from_json(const json & j, TopLevel & x); | |
| 115 | - void to_json(json & j, const TopLevel & x); | |
| 116 | - | |
| 117 | - void from_json(const json & j, Shortcut & x); | |
| 118 | - void to_json(json & j, const Shortcut & x); | |
| 114 | +void from_json(const json & j, TopLevel & x); | |
| 115 | +void to_json(json & j, const TopLevel & x); | |
| 119 | 116 | |
| 117 | +void from_json(const json & j, Shortcut & x); | |
| 118 | +void to_json(json & j, const Shortcut & x); | |
| 119 | +} | |
| 120 | +namespace quicktype { | |
| 120 | 121 | inline void from_json(const json & j, TopLevel& x) { |
| 121 | 122 | x.set_name(j.at("name").get<std::string>()); |
| 122 | 123 | x.set_shortcut(get_stack_optional<Shortcut>(j, "shortcut")); |
Test case
1 generated file · +4 −3test/inputs/schema/pattern.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -195,9 +195,10 @@ namespace quicktype { | ||
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | namespace quicktype { |
| 198 | - void from_json(const json & j, TopLevel & x); | |
| 199 | - void to_json(json & j, const TopLevel & x); | |
| 200 | - | |
| 198 | +void from_json(const json & j, TopLevel & x); | |
| 199 | +void to_json(json & j, const TopLevel & x); | |
| 200 | +} | |
| 201 | +namespace quicktype { | |
| 201 | 202 | inline void from_json(const json & j, TopLevel& x) { |
| 202 | 203 | x.set_pattern1(j.at("pattern1").get<std::string>()); |
| 203 | 204 | x.set_pattern2(j.at("pattern2").get<std::string>()); |
Test case
1 generated file · +6 −5test/inputs/schema/postman-collection.schema
Mschema-cplusplusdefault / quicktype.hpp+6 −5
| @@ -131,12 +131,13 @@ namespace quicktype { | ||
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | namespace quicktype { |
| 134 | - void from_json(const json & j, Response & x); | |
| 135 | - void to_json(json & j, const Response & x); | |
| 136 | - | |
| 137 | - void from_json(const json & j, TopLevel & x); | |
| 138 | - void to_json(json & j, const TopLevel & x); | |
| 134 | +void from_json(const json & j, Response & x); | |
| 135 | +void to_json(json & j, const Response & x); | |
| 139 | 136 | |
| 137 | +void from_json(const json & j, TopLevel & x); | |
| 138 | +void to_json(json & j, const TopLevel & x); | |
| 139 | +} | |
| 140 | +namespace quicktype { | |
| 140 | 141 | inline void from_json(const json & j, Response& x) { |
| 141 | 142 | x.set_body(get_stack_optional<std::string>(j, "body")); |
| 142 | 143 | } |
Test case
1 generated file · +4 −3test/inputs/schema/ref-id-files.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_foo(j.at("foo").get<int64_t>()); |
| 55 | 56 | } |
Test case
1 generated file · +4 −3test/inputs/schema/ref-remote.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -107,9 +107,10 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
| 115 | 116 | } |
Test case
1 generated file · +34 −33test/inputs/schema/renaming-bug.schema
Mschema-cplusplusdefault / quicktype.hpp+34 −33
| @@ -520,54 +520,55 @@ namespace quicktype { | ||
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | namespace quicktype { |
| 523 | - void from_json(const json & j, Color & x); | |
| 524 | - void to_json(json & j, const Color & x); | |
| 523 | +void from_json(const json & j, Color & x); | |
| 524 | +void to_json(json & j, const Color & x); | |
| 525 | 525 | |
| 526 | - void from_json(const json & j, CircularShape & x); | |
| 527 | - void to_json(json & j, const CircularShape & x); | |
| 526 | +void from_json(const json & j, CircularShape & x); | |
| 527 | +void to_json(json & j, const CircularShape & x); | |
| 528 | 528 | |
| 529 | - void from_json(const json & j, Part & x); | |
| 530 | - void to_json(json & j, const Part & x); | |
| 529 | +void from_json(const json & j, Part & x); | |
| 530 | +void to_json(json & j, const Part & x); | |
| 531 | 531 | |
| 532 | - void from_json(const json & j, RectShape & x); | |
| 533 | - void to_json(json & j, const RectShape & x); | |
| 532 | +void from_json(const json & j, RectShape & x); | |
| 533 | +void to_json(json & j, const RectShape & x); | |
| 534 | 534 | |
| 535 | - void from_json(const json & j, Geometry & x); | |
| 536 | - void to_json(json & j, const Geometry & x); | |
| 535 | +void from_json(const json & j, Geometry & x); | |
| 536 | +void to_json(json & j, const Geometry & x); | |
| 537 | 537 | |
| 538 | - void from_json(const json & j, History & x); | |
| 539 | - void to_json(json & j, const History & x); | |
| 538 | +void from_json(const json & j, History & x); | |
| 539 | +void to_json(json & j, const History & x); | |
| 540 | 540 | |
| 541 | - void from_json(const json & j, Shape & x); | |
| 542 | - void to_json(json & j, const Shape & x); | |
| 541 | +void from_json(const json & j, Shape & x); | |
| 542 | +void to_json(json & j, const Shape & x); | |
| 543 | 543 | |
| 544 | - void from_json(const json & j, Berry & x); | |
| 545 | - void to_json(json & j, const Berry & x); | |
| 544 | +void from_json(const json & j, Berry & x); | |
| 545 | +void to_json(json & j, const Berry & x); | |
| 546 | 546 | |
| 547 | - void from_json(const json & j, Fruit & x); | |
| 548 | - void to_json(json & j, const Fruit & x); | |
| 547 | +void from_json(const json & j, Fruit & x); | |
| 548 | +void to_json(json & j, const Fruit & x); | |
| 549 | 549 | |
| 550 | - void from_json(const json & j, Limit & x); | |
| 551 | - void to_json(json & j, const Limit & x); | |
| 550 | +void from_json(const json & j, Limit & x); | |
| 551 | +void to_json(json & j, const Limit & x); | |
| 552 | 552 | |
| 553 | - void from_json(const json & j, Speed & x); | |
| 554 | - void to_json(json & j, const Speed & x); | |
| 553 | +void from_json(const json & j, Speed & x); | |
| 554 | +void to_json(json & j, const Speed & x); | |
| 555 | 555 | |
| 556 | - void from_json(const json & j, VehicleType & x); | |
| 557 | - void to_json(json & j, const VehicleType & x); | |
| 556 | +void from_json(const json & j, VehicleType & x); | |
| 557 | +void to_json(json & j, const VehicleType & x); | |
| 558 | 558 | |
| 559 | - void from_json(const json & j, Vehicle & x); | |
| 560 | - void to_json(json & j, const Vehicle & x); | |
| 559 | +void from_json(const json & j, Vehicle & x); | |
| 560 | +void to_json(json & j, const Vehicle & x); | |
| 561 | 561 | |
| 562 | - void from_json(const json & j, TopLevel & x); | |
| 563 | - void to_json(json & j, const TopLevel & x); | |
| 562 | +void from_json(const json & j, TopLevel & x); | |
| 563 | +void to_json(json & j, const TopLevel & x); | |
| 564 | 564 | |
| 565 | - void from_json(const json & j, Axis & x); | |
| 566 | - void to_json(json & j, const Axis & x); | |
| 567 | - | |
| 568 | - void from_json(const json & j, Name & x); | |
| 569 | - void to_json(json & j, const Name & x); | |
| 565 | +void from_json(const json & j, Axis & x); | |
| 566 | +void to_json(json & j, const Axis & x); | |
| 570 | 567 | |
| 568 | +void from_json(const json & j, Name & x); | |
| 569 | +void to_json(json & j, const Name & x); | |
| 570 | +} | |
| 571 | +namespace quicktype { | |
| 571 | 572 | inline void from_json(const json & j, Color& x) { |
| 572 | 573 | x.set_rgb(get_stack_optional<double>(j, "rgb")); |
| 573 | 574 | } |
Test case
1 generated file · +4 −3test/inputs/schema/required-draft3.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_longitude(j.at("longitude").get<double>()); |
| 55 | 56 | } |
Test case
1 generated file · +4 −3test/inputs/schema/required-non-properties.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -52,9 +52,10 @@ namespace quicktype { | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | namespace quicktype { |
| 55 | - void from_json(const json & j, TopLevel & x); | |
| 56 | - void to_json(json & j, const TopLevel & x); | |
| 57 | - | |
| 55 | +void from_json(const json & j, TopLevel & x); | |
| 56 | +void to_json(json & j, const TopLevel & x); | |
| 57 | +} | |
| 58 | +namespace quicktype { | |
| 58 | 59 | inline void from_json(const json & j, TopLevel& x) { |
| 59 | 60 | x.set_foo(j.at("foo").get<int64_t>()); |
| 60 | 61 | x.set_bar(get_untyped(j, "bar")); |
Test case
1 generated file · +4 −3test/inputs/schema/required.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -47,9 +47,10 @@ namespace quicktype { | ||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | namespace quicktype { |
| 50 | - void from_json(const json & j, TopLevel & x); | |
| 51 | - void to_json(json & j, const TopLevel & x); | |
| 52 | - | |
| 50 | +void from_json(const json & j, TopLevel & x); | |
| 51 | +void to_json(json & j, const TopLevel & x); | |
| 52 | +} | |
| 53 | +namespace quicktype { | |
| 53 | 54 | inline void from_json(const json & j, TopLevel& x) { |
| 54 | 55 | x.set_longitude(j.at("longitude").get<double>()); |
| 55 | 56 | } |
Test case
1 generated file · +4 −3test/inputs/schema/schema-constraints.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -188,9 +188,10 @@ namespace quicktype { | ||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | namespace quicktype { |
| 191 | - void from_json(const json & j, TopLevel & x); | |
| 192 | - void to_json(json & j, const TopLevel & x); | |
| 193 | - | |
| 191 | +void from_json(const json & j, TopLevel & x); | |
| 192 | +void to_json(json & j, const TopLevel & x); | |
| 193 | +} | |
| 194 | +namespace quicktype { | |
| 194 | 195 | inline void from_json(const json & j, TopLevel& x) { |
| 195 | 196 | x.set_min_max_length(j.at("minMaxLength").get<std::string>()); |
| 196 | 197 | x.set_percent(j.at("percent").get<double>()); |
Test case
1 generated file · +4 −3test/inputs/schema/simple-ref.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -107,9 +107,10 @@ namespace quicktype { | ||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | namespace quicktype { |
| 110 | - void from_json(const json & j, TopLevel & x); | |
| 111 | - void to_json(json & j, const TopLevel & x); | |
| 112 | - | |
| 110 | +void from_json(const json & j, TopLevel & x); | |
| 111 | +void to_json(json & j, const TopLevel & x); | |
| 112 | +} | |
| 113 | +namespace quicktype { | |
| 113 | 114 | inline void from_json(const json & j, TopLevel& x) { |
| 114 | 115 | x.set_next(get_heap_optional<TopLevel>(j, "next")); |
| 115 | 116 | } |
Test case
1 generated file · +4 −3test/inputs/schema/strict-optional.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -102,9 +102,10 @@ namespace quicktype { | ||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | namespace quicktype { |
| 105 | - void from_json(const json & j, TopLevel & x); | |
| 106 | - void to_json(json & j, const TopLevel & x); | |
| 107 | - | |
| 105 | +void from_json(const json & j, TopLevel & x); | |
| 106 | +void to_json(json & j, const TopLevel & x); | |
| 107 | +} | |
| 108 | +namespace quicktype { | |
| 108 | 109 | inline void from_json(const json & j, TopLevel& x) { |
| 109 | 110 | x.set_foo(get_stack_optional<double>(j, "foo")); |
| 110 | 111 | } |
Test case
1 generated file · +4 −3test/inputs/schema/top-level-array.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -54,9 +54,10 @@ namespace quicktype { | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | namespace quicktype { |
| 57 | - void from_json(const json & j, TextClassificationOutputElement & x); | |
| 58 | - void to_json(json & j, const TextClassificationOutputElement & x); | |
| 59 | - | |
| 57 | +void from_json(const json & j, TextClassificationOutputElement & x); | |
| 58 | +void to_json(json & j, const TextClassificationOutputElement & x); | |
| 59 | +} | |
| 60 | +namespace quicktype { | |
| 60 | 61 | inline void from_json(const json & j, TextClassificationOutputElement& x) { |
| 61 | 62 | x.set_label(j.at("label").get<std::string>()); |
| 62 | 63 | x.set_score(j.at("score").get<double>()); |
Test case
1 generated file · +4 −3test/inputs/schema/top-level-enum.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -35,9 +35,10 @@ namespace quicktype { | ||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | namespace quicktype { |
| 38 | - void from_json(const json & j, TopLevel & x); | |
| 39 | - void to_json(json & j, const TopLevel & x); | |
| 40 | - | |
| 38 | +void from_json(const json & j, TopLevel & x); | |
| 39 | +void to_json(json & j, const TopLevel & x); | |
| 40 | +} | |
| 41 | +namespace quicktype { | |
| 41 | 42 | inline void from_json(const json & j, TopLevel & x) { |
| 42 | 43 | if (j == "one") x = TopLevel::ONE; |
| 43 | 44 | else if (j == "three") x = TopLevel::THREE; |
Test case
1 generated file · +4 −3test/inputs/schema/union.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -116,9 +116,10 @@ namespace quicktype { | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | namespace quicktype { |
| 119 | - void from_json(const json & j, TopLevelElement & x); | |
| 120 | - void to_json(json & j, const TopLevelElement & x); | |
| 121 | - | |
| 119 | +void from_json(const json & j, TopLevelElement & x); | |
| 120 | +void to_json(json & j, const TopLevelElement & x); | |
| 121 | +} | |
| 122 | +namespace quicktype { | |
| 122 | 123 | inline void from_json(const json & j, TopLevelElement& x) { |
| 123 | 124 | x.set_one(get_stack_optional<int64_t>(j, "one")); |
| 124 | 125 | x.set_two(j.at("two").get<bool>()); |
Test case
1 generated file · +4 −3test/inputs/schema/uuid.schema
Mschema-cplusplusdefault / quicktype.hpp+4 −3
| @@ -128,9 +128,10 @@ namespace quicktype { | ||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | namespace quicktype { |
| 131 | - void from_json(const json & j, TopLevel & x); | |
| 132 | - void to_json(json & j, const TopLevel & x); | |
| 133 | - | |
| 131 | +void from_json(const json & j, TopLevel & x); | |
| 132 | +void to_json(json & j, const TopLevel & x); | |
| 133 | +} | |
| 134 | +namespace quicktype { | |
| 134 | 135 | inline void from_json(const json & j, TopLevel& x) { |
| 135 | 136 | x.set_arr_nullable(get_stack_optional<std::vector<std::optional<std::string>>>(j, "arrNullable")); |
| 136 | 137 | x.set_arr_one(get_stack_optional<std::vector<std::string>>(j, "arrOne")); |
No generated files match these filters.