Changeset 10148
- Timestamp:
- 10/24/06 14:49:22 (2 years ago)
- Files:
-
- trunk/gcore/gdal_rat.cpp (modified) (7 diffs)
- trunk/gcore/gdal_rat.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gcore/gdal_rat.cpp
r10129 r10148 29 29 * 30 30 * $Log$ 31 * Revision 1.10 2006/10/24 18:49:22 fwarmerdam 32 * avoid using CPLString in arguments and return from RAT API 33 * 31 34 * Revision 1.9 2006/10/23 17:25:31 fwarmerdam 32 35 * Fixed problem with <F> element has no text child because it is empty. … … 230 233 */ 231 234 232 CPLStringGDALRasterAttributeTable::GetNameOfCol( int iCol ) const235 const char *GDALRasterAttributeTable::GetNameOfCol( int iCol ) const 233 236 234 237 { … … 423 426 */ 424 427 425 CPLString 428 const char * 426 429 GDALRasterAttributeTable::GetValueAsString( int iRow, int iField ) const 427 430 … … 447 450 case GFT_Integer: 448 451 { 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; 452 455 } 453 456 454 457 case GFT_Real: 455 458 { 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; 459 462 } 460 463 … … 1102 1105 * This method is the same as the C function GDALRATCreateColumn(). 1103 1106 * 1104 * @param osFieldName the name of the field to create.1107 * @param pszFieldName the name of the field to create. 1105 1108 * @param eFieldType the field type (integer, double or string). 1106 1109 * @param eFieldUsage the field usage, GFU_Generic if not known. … … 1109 1112 */ 1110 1113 1111 CPLErr GDALRasterAttributeTable::CreateColumn( CPLString osFieldName,1114 CPLErr GDALRasterAttributeTable::CreateColumn( const char *pszFieldName, 1112 1115 GDALRATFieldType eFieldType, 1113 1116 GDALRATFieldUsage eFieldUsage ) … … 1118 1121 aoFields.resize( iNewField+1 ); 1119 1122 1120 aoFields[iNewField].sName = osFieldName;1123 aoFields[iNewField].sName = pszFieldName; 1121 1124 aoFields[iNewField].eType = eFieldType; 1122 1125 aoFields[iNewField].eUsage = eFieldUsage; trunk/gcore/gdal_rat.h
r10066 r10148 29 29 * 30 30 * $Log$ 31 * Revision 1.4 2006/10/24 18:49:22 fwarmerdam 32 * avoid using CPLString in arguments and return from RAT API 33 * 31 34 * Revision 1.3 2006/10/07 02:00:38 fwarmerdam 32 35 * added RAT translation to ColorTable, and a few other fixes … … 98 101 int GetColumnCount() const; 99 102 100 CPLStringGetNameOfCol( int ) const;103 const char *GetNameOfCol( int ) const; 101 104 GDALRATFieldUsage GetUsageOfCol( int ) const; 102 105 GDALRATFieldType GetTypeOfCol( int ) const; … … 106 109 int GetRowCount() const; 107 110 108 CPLStringGetValueAsString( int iRow, int iField ) const;111 const char *GetValueAsString( int iRow, int iField ) const; 109 112 int GetValueAsInt( int iRow, int iField ) const; 110 113 double GetValueAsDouble( int iRow, int iField ) const; … … 122 125 double GetRowMax( int iRow ) const; 123 126 124 CPLErr CreateColumn( CPLString osFieldName,127 CPLErr CreateColumn( const char *pszFieldName, 125 128 GDALRATFieldType eFieldType, 126 129 GDALRATFieldUsage eFieldUsage );
