OmniSciDB  a47db9e897
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{DelimitedParserUtils.cpp} Namespace Reference

Functions

bool is_eol (const char &c, const Importer_NS::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 Importer_NS::CopyParams &copy_params)
 

Function Documentation

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

Definition at line 29 of file DelimitedParserUtils.cpp.

References Importer_NS::CopyParams::line_delim.

Referenced by Importer_NS::DelimitedParserUtils::get_row().

29  {
30  return c == copy_params.line_delim || c == '\n' || c == '\r';
31 }

+ Here is the caller graph for this function:

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

Definition at line 43 of file DelimitedParserUtils.cpp.

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

Referenced by Importer_NS::DelimitedParserUtils::get_row().

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

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

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