OmniSciDB  1dac507f6e
 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 741 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

741  {
742  // Strip the web section out of the config file so boost can validate program options
743  std::stringstream ss;
744  std::string line;
745  while (std::getline(in, line)) {
746  ss << line << "\n";
747  if (line == "[web]") {
748  break;
749  }
750  }
751  return ss;
752 }

+ 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 754 of file MapDServer.cpp.

Referenced by MapDProgramOptions::parse_command_line().

754  {
755  if (!filename.empty()) {
756  boost::algorithm::trim_if(filename, boost::is_any_of("\"'"));
757  if (!boost::filesystem::exists(filename)) {
758  std::cerr << desc << " " << filename << " does not exist." << std::endl;
759  return false;
760  }
761  }
762  return true;
763 }
std::string filename(char const *path)
Definition: Logger.cpp:58

+ Here is the caller graph for this function: