예제 #1
0
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;
}
예제 #2
0
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;
}
예제 #3
0
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;
}
예제 #4
0
   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
예제 #5
0
   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
예제 #6
0
   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