OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Regexp.cpp File Reference
#include "Regexp.h"
#include <boost/regex.hpp>
#include <stdexcept>
+ Include dependency graph for Regexp.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 
RUNTIME_EXPORT DEVICE int8_t regexp_like_nullable (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char, const int8_t bool_null)
 

Function Documentation

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 at line 41 of file Regexp.cpp.

References run_benchmark_import::result.

Referenced by anonymous_namespace{StringDictionaryProxy.cpp}::is_regexp_like(), anonymous_namespace{StringDictionary.cpp}::is_regexp_like(), and regexp_like_nullable().

45  {
46 #ifndef __CUDACC__
47  bool result;
48  try {
49  boost::regex re(pattern, pat_len, boost::regex::extended);
50  boost::cmatch what;
51  result = boost::regex_match(str, str + str_len, what, re);
52  } catch (std::runtime_error& error) {
53  // LOG(ERROR) << "Regexp match error: " << error.what();
54  result = false;
55  }
56  return result;
57 #else
58  return false;
59 #endif
60 }

+ Here is the caller graph for this function:

RUNTIME_EXPORT DEVICE int8_t regexp_like_nullable ( const char *  str,
const int32_t  str_len,
const char *  pattern,
const int32_t  pat_len,
const char  escape_char,
const int8_t  bool_null 
)

Definition at line 62 of file Regexp.cpp.

References regexp_like().

67  {
68  if (!str || !pattern) {
69  return bool_null;
70  }
71 
72  return regexp_like(str, str_len, pattern, pat_len, escape_char);
73 }
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:41

+ Here is the call graph for this function: