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

#include <common.hpp>

Collaboration diagram for mtcore::csv::ReadError:

Public Member Functions

bool operator== (const ReadError &o) const
 
bool operator== (const ReadErrorCode &o) const
 
bool operator!= (const ReadError &o) const
 
bool operator!= (const ReadErrorCode &o) const
 
template<WriterImpl WI>
Result< size_t, typename io::Writer< WI >::ErrType > fmt (io::Writer< WI > &writer, const io::FormatOptions &)
 

Public Attributes

ReadErrorCode code
 Error code.
 
size_t pos
 Human-readable position (i.e.
 

Static Public Attributes

static const ReadError END_OF_FILE
 
static const ReadError ALLOCATION_FAILED
 
static const ReadError SIZE_EXCEEDED
 

Detailed Description

Definition at line 21 of file common.hpp.

Member Function Documentation

◆ fmt()

template<WriterImpl WI>
Result< size_t, typename io::Writer< WI >::ErrType > mtcore::csv::ReadError::fmt ( io::Writer< WI > & writer,
const io::FormatOptions &  )
inline

Definition at line 40 of file common.hpp.

40 {
41 const char* codeStr = "";
42 switch (code) {
44 codeStr = "INTERNAL_LIMIT_REACHED";
45 break;
47 codeStr = "UNEXPECTED_EOF";
48 break;
50 codeStr = "INVALID_LINE_ENDING";
51 break;
53 codeStr = "QUOTE_PREMATURELY_TERMINATED";
54 break;
56 codeStr = "UNEXPECTED_QUOTE";
57 break;
59 codeStr = "END_OF_FILE";
60 break;
62 codeStr = "ALLOCATION_FAILED";
63 break;
65 codeStr = "SIZE_EXCEEDED";
66 break;
67 }
68
69 return io::print(writer, "ReadError\\{{}, {}\\}", codeStr, pos);
70 }
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.
Result< size_t, typename Writer< WI >::ErrType > print(Writer< WI > &writer, const char *fmt, const Args &...args)
Prints arguments using a format string Element insert points are designated by a pair of curly braces...
ReadErrorCode code
Error code.
Definition common.hpp:23
size_t pos
Human-readable position (i.e.
Definition common.hpp:25
Here is the call graph for this function:

◆ operator!=() [1/2]

bool mtcore::csv::ReadError::operator!= ( const ReadError & o) const
inline

Definition at line 31 of file common.hpp.

31{ return !(*this == o); }

◆ operator!=() [2/2]

bool mtcore::csv::ReadError::operator!= ( const ReadErrorCode & o) const
inline

Definition at line 33 of file common.hpp.

33{ return !(*this == o); }

◆ operator==() [1/2]

bool mtcore::csv::ReadError::operator== ( const ReadError & o) const
inline

Definition at line 27 of file common.hpp.

27{ return code == o.code && pos == o.pos; }

◆ operator==() [2/2]

bool mtcore::csv::ReadError::operator== ( const ReadErrorCode & o) const
inline

Definition at line 29 of file common.hpp.

29{ return code == o; }

Member Data Documentation

◆ ALLOCATION_FAILED

const ReadError mtcore::csv::ReadError::ALLOCATION_FAILED
static

Definition at line 36 of file common.hpp.

◆ code

ReadErrorCode mtcore::csv::ReadError::code

Error code.

Definition at line 23 of file common.hpp.

◆ END_OF_FILE

const ReadError mtcore::csv::ReadError::END_OF_FILE
static

Definition at line 35 of file common.hpp.

◆ pos

size_t mtcore::csv::ReadError::pos

Human-readable position (i.e.

index + 1)

Definition at line 25 of file common.hpp.

◆ SIZE_EXCEEDED

const ReadError mtcore::csv::ReadError::SIZE_EXCEEDED
static

Definition at line 37 of file common.hpp.


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