bool NoSettings::FindDoubleEntry(const NoString& name, double& res, double defaultValue) { NoString s; if (FindStringEntry(name, s)) { res = s.toDouble(); return true; } res = defaultValue; return false; }
bool NoSettings::FindUShortEntry(const NoString& name, ushort& res, ushort defaultValue) { NoString s; if (FindStringEntry(name, s)) { res = s.toUShort(); return true; } res = defaultValue; return false; }
bool NoSettings::FindBoolEntry(const NoString& name, bool& res, bool defaultValue) { NoString s; if (FindStringEntry(name, s)) { res = s.toBool(); return true; } res = defaultValue; return false; }
char * STR_GetStringAddress( int idString ) { int idStr = ( idString & STR_ID ) ; int lenStr = 0 ; char * pStr = FindStringEntry( idStr , &lenStr ) ; return pStr ; } // End of function: STR &Get pointer to memory resident string table
void STR_String :: BuildString( int idString ) { // AE: All strings in the memory resident string table are zero terminated. // They also contain a length parameter. // It is assumed that the memory resident table is well formed. // This assumption is reasonable since the table is generated. int lenStr = -1 ; char * pStr = FindStringEntry( idString , &lenStr ) ; BuildString( lenStr , pStr ) ; } // End of function: STR $Build given an idString
STR_String :: STR_String( int idString ) { // Retrieve string from memory resident table pCharString = NULL ; if ( ( idString & STR_DOM ) == STR_MEM ) { BuildString( idString & STR_ID ) ; return ; } // end selection: Retrieve string from memory resident table // Retrieve string from parameter base else if ( ( idString & STR_DOM ) == STR_PMB ) { BuildString( STR_DomainNotImplemented & STR_ID ) ; return ; } // end selection: Retrieve string from parameter base // Domain not found int lenStr = 0 ; char * pStr = FindStringEntry( STR_ErrorTableDomain & STR_ID , &lenStr ) ; EXC_ENFORCE( strlen( pStr ) < DIM_ERROR_BUFFER - 15 ) ; sprintf( errorBuffer , pStr , idString & STR_DOM ) ; BuildString( strlen( errorBuffer ) , errorBuffer ) ; } // End of function: STR !Construct given an id of a string contained in a table