parsercmd/src/clinterpret.cxx
// ===========================================================================
// Provides the string translation of the given suffix, putting it
// into the translation block associated with the suffix interpreter.
Provides the string translation of the given suffix, putting it
into the translation block associated with the suffix interpreter.
Provides the string translation of the given suffix putting it into the translation block associated with the suffix interpreter .
bool CommandLineInterpreter::suffixString(const string &suffix, string &result) const
{
    bool have_result = false;
    string low;
    lower(suffix, low);
    a_suffix_ptr_map::const_iterator it;
    const SuffixInterpreter *result_interpreter = NULL;
    for (it = suffixes.begin(); it != suffixes.end(); ++it) {
	const SuffixInterpreter &sval = *((*it).second);
	bool got_result = false;
	if (sval.fold) {
	    string lw;
	    lower((*it).first, lw);
	    if (low == lw) {
		got_result = true;
	    }
	}
	else {
	    if (suffix == (*it).first) {
		got_result = true;
	    }
	}
	if (got_result) {
	    if (envargs != NULL) {
		result = substitute_env(sval.name, *envargs);
	    }
	    else {
		result = sval.name;
	    }
	    have_result = true;
            result_interpreter = &sval;
	}
    }
    if (result_interpreter != NULL) {
	TranslatedOutput &block = result_interpreter->block;
	block.translation.push_back(result);
    }
    return have_result;
}
bool CommandLineInterpreter :: suffixString ( const string & suffix , string & result ) const { bool have_result = false ; string low ; lower ( suffix , low ) ; a_suffix_ptr_map :: const_iterator it ; const SuffixInterpreter * result_interpreter = NULL ; for ( it = suffixes . begin ( ) ; it != suffixes . end ( ) ; ++ it ) { const SuffixInterpreter & sval = * ( ( * it ) . second ) ; bool got_result = false ; if ( sval . fold ) { string lw ; lower ( ( * it ) . first , lw ) ; if ( low == lw ) { got_result = true ; } } else { if ( suffix == ( * it ) . first ) { got_result = true ; } } if ( got_result ) { if ( envargs != NULL ) { result = substitute_env ( sval . name , * envargs ) ; } else { result = sval . name ; } have_result = true ; result_interpreter = & sval ; } } if ( result_interpreter != NULL ) { TranslatedOutput & block = result_interpreter -> block ; block . translation . push_back ( result ) ; } return have_result ; }
Provides the string translation of the given suffix, putting it
into the translation block associated with the suffix interpreter.
Provides the string translation of the given suffix putting it into the translation block associated with the suffix interpreter .
// fold case