Changeset 10148

Show
Ignore:
Timestamp:
10/24/06 14:49:22 (2 years ago)
Author:
fwarmerdam
Message:

avoid using CPLString in arguments and return from RAT API

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gcore/gdal_rat.cpp

    r10129 r10148  
    2929 * 
    3030 * $Log$ 
     31 * Revision 1.10  2006/10/24 18:49:22  fwarmerdam 
     32 * avoid using CPLString in arguments and return from RAT API 
     33 * 
    3134 * Revision 1.9  2006/10/23 17:25:31  fwarmerdam 
    3235 * Fixed problem with <F> element has no text child because it is empty. 
     
    230233 */ 
    231234 
    232 CPLString GDALRasterAttributeTable::GetNameOfCol( int iCol ) const 
     235const char *GDALRasterAttributeTable::GetNameOfCol( int iCol ) const 
    233236 
    234237{ 
     
    423426 */ 
    424427 
    425 CPLString 
     428const char * 
    426429GDALRasterAttributeTable::GetValueAsString( int iRow, int iField ) const 
    427430 
     
    447450      case GFT_Integer: 
    448451      { 
    449           char szValue[100]; 
    450           sprintf( szValue, "%d", aoFields[iField].anValues[iRow] ); 
    451           return szValue
     452          ((GDALRasterAttributeTable *) this)-> 
     453              osWorkingResult.Printf( "%d", aoFields[iField].anValues[iRow] ); 
     454          return osWorkingResult
    452455      } 
    453456 
    454457      case GFT_Real: 
    455458      { 
    456           char szValue[100]; 
    457           sprintf( szValue, "%.16g", aoFields[iField].adfValues[iRow] ); 
    458           return szValue
     459          ((GDALRasterAttributeTable *) this)-> 
     460              osWorkingResult.Printf( "%.16g", aoFields[iField].adfValues[iRow]); 
     461          return osWorkingResult
    459462      } 
    460463 
     
    11021105 * This method is the same as the C function GDALRATCreateColumn(). 
    11031106 * 
    1104  * @param osFieldName the name of the field to create. 
     1107 * @param pszFieldName the name of the field to create. 
    11051108 * @param eFieldType the field type (integer, double or string). 
    11061109 * @param eFieldUsage the field usage, GFU_Generic if not known. 
     
    11091112 */ 
    11101113 
    1111 CPLErr GDALRasterAttributeTable::CreateColumn( CPLString osFieldName,  
     1114CPLErr GDALRasterAttributeTable::CreateColumn( const char *pszFieldName,  
    11121115                                               GDALRATFieldType eFieldType, 
    11131116                                               GDALRATFieldUsage eFieldUsage ) 
     
    11181121    aoFields.resize( iNewField+1 ); 
    11191122 
    1120     aoFields[iNewField].sName = osFieldName; 
     1123    aoFields[iNewField].sName = pszFieldName; 
    11211124    aoFields[iNewField].eType = eFieldType; 
    11221125    aoFields[iNewField].eUsage = eFieldUsage; 
  • trunk/gcore/gdal_rat.h

    r10066 r10148  
    2929 * 
    3030 * $Log$ 
     31 * Revision 1.4  2006/10/24 18:49:22  fwarmerdam 
     32 * avoid using CPLString in arguments and return from RAT API 
     33 * 
    3134 * Revision 1.3  2006/10/07 02:00:38  fwarmerdam 
    3235 * added RAT translation to ColorTable, and a few other fixes 
     
    98101    int           GetColumnCount() const; 
    99102 
    100     CPLString     GetNameOfCol( int ) const; 
     103    const char   *GetNameOfCol( int ) const; 
    101104    GDALRATFieldUsage GetUsageOfCol( int ) const; 
    102105    GDALRATFieldType GetTypeOfCol( int ) const; 
     
    106109    int           GetRowCount() const; 
    107110 
    108     CPLString     GetValueAsString( int iRow, int iField ) const; 
     111    const char   *GetValueAsString( int iRow, int iField ) const; 
    109112    int           GetValueAsInt( int iRow, int iField ) const; 
    110113    double        GetValueAsDouble( int iRow, int iField ) const; 
     
    122125    double        GetRowMax( int iRow ) const; 
    123126 
    124     CPLErr        CreateColumn( CPLString osFieldName,  
     127    CPLErr        CreateColumn( const char *pszFieldName,  
    125128                                GDALRATFieldType eFieldType,  
    126129                                GDALRATFieldUsage eFieldUsage );