Vince's CSV Parser
Loading...
Searching...
No Matches
raw_csv_field.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <cassert>
8
9#include "../common.hpp"
10
11namespace csv {
12 namespace internals {
13 namespace memory {
15 struct RawCSVField {
16 RawCSVField() = default;
18 size_t _start,
19 size_t _length,
20 bool _is_realized = false
21 ) noexcept {
22 assert(_start <= CSV_CHUNK_INDEX_MAX);
23 assert(_length <= CSV_CHUNK_INDEX_MAX);
24 start = static_cast<CSVChunkIndex>(_start);
25 length = static_cast<CSVChunkIndex>(_length);
27 }
28
31
34
36 bool is_realized = false;
37
38 CONSTEXPR bool has_realized_storage() const noexcept {
39 return is_realized;
40 }
41 };
42 }
43 }
44}
Borrow a row and error state for synchronous, single-pass field access.
std::uint32_t CSVChunkIndex
Type used to represent the location of a CSV byte within a larger chunk.
Definition common.hpp:419
#define CONSTEXPR
Expands to constexpr in decent compilers and inline otherwise.
Definition common.hpp:259
The all encompassing namespace.
A barebones class used for describing CSV fields.
CSVChunkIndex length
Field length in the selected backing storage.
bool is_realized
True when start/length refer to RawCSVData::quote_arena instead of RawCSVData::data.
CSVChunkIndex start
Raw row-relative start, or quote-arena logical start when is_realized is true.