Manages the mapping of style names to XML nodes. More...
#include <SStylePool.h>
Public Member Functions | |
SXmlNode | GetStyle (const SStringW &strName) |
Retrieves a style XML node by name. | |
BOOL | Init (SXmlNode xmlNode) |
Initializes the style pool from an XML node. | |
![]() | |
SCmnMap (void(*funOnKeyRemoved)(const SXmlNode &)=NULL) | |
Constructor. | |
virtual | ~SCmnMap () |
Destructor. | |
bool | HasKey (const SStringW &key) const |
Checks if a key exists in the map. | |
bool | GetKeyObject (const SStringW &key, SXmlNode &obj) const |
Retrieves an object associated with a key. | |
SXmlNode & | GetKeyObject (const SStringW &key) const |
Retrieves an object associated with a key. | |
bool | AddKeyObject (const SStringW &key, const SXmlNode &obj) |
Adds a key-object pair to the map. | |
void | SetKeyObject (const SStringW &key, const SXmlNode &obj) |
Sets an object for a key, replacing any existing object. | |
bool | RemoveKeyObject (const SStringW &key) |
Removes a key-object pair from the map. | |
void | RemoveAll () |
Removes all key-object pairs from the map. | |
size_t | GetCount () |
Gets the number of key-object pairs in the map. | |
![]() | |
TObjRefImpl () | |
Constructor that initializes the reference count to 1. | |
virtual | ~TObjRefImpl () |
Virtual destructor. | |
long | AddRef () override |
Increments the reference count. | |
long | Release () override |
Decrements the reference count and deletes the object if the count reaches zero. | |
void | OnFinalRelease () override |
Deletes the object. | |
![]() | |
long | AddRef () PURE |
Increases the reference count. | |
long | Release () PURE |
Decreases the reference count. | |
void | OnFinalRelease () PURE |
Called when the reference count reaches zero and the object is about to be released. | |
Protected Attributes | |
SXmlDoc | m_xmlDoc |
![]() | |
void(* | m_pFunOnKeyRemoved )(const SXmlNode &obj) |
SMap< SStringW, SXmlNode > * | m_mapNamedObj |
![]() | |
LONG | m_cRef |
Reference count. | |
Manages the mapping of style names to XML nodes.
This class provides functionality to load styles from an XML node and retrieve them by name.
Definition at line 26 of file SStylePool.h.
Retrieves a style XML node by name.
strName | Name of the style. |
Definition at line 10 of file SStylePool.cpp.
BOOL SStylePool::Init | ( | SXmlNode | xmlNode | ) |
Initializes the style pool from an XML node.
xmlNode | XML node containing the style definitions. |
Definition at line 18 of file SStylePool.cpp.
|
protected |
Definition at line 45 of file SStylePool.h.