OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 145 of file StringDictionaryProxy.cpp.

References run_benchmark_import::res.

Referenced by StringDictionaryProxy::getCompare().

147  {
148  int res = str.compare(pattern);
149  if (comp_operator == "<") {
150  return res < 0;
151  } else if (comp_operator == "<=") {
152  return res <= 0;
153  } else if (comp_operator == "=") {
154  return res == 0;
155  } else if (comp_operator == ">") {
156  return res > 0;
157  } else if (comp_operator == ">=") {
158  return res >= 0;
159  } else if (comp_operator == "<>") {
160  return res != 0;
161  }
162  throw std::runtime_error("unsupported string compare operator");
163 }

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

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

108  {
109  return icase
110  ? (is_simple ? string_ilike_simple(
111  str.c_str(), str.size(), pattern.c_str(), pattern.size())
112  : string_ilike(str.c_str(),
113  str.size(),
114  pattern.c_str(),
115  pattern.size(),
116  escape))
117  : (is_simple ? string_like_simple(
118  str.c_str(), str.size(), pattern.c_str(), pattern.size())
119  : string_like(str.c_str(),
120  str.size(),
121  pattern.c_str(),
122  pattern.size(),
123  escape));
124 }
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:257
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:246
DEVICE bool string_ilike_simple(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len)
Definition: StringLike.cpp:59
DEVICE bool string_like_simple(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len)
Definition: StringLike.cpp:43

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

References regexp_like().

185  {
186  return regexp_like(str.c_str(), str.size(), pattern.c_str(), pattern.size(), escape);
187 }
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:40

+ Here is the call graph for this function: