OmniSciDB  72c90bc290
 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 510 of file StringDictionaryProxy.cpp.

References run_benchmark_import::res.

Referenced by StringDictionaryProxy::getCompare().

512  {
513  int res = str.compare(pattern);
514  if (comp_operator == "<") {
515  return res < 0;
516  } else if (comp_operator == "<=") {
517  return res <= 0;
518  } else if (comp_operator == "=") {
519  return res == 0;
520  } else if (comp_operator == ">") {
521  return res > 0;
522  } else if (comp_operator == ">=") {
523  return res >= 0;
524  } else if (comp_operator == "<>") {
525  return res != 0;
526  }
527  throw std::runtime_error("unsupported string compare operator");
528 }

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

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

474  {
475  return icase
476  ? (is_simple ? string_ilike_simple(
477  str.c_str(), str.size(), pattern.c_str(), pattern.size())
478  : string_ilike(str.c_str(),
479  str.size(),
480  pattern.c_str(),
481  pattern.size(),
482  escape))
483  : (is_simple ? string_like_simple(
484  str.c_str(), str.size(), pattern.c_str(), pattern.size())
485  : string_like(str.c_str(),
486  str.size(),
487  pattern.c_str(),
488  pattern.size(),
489  escape));
490 }
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 547 of file StringDictionaryProxy.cpp.

References regexp_like().

549  {
550  return regexp_like(str.c_str(), str.size(), pattern.c_str(), pattern.size(), escape);
551 }
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: