OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

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

Definition at line 32 of file DelimitedParserUtils.cpp.

References import_export::CopyParams::line_delim.

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

32  {
33  return c == copy_params.line_delim || c == '\n' || c == '\r';
34 }

+ Here is the caller graph for this function:

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 46 of file DelimitedParserUtils.cpp.

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

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

48  {
49  if (copy_params.quoted && field_end - field_begin > 0 &&
50  *field_begin == copy_params.quote) {
51  ++field_begin;
52  }
53  if (copy_params.quoted && field_end - field_begin > 0 &&
54  *(field_end - 1) == copy_params.quote) {
55  --field_end;
56  }
57 }

+ Here is the caller graph for this function:

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

Definition at line 36 of file DelimitedParserUtils.cpp.

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