1#ifndef MTCORE_CSV_SLICE_HPP
2#define MTCORE_CSV_SLICE_HPP
18 template<WriterImpl WI>
55 [[nodiscard]]
bool done()
const;
78 [[nodiscard]]
size_t size()
const;
106 while (
read < out.
len &&
iter.next().copy_if_present(cur)) {
109 if (
iter.parser.error.has_value()) {
132 while (
read < out.
len &&
iter.next().copy_if_present(cur)) {
144 if (
iter.error.has_value()) {
constexpr auto nullopt
Placeholder value for an empty Optional.
io::Writer< csv::impl::Writer< WI > > writer(io::Writer< WI > &underlying, Options opts={})
Creates a CSV writer which will encode the data before writing it out.
AllocationError
Error indicating failed allocation.
Success< void > success()
Creates a successful void Result object.
Error< Underlying > error(Underlying err)
Creates an error.
constexpr bool is_iterator
Boolean check for if something has the trait Iterator.
uint64_t u64
Alias for 64-bit unsigned ints.
Result< size_t, typename io::Writer< WI >::ErrType > decode(io::Writer< WI > &writer, Slice< const char > field, const Options options={})
CSV namespace for CSV-related utilities.
static constexpr u64 chunkSize
Represents a memory allocator Exact behavior depends on the underlying VTable used Should use the a_*...
Represents a value that may or may not exist (an "Optional" value) Similar concept to std::optional,...
Represents a Result that may have an error (error code) or a success value A type of "void" means the...
A Slice which is just a pointer + length Accessing elements through the array operator will do bounds...
constexpr Slice sub(size_t start) const noexcept
Gets a sub Slice from start.
constexpr bool empty() const noexcept
Checks if a Slice is empty.
constexpr Slice< std::add_const_t< T > > to_const() const noexcept
Converts to a const Slice.
CSV options for defining the CSV format.
Special output-only type for indicating the end of a row.
Optional< ReadError > error
FieldParser(const Slice< const char > &data, const Options &opts)
struct mtcore::csv::SliceParser::FieldParser::@151121121035013331367032363301340277215317161027 state
Optional< RowField > next()
bool has_next_chunk() const
Result< Slice< const ReadElem >, ErrType > read(Slice< ReadElem > out)
std::variant< RowEnd, Field > ReadElem
Result< Slice< char >, AllocationError > copy(Allocator alloc) const
Result< size_t, typename io::Writer< WI >::ErrType > decode(io::Writer< WI > &writer) const
Optional< ReadError > error() const
Result< Slice< const ReadElem >, ErrType > read(Slice< ReadElem > out)
Field operator[](size_t i) const
Slice< const char > slice
io::Reader< FieldReader > fields() const
io::Reader< RowReader > rows() const
A reader that reads data from some sort of stream or buffer Note: the data elements read should be tr...
A writer that writes data to some sort of stream or buffer Note: the data elements written should be ...