model_server/machine_prefs/src/pref_registry.cxx
// Utility to expand a string preference.
Utility to expand a string preference.
Utility to expand a string preference .
bool prefRegistry::expandPref(int index, const genString value)
{
    bool status = true;
    prefExpansion expansion = (prefExpansion) prefTable[index]->expandType;
    switch(expansion) {
        case EXPAND_NONE:
            prefTable[index]->unexpandedStrPref = value;
            prefTable[index]->strPref = prefTable[index]->unexpandedStrPref;
            break;
        case EXPAND_NONE_TO_META:
            prefTable[index]->unexpandedStrPref = value;
            status = expandMeta(index);
            break;
        case EXPAND_NONE_TO_COLONS:
            prefTable[index]->unexpandedStrPref = value;
            status = expandMeta(index);
            if (status) {
                genString tmpStr;
                if (expandColons(prefTable[index]->strPref, tmpStr) )
                    prefTable[index]->strPref = tmpStr;
            }
            break;
        case EXPAND_COLONS_TO_NONE:
            prefTable[index]->strPref = value;
            status = unexpandColons(prefTable[index]->unexpandedStrPref, prefTable[index]->strPref);
            break;
    }
    if (!status) {
        msg("Problem expanding value \'$1\' for preference \'$2\'.", error_sev) << (char*) prefTable[index]->unexpandedStrPref << eoarg << (char*) prefTable[index]->key << eom;
    }
    return(status);
}
bool prefRegistry :: expandPref ( int index , const genString value ) { bool status = true ; prefExpansion expansion = ( prefExpansion ) prefTable [ index ] -> expandType ; switch ( expansion ) { case EXPAND_NONE : prefTable [ index ] -> unexpandedStrPref = value ; prefTable [ index ] -> strPref = prefTable [ index ] -> unexpandedStrPref ; break ; case EXPAND_NONE_TO_META : prefTable [ index ] -> unexpandedStrPref = value ; status = expandMeta ( index ) ; break ; case EXPAND_NONE_TO_COLONS : prefTable [ index ] -> unexpandedStrPref = value ; status = expandMeta ( index ) ; if ( status ) { genString tmpStr ; if ( expandColons ( prefTable [ index ] -> strPref , tmpStr ) ) prefTable [ index ] -> strPref = tmpStr ; } break ; case EXPAND_COLONS_TO_NONE : prefTable [ index ] -> strPref = value ; status = unexpandColons ( prefTable [ index ] -> unexpandedStrPref , prefTable [ index ] -> strPref ) ; break ; } if ( ! status ) { msg ( " \' \' \' \' " , error_sev ) << ( char * ) prefTable [ index ] -> unexpandedStrPref << eoarg << ( char * ) prefTable [ index ] -> key << eom ; } return ( status ) ; }
Utility to expand a string preference.
Utility to expand a string preference .