Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CSVStates Struct Reference

Public Member Functions

void Initialize (CSVState initial_state=CSVState::NOT_SET)
bool NewValue () const
bool NewRow () const
bool WasStandard () const
bool EmptyLastValue () const
bool EmptyLine () const
bool IsDelimiterBytes () const
bool IsDelimiter () const
bool IsNotSet () const
bool IsComment () const
bool IsCurrentNewRow () const
bool IsCarriageReturn () const
bool IsInvalid () const
bool IsQuoted () const
bool IsUnquoted () const
bool IsEscaped () const
bool IsQuotedCurrent () const
bool IsState (const CSVState state) const
bool WasState (const CSVState state) const

Public Attributes

CSVState states [2]

Detailed Description

State of necessary CSV States to parse file Current, previous, and state before the previous

Member Function Documentation

◆ Initialize()

void duckdb::CSVStates::Initialize ( CSVState initial_state = CSVState::NOT_SET)
inline
165902 {
165903 states[0] = initial_state;
165904 states[1] = initial_state;
165905 }

◆ NewValue()

bool duckdb::CSVStates::NewValue ( ) const
inline
165906 {
165907 return states[1] == CSVState::DELIMITER;
165908 }
@ DELIMITER
Regular unquoted field state.
Definition duckdb.cpp:59175

◆ NewRow()

bool duckdb::CSVStates::NewRow ( ) const
inline
165910 {
165911 // It is a new row, if the previous state is not a record separator, and the current one is
165912 return states[0] != CSVState::RECORD_SEPARATOR && states[0] != CSVState::CARRIAGE_RETURN &&
165913 (states[1] == CSVState::RECORD_SEPARATOR || states[1] == CSVState::CARRIAGE_RETURN);
165914 }
@ CARRIAGE_RETURN
State after encountering a record separator (i.e., ).
Definition duckdb.cpp:59182
@ RECORD_SEPARATOR
-----------------------------------------------------------------------------------------------------...
Definition duckdb.cpp:59181

◆ WasStandard()

bool duckdb::CSVStates::WasStandard ( ) const
inline
165916 {
165917 return states[0] == CSVState::STANDARD;
165918 }

◆ EmptyLastValue()

bool duckdb::CSVStates::EmptyLastValue ( ) const
inline
165920 {
165921 // It is a new row, if the previous state is not a record separator, and the current one is
165922 return (states[0] == CSVState::DELIMITER &&
165923 (states[1] == CSVState::RECORD_SEPARATOR || states[1] == CSVState::CARRIAGE_RETURN ||
165924 states[1] == CSVState::DELIMITER)) ||
165925 (states[0] == CSVState::STANDARD && states[1] == CSVState::DELIMITER);
165926 }

◆ EmptyLine()

bool duckdb::CSVStates::EmptyLine ( ) const
inline
165928 {
165929 return (states[1] == CSVState::CARRIAGE_RETURN || states[1] == CSVState::RECORD_SEPARATOR) &&
165930 (states[0] == CSVState::RECORD_SEPARATOR || states[0] == CSVState::NOT_SET);
165931 }
@ NOT_SET
Got to an Invalid State, this should error.
Definition duckdb.cpp:59187

◆ IsDelimiterBytes()

bool duckdb::CSVStates::IsDelimiterBytes ( ) const
inline
165933 {
165934 return states[0] == CSVState::DELIMITER_FIRST_BYTE || states[0] == CSVState::DELIMITER_SECOND_BYTE ||
165935 states[0] == CSVState::DELIMITER_THIRD_BYTE;
165936 }
@ DELIMITER_FIRST_BYTE
----------— Multi-byte Delimiter States (up to 4 bytes) -------------------------------------------—!...
Definition duckdb.cpp:59177
@ DELIMITER_SECOND_BYTE
State when encountering the first delimiter byte of a multi-byte delimiter.
Definition duckdb.cpp:59178
@ DELIMITER_THIRD_BYTE
State when encountering the second delimiter byte of a multi-byte delimiter.
Definition duckdb.cpp:59179

◆ IsDelimiter()

bool duckdb::CSVStates::IsDelimiter ( ) const
inline
165938 {
165939 return states[1] == CSVState::DELIMITER;
165940 }

◆ IsNotSet()

bool duckdb::CSVStates::IsNotSet ( ) const
inline
165942 {
165943 return states[1] == CSVState::NOT_SET;
165944 }

◆ IsComment()

bool duckdb::CSVStates::IsComment ( ) const
inline
165946 {
165947 return states[1] == CSVState::COMMENT;
165948 }
@ COMMENT
If we have empty spaces in the beginning and end of value.
Definition duckdb.cpp:59190

◆ IsCurrentNewRow()

bool duckdb::CSVStates::IsCurrentNewRow ( ) const
inline
165950 {
165951 return states[1] == CSVState::RECORD_SEPARATOR || states[1] == CSVState::CARRIAGE_RETURN;
165952 }

◆ IsCarriageReturn()

bool duckdb::CSVStates::IsCarriageReturn ( ) const
inline
165954 {
165955 return states[1] == CSVState::CARRIAGE_RETURN;
165956 }

◆ IsInvalid()

bool duckdb::CSVStates::IsInvalid ( ) const
inline
165958 {
165959 return states[1] == CSVState::INVALID;
165960 }
@ INVALID
State when encountering an escape character (e.g., ).
Definition duckdb.cpp:59186

◆ IsQuoted()

bool duckdb::CSVStates::IsQuoted ( ) const
inline
165962 {
165963 return states[0] == CSVState::QUOTED;
165964 }
@ QUOTED
State after encountering a carriage return(i.e., \r).
Definition duckdb.cpp:59183

◆ IsUnquoted()

bool duckdb::CSVStates::IsUnquoted ( ) const
inline
165965 {
165966 return states[0] == CSVState::UNQUOTED;
165967 }
@ UNQUOTED
State when inside a quoted field.
Definition duckdb.cpp:59184

◆ IsEscaped()

bool duckdb::CSVStates::IsEscaped ( ) const
inline
165968 {
165969 switch (states[1]) {
165970 case CSVState::ESCAPE:
165973 return true;
165974 case CSVState::QUOTED:
165975 return states[0] == CSVState::UNQUOTED || states[0] == CSVState::MAYBE_QUOTED;
165976 case CSVState::UNQUOTED:
165977 return states[0] == CSVState::MAYBE_QUOTED;
165978 default:
165979 return false;
165980 }
165981 }
@ UNQUOTED_ESCAPE
State used for figuring out a new line.
Definition duckdb.cpp:59192
@ ESCAPE
State when leaving a quoted field.
Definition duckdb.cpp:59185
@ ESCAPED_RETURN
State when encountering an escape character (e.g., ) in an unquoted field.
Definition duckdb.cpp:59193
@ MAYBE_QUOTED
State when the carriage return is preceded by an escape character (for '\r ' newline only).
Definition duckdb.cpp:59194

◆ IsQuotedCurrent()

bool duckdb::CSVStates::IsQuotedCurrent ( ) const
inline
165982 {
165983 return states[1] == CSVState::QUOTED || states[1] == CSVState::QUOTED_NEW_LINE;
165984 }
@ QUOTED_NEW_LINE
If the state is not set, usually the first state before getting the first character.
Definition duckdb.cpp:59188

◆ IsState()

bool duckdb::CSVStates::IsState ( const CSVState state) const
inline
165985 {
165986 return states[1] == state;
165987 }

◆ WasState()

bool duckdb::CSVStates::WasState ( const CSVState state) const
inline
165988 {
165989 return states[0] == state;
165990 }

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