model_server/machine_prefs/src/pref_registry.cxx
// Put a string value into the preference dictionary.
Put a string value into the preference dictionary.
Put a string value into the preference dictionary .
bool prefRegistry::putPref(const char* keyname,
                            const genString value,
                            const int expansion ,
                            const bool persistent )
{
    Initialize(prefRegistry::putPref);
     bool saveIt = persistent && hasUserPrefs();
     bool status = insertTable(keyname, value, expansion, saveIt);
    if (status && saveIt) {
       Pref* item;
        int index;
        status = getTableIndex(keyname, index);
        if (status) {
            item = prefTable[index];
            status = UserPrefFile_->Write(keyname, item->intPref);
           if (expansion == prefRegistry::EXPAND_COLONS_TO_NONE)
               status = UserPrefFile_->Write(keyname, item->unexpandedStrPref);
           else
               status = UserPrefFile_->Write(keyname, item->strPref);
        }
   }
   if (status == false)
      msg("Problem putting pref \'$1\'", error_sev) << keyname << eom;
   return (status);
}
bool prefRegistry :: putPref ( const char * keyname , const genString value , const int expansion , const bool persistent ) { Initialize ( prefRegistry :: putPref ) ; bool saveIt = persistent && hasUserPrefs ( ) ; bool status = insertTable ( keyname , value , expansion , saveIt ) ; if ( status && saveIt ) { Pref * item ; int index ; status = getTableIndex ( keyname , index ) ; if ( status ) { item = prefTable [ index ] ; status = UserPrefFile_ -> Write ( keyname , item -> intPref ) ; if ( expansion == prefRegistry :: EXPAND_COLONS_TO_NONE ) status = UserPrefFile_ -> Write ( keyname , item -> unexpandedStrPref ) ; else status = UserPrefFile_ -> Write ( keyname , item -> strPref ) ; } } if ( status == false ) msg ( " \' \' " , error_sev ) << keyname << eom ; return ( status ) ; }
Put a string value into the preference dictionary.
Put a string value into the preference dictionary .
/*=EXPAND_NONE_TO_META*/ /*=true*/ // If no user prefs are available, nothing can be persistent. // Create or update the table entry. // Update the file if the value is persistent. // Only save persistent, unexpanded preferences.