CLAM-Development
1.4.0
|
This class adapts to the XMLable interface any object that is a CLAM::Component. More...
#include <XMLComponentAdapter.hxx>
Public Types | |
typedef BasicXMLable | super |
Public Member Functions | |
template<class T > | |
XMLComponentAdapter (const T &adaptee, const char *name=NULL, bool isXMLElement=false) | |
Constructs a XMLComponentAdapter. | |
virtual | ~XMLComponentAdapter () |
virtual std::string | XMLContent () const |
virtual bool | XMLContent (std::istream &str) |
const char * | GetClassName () const |
Return the class name. | |
virtual void | StoreOn (Storage &store) const |
Stores subitems on the given Storage. | |
virtual void | LoadFrom (Storage &store) |
Loads component's subitems from the given Storage. | |
bool | FulfilsInvariant () |
![]() | |
BasicXMLable (const char *name=0, bool isXMLElement=false) | |
Constructs a BasicXMLable. | |
virtual | ~BasicXMLable () |
const char * | XMLName () const |
bool | IsXMLElement () const |
bool | IsXMLAttribute () const |
bool | IsXMLText () const |
![]() | |
virtual | ~XMLable () |
![]() | |
virtual | ~Storable () |
![]() | |
virtual | ~Component () |
virtual Component * | ShallowCopy () const |
virtual Component * | DeepCopy () const |
This class adapts to the XMLable interface any object that is a CLAM::Component.
The XMLComponent adapter implements both the XMLable and the Component interface. So, implements the retrieval of XML properties (naming, being Element, Atribute or Simple content...) and implements the StoreOn function that is called by the XMLStorage to allow the component store its subitems. The StoreOn is implemented in XMLComponentAdapter simply by forwarding the call to de Adaptee.
You should use XMLComponentAdapter when:
Note: Simple content, (XMLable::XMLContent() implementation) returns an empty string.
Pay attention to the management of the name memory (see CLAM::BasicXMLable).
Definition at line 62 of file XMLComponentAdapter.hxx.
Definition at line 65 of file XMLComponentAdapter.hxx.
|
inline |
Constructs a XMLComponentAdapter.
Note: You cannot use this adapter as attribute because the content adapter does not know how to extract the XML content. Alternatives: Implement << and >> and adapt it with a simple XMLAdapter.
adaptee | The Component to be adapted (where subitem will be located) |
name | A pointer to a 0 terminated string containing the xml name (for elements and attributes) or 0 (the default) if the element is neither an element nor an attribute ( |
isXMLElement | Tells whether the object is an element or an attribute when the name is defined. If a name is given, this must be true because a component adapter cannot adapt as attribute. |
Definition at line 92 of file XMLComponentAdapter.hxx.
References CLAM_ASSERT.
|
inlinevirtual |
Definition at line 97 of file XMLComponentAdapter.hxx.
bool CLAM::XMLComponentAdapter::FulfilsInvariant | ( | ) |
Reimplemented from CLAM::BasicXMLable.
Definition at line 28 of file XMLComponentAdapter.cxx.
References CLAM::BasicXMLable::FulfilsInvariant().
|
inlinevirtual |
Return the class name.
Implements CLAM::Component.
Definition at line 114 of file XMLComponentAdapter.hxx.
|
inlinevirtual |
Loads component's subitems from the given Storage.
store | The given storage where the subitem will be loaded from |
Implements CLAM::Component.
Definition at line 131 of file XMLComponentAdapter.hxx.
References CLAM::Component::LoadFrom().
|
inlinevirtual |
Stores subitems on the given Storage.
store | The given storage where the subitem will be stored |
Implements CLAM::Component.
Definition at line 123 of file XMLComponentAdapter.hxx.
References CLAM::Component::StoreOn().
|
inlinevirtual |
Implements CLAM::BasicXMLable.
Definition at line 102 of file XMLComponentAdapter.hxx.
|
inlinevirtual |
Implements CLAM::XMLable.
Definition at line 108 of file XMLComponentAdapter.hxx.