OmniSciDB  addbbd5075
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

Definition at line 769 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

769  {
770  // Strip the web section out of the config file so boost can validate program options
771  std::stringstream ss;
772  std::string line;
773  while (std::getline(in, line)) {
774  ss << line << "\n";
775  if (line == "[web]") {
776  break;
777  }
778  }
779  return ss;
780 }

+ Here is the caller graph for this function:

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

Definition at line 782 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

782  {
783  if (!filename.empty()) {
784  boost::algorithm::trim_if(filename, boost::is_any_of("\"'"));
785  if (!boost::filesystem::exists(filename)) {
786  std::cerr << desc << " " << filename << " does not exist." << std::endl;
787  return false;
788  }
789  }
790  return true;
791 }
std::string filename(char const *path)
Definition: Logger.cpp:58

+ Here is the caller graph for this function: