OGR
Public Member Functions | List of all members
OGRStyleTable Class Reference

#include <ogr_featurestyle.h>

Public Member Functions

GBool AddStyle (const char *pszName, const char *pszStyleString)
 Add a new style in the table. No comparison will be done on the Style string, only on the name. More...
 
GBool RemoveStyle (const char *pszName)
 Remove a style in the table by its name. More...
 
GBool ModifyStyle (const char *pszName, const char *pszStyleString)
 Modify a style in the table by its name If the style does not exist, it will be added. More...
 
GBool SaveStyleTable (const char *pszFilename)
 Save a style table to a file. More...
 
GBool LoadStyleTable (const char *pszFilename)
 Load a style table from a file. More...
 
const char * Find (const char *pszStyleString)
 Get a style string by name. More...
 
GBool IsExist (const char *pszName)
 Get the index of a style in the table by its name. More...
 
const char * GetStyleName (const char *pszName)
 Get style name by style string. More...
 
void Print (FILE *fpOut)
 Print a style table to a FILE pointer. More...
 
void Clear ()
 Clear a style table.
 
OGRStyleTableClone ()
 Duplicate style table. More...
 

Detailed Description

This class represents a style table

Member Function Documentation

GBool OGRStyleTable::AddStyle ( const char *  pszName,
const char *  pszStyleString 
)

Add a new style in the table. No comparison will be done on the Style string, only on the name.

Parameters
pszNamethe name the style to add.
pszStyleStringthe style string to add.
Returns
TRUE on success, FALSE on error

Referenced by OGRStyleMgr::AddStyle().

OGRStyleTable * OGRStyleTable::Clone ( )

Duplicate style table.

The newly created style table is owned by the caller, and will have it's own reference to the OGRStyleTable.

Returns
new style table, exactly matching this style table.

References CSLDuplicate().

Referenced by OGR_F_SetStyleStringDirectly(), OGRLayer::SetStyleTable(), and OGRDataSource::SetStyleTable().

const char * OGRStyleTable::Find ( const char *  pszName)

Get a style string by name.

Parameters
pszNamethe name of the style string to find.
Returns
the style string matching the name, NULL if not found or error.

Referenced by OGRStyleMgr::GetStyleByName().

const char * OGRStyleTable::GetStyleName ( const char *  pszStyleString)

Get style name by style string.

Parameters
pszStyleStringthe style string to look up.
Returns
the Name of the matching style string or NULL on error.

References CSLCount().

Referenced by OGRStyleMgr::GetStyleName().

int OGRStyleTable::IsExist ( const char *  pszName)

Get the index of a style in the table by its name.

Parameters
pszNamethe name to look for.
Returns
The index of the style if found, -1 if not found or error.

References CSLCount().

GBool OGRStyleTable::LoadStyleTable ( const char *  pszFilename)

Load a style table from a file.

Parameters
pszFilenamethe name of the file to load from.
Returns
TRUE on success, FALSE on error

References CSLDestroy(), and CSLLoad().

GBool OGRStyleTable::ModifyStyle ( const char *  pszName,
const char *  pszStyleString 
)

Modify a style in the table by its name If the style does not exist, it will be added.

Parameters
pszNamethe name of the style to modify.
pszStyleStringthe style string.
Returns
TRUE on success, FALSE on error

References OGRStyleMgr::AddStyle().

void OGRStyleTable::Print ( FILE *  fpOut)

Print a style table to a FILE pointer.

Parameters
fpOutthe FILE pointer to print to.
GBool OGRStyleTable::RemoveStyle ( const char *  pszName)

Remove a style in the table by its name.

Parameters
pszNamethe name of the style to remove.
Returns
TRUE on success, FALSE on error
GBool OGRStyleTable::SaveStyleTable ( const char *  pszFilename)

Save a style table to a file.

Parameters
pszFilenamethe name of the file to save to.
Returns
TRUE on success, FALSE on error

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

Generated for GDAL by doxygen 1.8.11.