OmniSciDB  5ade3759e0
anonymous_namespace{MapDServer.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)
 

Function Documentation

◆ sanitize_config_file()

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

Definition at line 664 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

664  {
665  // Strip the web section out of the config file so boost can validate program options
666  std::stringstream ss;
667  std::string line;
668  while (std::getline(in, line)) {
669  ss << line << "\n";
670  if (line == "[web]") {
671  break;
672  }
673  }
674  return ss;
675 }
+ Here is the caller graph for this function:

◆ trim_and_check_file_exists()

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

Definition at line 677 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

677  {
678  if (!filename.empty()) {
679  boost::algorithm::trim_if(filename, boost::is_any_of("\"'"));
680  if (!boost::filesystem::exists(filename)) {
681  std::cerr << desc << " " << filename << " does not exist." << std::endl;
682  return false;
683  }
684  }
685  return true;
686 }
+ Here is the caller graph for this function: