OmniSciDB  dfae7c3b14
anonymous_namespace{DelimitedParserUtils.cpp} Namespace Reference

Functions

bool is_eol (const char &c, const import_export::CopyParams &copy_params)
 
void trim_space (const char *&field_begin, const char *&field_end)
 
void trim_quotes (const char *&field_begin, const char *&field_end, const import_export::CopyParams &copy_params)
 

Function Documentation

◆ is_eol()

bool anonymous_namespace{DelimitedParserUtils.cpp}::is_eol ( const char &  c,
const import_export::CopyParams copy_params 
)
inline

Definition at line 31 of file DelimitedParserUtils.cpp.

References import_export::CopyParams::line_delim.

Referenced by import_export::delimited_parser::get_row().

31  {
32  return c == copy_params.line_delim || c == '\n' || c == '\r';
33 }
+ Here is the caller graph for this function:

◆ trim_quotes()

void anonymous_namespace{DelimitedParserUtils.cpp}::trim_quotes ( const char *&  field_begin,
const char *&  field_end,
const import_export::CopyParams copy_params 
)
inline

Definition at line 45 of file DelimitedParserUtils.cpp.

References import_export::CopyParams::quote, and import_export::CopyParams::quoted.

Referenced by import_export::delimited_parser::get_row().

47  {
48  if (copy_params.quoted && field_end - field_begin > 0 &&
49  *field_begin == copy_params.quote) {
50  ++field_begin;
51  }
52  if (copy_params.quoted && field_end - field_begin > 0 &&
53  *(field_end - 1) == copy_params.quote) {
54  --field_end;
55  }
56 }
+ Here is the caller graph for this function:

◆ trim_space()

void anonymous_namespace{DelimitedParserUtils.cpp}::trim_space ( const char *&  field_begin,
const char *&  field_end 
)
inline

Definition at line 35 of file DelimitedParserUtils.cpp.

35  {
36  while (field_begin < field_end && (*field_begin == ' ' || *field_begin == '\r')) {
37  ++field_begin;
38  }
39  while (field_begin < field_end &&
40  (*(field_end - 1) == ' ' || *(field_end - 1) == '\r')) {
41  --field_end;
42  }
43 }