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 39 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 58 of file common.hpp.

58 {
59 const char *codeStr = "";
60 switch (code) {
62 codeStr = "INTERNAL_LIMIT_REACHED";
63 break;
65 codeStr = "UNEXPECTED_EOF";
66 break;
68 codeStr = "INVALID_LINE_ENDING";
69 break;
71 codeStr = "QUOTE_PREMATURELY_TERMINATED";
72 break;
74 codeStr = "UNEXPECTED_QUOTE";
75 break;
77 codeStr = "END_OF_FILE";
78 break;
80 codeStr = "ALLOCATION_FAILED";
81 break;
83 codeStr = "SIZE_EXCEEDED";
84 break;
85 }
86
87 return io::print(writer, "ReadError\\{{}, {}\\}", codeStr, pos);
88 }
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:41
size_t pos
Human-readable position (i.e.
Definition common.hpp:43
Here is the call graph for this function:

◆ operator!=() [1/2]

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

Definition at line 49 of file common.hpp.

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

◆ operator!=() [2/2]

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

Definition at line 51 of file common.hpp.

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

◆ operator==() [1/2]

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

Definition at line 45 of file common.hpp.

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

◆ operator==() [2/2]

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

Definition at line 47 of file common.hpp.

47{ return code == o; }

Member Data Documentation

◆ ALLOCATION_FAILED

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

Definition at line 54 of file common.hpp.

◆ code

ReadErrorCode mtcore::csv::ReadError::code

Error code.

Definition at line 41 of file common.hpp.

◆ END_OF_FILE

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

Definition at line 53 of file common.hpp.

◆ pos

size_t mtcore::csv::ReadError::pos

Human-readable position (i.e.

index + 1)

Definition at line 43 of file common.hpp.

◆ SIZE_EXCEEDED

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

Definition at line 55 of file common.hpp.


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