soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STemplatePool Class Reference

Manages the mapping of template names to template strings. More...

#include <SStylePool.h>

Inheritance diagram for STemplatePool:
SCmnMap< SStringW, SStringW > TObjRefImpl< IObjRef > IObjRef

Public Member Functions

BOOL Init (SXmlNode xmlNode)
 Initializes the template pool from an XML node.
 
SStringW GetTemplateString (const SStringW &strName) const
 Retrieves a template string by name.
 
- Public Member Functions inherited from SCmnMap< SStringW, SStringW >
 SCmnMap (void(*funOnKeyRemoved)(const SStringW &)=NULL)
 Constructor.
 
virtual ~SCmnMap ()
 Destructor.
 
bool HasKey (const SStringW &key) const
 Checks if a key exists in the map.
 
bool GetKeyObject (const SStringW &key, SStringW &obj) const
 Retrieves an object associated with a key.
 
SStringWGetKeyObject (const SStringW &key) const
 Retrieves an object associated with a key.
 
bool AddKeyObject (const SStringW &key, const SStringW &obj)
 Adds a key-object pair to the map.
 
void SetKeyObject (const SStringW &key, const SStringW &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.
 
- Public Member Functions inherited from TObjRefImpl< IObjRef >
 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.
 
- Public Member Functions inherited from IObjRef
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.
 

Additional Inherited Members

- Protected Attributes inherited from SCmnMap< SStringW, SStringW >
void(* m_pFunOnKeyRemoved )(const SStringW &obj)
 
SMap< SStringW, SStringW > * m_mapNamedObj
 
- Protected Attributes inherited from TObjRefImpl< IObjRef >
LONG m_cRef
 Reference count.
 

Detailed Description

Manages the mapping of template names to template strings.

This class provides functionality to load templates from an XML node and retrieve them by name.

Definition at line 54 of file SStylePool.h.

Member Function Documentation

◆ GetTemplateString()

SStringW STemplatePool::GetTemplateString ( const SStringW & strName) const

Retrieves a template string by name.

Parameters
strNameName of the template.
Returns
Template string, or an empty string if not found.

Definition at line 64 of file SStylePool.cpp.

◆ Init()

BOOL STemplatePool::Init ( SXmlNode xmlNode)

Initializes the template pool from an XML node.

Parameters
xmlNodeXML node containing the template definitions.
Returns
TRUE if initialization is successful, FALSE otherwise.

Definition at line 43 of file SStylePool.cpp.


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