OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RowFunctionManager.h} Namespace Reference

Functions

std::string drop_suffix_impl (const std::string &str)
 
std::list< const Analyzer::Expr * > find_function_oper (const Analyzer::Expr *expr, const std::string &func_name_wo_suffix)
 

Function Documentation

std::string anonymous_namespace{RowFunctionManager.h}::drop_suffix_impl ( const std::string &  str)

Definition at line 27 of file RowFunctionManager.h.

References CHECK_GT.

Referenced by find_function_oper(), table_functions::TableFunctionsFactory::get_table_funcs(), RowFunctionManager::getDictDbId(), RowFunctionManager::getDictId(), and table_functions::TableFunction::getName().

27  {
28  const auto idx = str.find("__");
29  if (idx == std::string::npos) {
30  return str;
31  }
32  CHECK_GT(idx, std::string::size_type(0));
33  return str.substr(0, idx);
34 }
#define CHECK_GT(x, y)
Definition: Logger.h:305

+ Here is the caller graph for this function:

std::list<const Analyzer::Expr*> anonymous_namespace{RowFunctionManager.h}::find_function_oper ( const Analyzer::Expr expr,
const std::string &  func_name_wo_suffix 
)

Definition at line 36 of file RowFunctionManager.h.

References drop_suffix_impl(), Analyzer::Expr::find_expr(), and to_lower().

Referenced by RowFunctionManager::getDictDbId(), and RowFunctionManager::getDictId().

38  {
39  auto is_func_oper = [&func_name_wo_suffix](const Analyzer::Expr* e) -> bool {
40  auto function_oper = dynamic_cast<const Analyzer::FunctionOper*>(e);
41 
42  if (function_oper) {
43  std::string func_oper_name = drop_suffix_impl(function_oper->getName());
44  boost::algorithm::to_lower(func_oper_name);
45  if (func_name_wo_suffix == func_oper_name) {
46  return true;
47  }
48  }
49  return false;
50  };
51  std::list<const Analyzer::Expr*> funcoper_list;
52  expr->find_expr(is_func_oper, funcoper_list);
53  return funcoper_list;
54 }
std::string to_lower(const std::string &str)
std::string drop_suffix_impl(const std::string &str)
virtual void find_expr(std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const
Definition: Analyzer.h:163

+ Here is the call graph for this function:

+ Here is the caller graph for this function: