GDAL

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
CPLString Class Reference

Convenient string class based on std::string. More...

`#include <cpl_string.h>`

Inheritance diagram for CPLString:

## Public Member Functions
| CPLString (const std::string &oStr)
| CPLString (const char *pszStr)
| operator const char * (void) const
char & | operator[] (std::string::size_type i)
const char & | operator[] (std::string::size_type i) const
char & | operator[] (int i)
const char & | operator[] (int i) const
void | Clear ()
void | Seize (char *pszValue)
CPLString & | Printf (const char *pszFormat,...)
CPLString & | vPrintf (const char *pszFormat, va_list args)
CPLString & | FormatC (double dfValue, const char *pszFormat=NULL)
| Format double in C locale. More...
CPLString & | Trim ()
| Trim white space. More...
CPLString & | Recode (const char *pszSrcEncoding, const char *pszDstEncoding)
size_t | ifind (const std::string &str, size_t pos=0) const
| Case insensitive find() alternative. More...
size_t | ifind (const char *s, size_t pos=0) const
| Case insensitive find() alternative. More...
CPLString & | toupper (void)
| Convert to upper case in place.
CPLString & | tolower (void)
| Convert to lower case in place.

## Detailed Description

Convenient string class based on std::string.

## Member Function Documentation

CPLString & CPLString::FormatC | ( | double | dfValue,
|  | const char * | pszFormat = `NULL`
| ) |  |

Format double in C locale.

The passed value is formatted using the C locale (period as decimal separator) and appended to the target CPLString.

Parameters

  dfValue | the value to format.
  pszFormat | the sprintf() style format to use or omit for default. Note that this format string should only include one substitution argument and it must be for a double (f or g).

Returns
  a reference to the CPLString.

size_t CPLString::ifind | ( | const std::string & | str,
|  | size_t | pos = `0`
| ) |  | const

Case insensitive find() alternative.

Parameters

  str | substring to find.
  pos | offset in the string at which the search starts.

Returns
  the position of substring in the string or std::string::npos if not found.

Since
  GDAL 1.9.0

size_t CPLString::ifind | ( | const char * | s,
|  | size_t | nPos = `0`
| ) |  | const

Case insensitive find() alternative.

Parameters

  s | substring to find.
  nPos | offset in the string at which the search starts.

Returns
  the position of the substring in the string or std::string::npos if not found.

Since
  GDAL 1.9.0

CPLString & CPLString::Trim | ( |  | ) |

Trim white space.

Trims white space off the let and right of the string. White space is any of a space, a tab, a newline ('
') or a carriage control ('').

Returns
  a reference to the CPLString.

The documentation for this class was generated from the following files:

- cpl_string.h
- cplstring.cpp

Generated for GDAL by 1.8.8.