OmniSciDB  1dac507f6e
 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 146 of file StringDictionaryProxy.cpp.

References run_benchmark_import::res.

Referenced by StringDictionaryProxy::getCompare().

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

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

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

109  {
110  return icase
111  ? (is_simple ? string_ilike_simple(
112  str.c_str(), str.size(), pattern.c_str(), pattern.size())
113  : string_ilike(str.c_str(),
114  str.size(),
115  pattern.c_str(),
116  pattern.size(),
117  escape))
118  : (is_simple ? string_like_simple(
119  str.c_str(), str.size(), pattern.c_str(), pattern.size())
120  : string_like(str.c_str(),
121  str.size(),
122  pattern.c_str(),
123  pattern.size(),
124  escape));
125 }
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 184 of file StringDictionaryProxy.cpp.

References regexp_like().

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