FACT++  1.0
string Tools::Uncomment ( const std::string &  opt)

Returns the string with a comment (introduced by a #) stripped. The comment mark can be escaped by either # or "#"

Definition at line 292 of file tools.cc.

References begin.

Referenced by Readline::ProcessLine().

293 {
294  using namespace boost;
295  typedef escaped_list_separator<char> separator;
296 
297  const auto it = tokenizer<separator>(opt, separator("\\", "#", "\"'")).begin();
298 
299  const int charPos = it.base() - opt.begin();
300 
301  return charPos<1 ? "" : opt.substr(0, opt[charPos-1]=='#' ? charPos-1 : charPos);
302 }
double begin

+ Here is the caller graph for this function: