parsercmd/src/clinterpret.cxx
// ===========================================================================
// Strings use C syntax. They begin and end with double-quotes.
// But within a string %n% is expanded using parameters, and %% represents
// a single percent, as it does elsewhere in parsercmd.
// Also note that the double-quotes must be escaped in the XML attribute using &quot;,
// which is a pain, but it's part of XML and it's better to use " than ' because in
// several languages the single quotes suppress expansion.
//
Strings use C syntax. They begin and end with double-quotes.
But within a string %n% is expanded using parameters, and %% represents
a single percent, as it does elsewhere in parsercmd.
Also note that the double-quotes must be escaped in the XML attribute using ",
which is a pain, but it's part of XML and it's better to use " than ' because in
several languages the single quotes suppress expansion.
Strings use C syntax . They begin and end with double - quotes . But within a string %n% is expanded using parameters and %% represents a single percent as it does elsewhere in parsercmd . Also note that the double - quotes must be escaped in the XML attribute using " which is a pain but it ' s part of XML and it ' s better to use " than ' because in several languages the single quotes suppress expansion .
bool SwitchExprParser::str(string &result) {
    if (!match("\"")) {
	return false;
    }
    string str;
    bool escaping = false;
    for (;;) {
	if (peek() == '\0') {
	    return false;
	}
	char ch;
	a_char(ch);
	if (escaping) {
	    str += ch;
	    escaping = false;
	}
	else if (ch == '"') {
	    break;
	}
	else if (ch == '\\') {
	    escaping = true;
	}
	else {
	    str += ch;
	}
    }
    result = substitute_env(str, args);
    return true;
}
bool SwitchExprParser :: str ( string & result ) { if ( ! match ( " \" " ) ) { return false ; } string str ; bool escaping = false ; for ( ; ; ) { if ( peek ( ) == ' \0 ' ) { return false ; } char ch ; a_char ( ch ) ; if ( escaping ) { str += ch ; escaping = false ; } else if ( ch == ' ' ) { break ; } else if ( ch == ' \\ ' ) { escaping = true ; } else { str += ch ; } } result = substitute_env ( str , args ) ; return true ; }
Strings use C syntax.
Strings use C syntax .
// We have the C-string-like contents. // Interpret the %'s.