MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::csv::SliceParser::RowReader Struct Reference

#include <slice.hpp>

Collaboration diagram for mtcore::csv::SliceParser::RowReader:

Public Types

using ReadElem = Row
 
using ErrType = ReadError
 

Public Member Functions

Result< Slice< const ReadElem >, ErrTyperead (Slice< ReadElem > out)
 

Public Attributes

Iter iter
 

Detailed Description

Definition at line 98 of file csv/slice.hpp.

Member Typedef Documentation

◆ ErrType

◆ ReadElem

Member Function Documentation

◆ read()

Result< Slice< const ReadElem >, ErrType > mtcore::csv::SliceParser::RowReader::read ( Slice< ReadElem > out)
inline

Definition at line 103 of file csv/slice.hpp.

103 {
104 Row cur;
105 size_t read = 0;
106 while (read < out.len && iter.next().copy_if_present(cur)) {
107 out[read++] = cur;
108 }
109 if (iter.parser.error.has_value()) {
110 return error(iter.parser.error.value());
111 }
112 return success(out.sub(0, read).to_const());
113 }
Success< void > success()
Creates a successful void Result object.
Definition result.hpp:398
Error< Underlying > error(Underlying err)
Creates an error.
Definition result.hpp:425
Result< Slice< const ReadElem >, ErrType > read(Slice< ReadElem > out)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ iter

Iter mtcore::csv::SliceParser::RowReader::iter

Definition at line 101 of file csv/slice.hpp.


The documentation for this struct was generated from the following file: