OmniSciDB  2e3a973ef4
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

◆ addOptionalFileToBlacklist()

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

Definition at line 662 of file CommandLineOptions.cpp.

References ddl_utils::FilePathBlacklist::addToBlacklist().

Referenced by CommandLineOptions::validate().

662  {
663  if (!filename.empty()) {
665  }
666 }
std::string filename(char const *path)
Definition: Logger.cpp:62
static void addToBlacklist(const std::string &path)
Definition: DdlUtils.cpp:724
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sanitize_config_file()

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

Definition at line 634 of file CommandLineOptions.cpp.

References parse_ast::line.

Referenced by CommandLineOptions::parse_command_line().

634  {
635  // Strip the web section out of the config file so boost can validate program options
636  std::stringstream ss;
637  std::string line;
638  while (std::getline(in, line)) {
639  // Skip config file only options
640  if (!boost::starts_with(line, "allowed-import-paths") &&
641  !boost::starts_with(line, "allowed-export-paths")) {
642  ss << line << "\n";
643  }
644  if (line == "[web]") {
645  break;
646  }
647  }
648  return ss;
649 }
+ Here is the caller graph for this function:

◆ trim_and_check_file_exists()

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

Definition at line 651 of file CommandLineOptions.cpp.

Referenced by CommandLineOptions::parse_command_line().

651  {
652  if (!filename.empty()) {
653  boost::algorithm::trim_if(filename, boost::is_any_of("\"'"));
654  if (!boost::filesystem::exists(filename)) {
655  std::cerr << desc << " " << filename << " does not exist." << std::endl;
656  return false;
657  }
658  }
659  return true;
660 }
std::string filename(char const *path)
Definition: Logger.cpp:62
+ Here is the caller graph for this function: