| 388 | |
| 389 | template <class TRapidJsonCompliantInputStream, class THandler> |
| 390 | auto Read(const TJsonReaderConfig& config, |
| 391 | rapidjson::Reader& reader, |
| 392 | TRapidJsonCompliantInputStream& is, |
| 393 | THandler& handler) { |
| 394 | // validate by default |
| 395 | ui8 flags = ReaderConfigFlags::VALIDATE; |
| 396 | |
| 397 | if (config.UseIterativeParser) { |
| 398 | flags |= ReaderConfigFlags::ITERATIVE; |
| 399 | } |
| 400 | |
| 401 | if (config.AllowComments) { |
| 402 | flags |= ReaderConfigFlags::COMMENTS; |
| 403 | } |
| 404 | |
| 405 | if (config.DontValidateUtf8) { |
| 406 | flags &= ~(ReaderConfigFlags::VALIDATE); |
| 407 | } |
| 408 | |
| 409 | if (config.AllowEscapedApostrophe) { |
| 410 | flags |= ReaderConfigFlags::ESCAPE; |
| 411 | } |
| 412 | if (config.AllowReadNanInf) { |
| 413 | flags |= ReaderConfigFlags::NANINF; |
| 414 | } |
| 415 | |
| 416 | return ReadWithRuntimeFlags(flags, reader, is, handler); |
| 417 | } |
| 418 | |
| 419 | template <class TRapidJsonCompliantInputStream, class THandler> |
| 420 | bool ReadJson(TRapidJsonCompliantInputStream& is, const TJsonReaderConfig* config, THandler& handler, bool throwOnError) { |
no test coverage detected