OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{CommandLineOptions.cpp} Namespace Reference

Functions

std::stringstream sanitize_config_file (std::ifstream &in)
 
bool trim_and_check_file_exists (std::string &filename, const std::string desc)
 
void addOptionalFileToBlacklist (std::string &filename)
 

Function Documentation

void anonymous_namespace{CommandLineOptions.cpp}::addOptionalFileToBlacklist ( std::string &  filename)

Definition at line 696 of file CommandLineOptions.cpp.

References ddl_utils::FilePathBlacklist::addToBlacklist().

Referenced by CommandLineOptions::validate().

696  {
697  if (!filename.empty()) {
699  }
700 }
std::string filename(char const *path)
Definition: Logger.cpp:62
static void addToBlacklist(const std::string &path)
Definition: DdlUtils.cpp:726

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::stringstream anonymous_namespace{CommandLineOptions.cpp}::sanitize_config_file ( std::ifstream &  in)

Definition at line 668 of file CommandLineOptions.cpp.

References parse_ast::line.

Referenced by CommandLineOptions::parse_command_line().

668  {
669  // Strip the web section out of the config file so boost can validate program options
670  std::stringstream ss;
671  std::string line;
672  while (std::getline(in, line)) {
673  // Skip config file only options
674  if (!boost::starts_with(line, "allowed-import-paths") &&
675  !boost::starts_with(line, "allowed-export-paths")) {
676  ss << line << "\n";
677  }
678  if (line == "[web]") {
679  break;
680  }
681  }
682  return ss;
683 }
tuple line
Definition: parse_ast.py:10

+ Here is the caller graph for this function:

bool anonymous_namespace{CommandLineOptions.cpp}::trim_and_check_file_exists ( std::string &  filename,
const std::string  desc 
)

Definition at line 685 of file CommandLineOptions.cpp.

Referenced by CommandLineOptions::parse_command_line().

685  {
686  if (!filename.empty()) {
687  boost::algorithm::trim_if(filename, boost::is_any_of("\"'"));
688  if (!boost::filesystem::exists(filename)) {
689  std::cerr << desc << " " << filename << " does not exist." << std::endl;
690  return false;
691  }
692  }
693  return true;
694 }
std::string filename(char const *path)
Definition: Logger.cpp:62

+ Here is the caller graph for this function: