OmniSciDB  cde582ebc3
 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 429 of file StringDictionaryProxy.cpp.

References run_benchmark_import::res.

Referenced by StringDictionaryProxy::getCompare().

431  {
432  int res = str.compare(pattern);
433  if (comp_operator == "<") {
434  return res < 0;
435  } else if (comp_operator == "<=") {
436  return res <= 0;
437  } else if (comp_operator == "=") {
438  return res == 0;
439  } else if (comp_operator == ">") {
440  return res > 0;
441  } else if (comp_operator == ">=") {
442  return res >= 0;
443  } else if (comp_operator == "<>") {
444  return res != 0;
445  }
446  throw std::runtime_error("unsupported string compare operator");
447 }

+ 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 389 of file StringDictionaryProxy.cpp.

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

393  {
394  return icase
395  ? (is_simple ? string_ilike_simple(
396  str.c_str(), str.size(), pattern.c_str(), pattern.size())
397  : string_ilike(str.c_str(),
398  str.size(),
399  pattern.c_str(),
400  pattern.size(),
401  escape))
402  : (is_simple ? string_like_simple(
403  str.c_str(), str.size(), pattern.c_str(), pattern.size())
404  : string_like(str.c_str(),
405  str.size(),
406  pattern.c_str(),
407  pattern.size(),
408  escape));
409 }
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 466 of file StringDictionaryProxy.cpp.

References regexp_like().

468  {
469  return regexp_like(str.c_str(), str.size(), pattern.c_str(), pattern.size(), escape);
470 }
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: