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

Functions

bool is_like (const std::string &str, const std::string &pattern, const bool icase, const bool is_simple, const char escape)
 
bool do_compare (const std::string &str, const std::string &pattern, const std::string &comp_operator)
 
bool is_regexp_like (const std::string &str, const std::string &pattern, const char escape)
 

Function Documentation

bool anonymous_namespace{StringDictionaryProxy.cpp}::do_compare ( const std::string &  str,
const std::string &  pattern,
const std::string &  comp_operator 
)

Definition at line 502 of file StringDictionaryProxy.cpp.

References run_benchmark_import::res.

Referenced by StringDictionaryProxy::getCompare().

504  {
505  int res = str.compare(pattern);
506  if (comp_operator == "<") {
507  return res < 0;
508  } else if (comp_operator == "<=") {
509  return res <= 0;
510  } else if (comp_operator == "=") {
511  return res == 0;
512  } else if (comp_operator == ">") {
513  return res > 0;
514  } else if (comp_operator == ">=") {
515  return res >= 0;
516  } else if (comp_operator == "<>") {
517  return res != 0;
518  }
519  throw std::runtime_error("unsupported string compare operator");
520 }

+ Here is the caller graph for this function:

bool anonymous_namespace{StringDictionaryProxy.cpp}::is_like ( const std::string &  str,
const std::string &  pattern,
const bool  icase,
const bool  is_simple,
const char  escape 
)

Definition at line 462 of file StringDictionaryProxy.cpp.

References string_ilike(), string_ilike_simple(), string_like(), and string_like_simple().

466  {
467  return icase
468  ? (is_simple ? string_ilike_simple(
469  str.c_str(), str.size(), pattern.c_str(), pattern.size())
470  : string_ilike(str.c_str(),
471  str.size(),
472  pattern.c_str(),
473  pattern.size(),
474  escape))
475  : (is_simple ? string_like_simple(
476  str.c_str(), str.size(), pattern.c_str(), pattern.size())
477  : string_like(str.c_str(),
478  str.size(),
479  pattern.c_str(),
480  pattern.size(),
481  escape));
482 }
RUNTIME_EXPORT DEVICE bool string_like(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
Definition: StringLike.cpp:244
RUNTIME_EXPORT DEVICE bool string_like_simple(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len)
Definition: StringLike.cpp:41
RUNTIME_EXPORT DEVICE bool string_ilike_simple(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len)
Definition: StringLike.cpp:57
RUNTIME_EXPORT DEVICE bool string_ilike(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
Definition: StringLike.cpp:255

+ Here is the call graph for this function:

bool anonymous_namespace{StringDictionaryProxy.cpp}::is_regexp_like ( const std::string &  str,
const std::string &  pattern,
const char  escape 
)

Definition at line 539 of file StringDictionaryProxy.cpp.

References regexp_like().

541  {
542  return regexp_like(str.c_str(), str.size(), pattern.c_str(), pattern.size(), escape);
543 }
RUNTIME_EXPORT DEVICE bool regexp_like(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
Definition: Regexp.cpp:39

+ Here is the call graph for this function: