| 376 | } // namespace |
| 377 | |
| 378 | std::unique_ptr<Chunker> MakeChunker(const ParseOptions& options) { |
| 379 | std::shared_ptr<BoundaryFinder> delimiter; |
| 380 | if (!options.newlines_in_values) { |
| 381 | delimiter = MakeNewlineBoundaryFinder(); |
| 382 | } else { |
| 383 | if (options.quoting) { |
| 384 | if (options.escaping) { |
| 385 | delimiter = std::make_shared< |
| 386 | LexingBoundaryFinder<internal::SpecializedOptions<true, true>>>(options); |
| 387 | } else { |
| 388 | delimiter = std::make_shared< |
| 389 | LexingBoundaryFinder<internal::SpecializedOptions<true, false>>>(options); |
| 390 | } |
| 391 | } else { |
| 392 | if (options.escaping) { |
| 393 | delimiter = std::make_shared< |
| 394 | LexingBoundaryFinder<internal::SpecializedOptions<false, true>>>(options); |
| 395 | } else { |
| 396 | delimiter = std::make_shared< |
| 397 | LexingBoundaryFinder<internal::SpecializedOptions<false, false>>>(options); |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | return std::make_unique<Chunker>(std::move(delimiter)); |
| 402 | } |
| 403 | |
| 404 | } // namespace csv |
| 405 | } // namespace arrow |