OGR
|
#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. | |
OGRStyleTable * | Clone () |
Duplicate style table. More... | |
void | ResetStyleStringReading () |
const char * | GetNextStyle () |
Get the next style string from the table. More... | |
const char * | GetLastStyleName () |
This class represents a style table
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.
pszName | the name the style to add. |
pszStyleString | the style string to add. |
References CSLAddString(), and IsExist().
Referenced by OGRStyleMgr::AddStyle(), and ModifyStyle().
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.
References CSLDuplicate().
Referenced by OGRLayer::SetStyleTable(), and OGRFeature::SetStyleTable().
const char * OGRStyleTable::Find | ( | const char * | pszName | ) |
Get a style string by name.
pszName | the name of the style string to find. |
References CSLGetField(), and IsExist().
Referenced by OGRStyleMgr::GetStyleByName().
const char * OGRStyleTable::GetLastStyleName | ( | ) |
Get the style name of the last style string fetched with OGR_STBL_GetNextStyle.
const char * OGRStyleTable::GetNextStyle | ( | ) |
Get the next style string from the table.
References CSLCount(), and CSLGetField().
const char * OGRStyleTable::GetStyleName | ( | const char * | pszStyleString | ) |
Get style name by style string.
pszStyleString | the style string to look up. |
References CSLCount(), and EQUAL.
Referenced by OGRStyleMgr::GetStyleName().
int OGRStyleTable::IsExist | ( | const char * | pszName | ) |
Get the index of a style in the table by its name.
pszName | the name to look for. |
References CPLSPrintf(), and CSLCount().
Referenced by AddStyle(), Find(), and RemoveStyle().
GBool OGRStyleTable::LoadStyleTable | ( | const char * | pszFilename | ) |
Load a style table from a file.
pszFilename | the name of the file to load from. |
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.
pszName | the name of the style to modify. |
pszStyleString | the style string. |
References AddStyle(), and RemoveStyle().
void OGRStyleTable::Print | ( | FILE * | fpOut | ) |
Print a style table to a FILE pointer.
fpOut | the FILE pointer to print to. |
GBool OGRStyleTable::RemoveStyle | ( | const char * | pszName | ) |
Remove a style in the table by its name.
pszName | the name of the style to remove. |
References CSLRemoveStrings(), and IsExist().
Referenced by ModifyStyle().
void OGRStyleTable::ResetStyleStringReading | ( | ) |
Reset the next style pointer to 0
GBool OGRStyleTable::SaveStyleTable | ( | const char * | pszFilename | ) |
Save a style table to a file.
pszFilename | the name of the file to save to. |
References CSLSave().