Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryXMLMemento.h>
Public Member Functions | |
XMLMemento (Poco::XML::Document *document, Poco::XML::Element *elem) | |
~XMLMemento () | |
IMemento::Pointer | CopyChild (IMemento::Pointer child) |
virtual IMemento::Pointer | CreateChild (const QString &type) override |
virtual IMemento::Pointer | CreateChild (const QString &type, const QString &id) override |
virtual IMemento::Pointer | GetChild (const QString &type) const override |
virtual QList< IMemento::Pointer > | GetChildren (const QString &type) const override |
virtual QString | GetType () const override |
virtual QString | GetID () const override |
virtual bool | GetInteger (const QString &key, int &value) const override |
virtual bool | GetFloat (const QString &key, double &value) const override |
virtual bool | GetString (const QString &key, QString &value) const override |
virtual bool | GetBoolean (const QString &key, bool &value) const override |
virtual QString | GetTextData () const override |
virtual QList< QString > | GetAttributeKeys () const override |
virtual void | PutFloat (const QString &key, double value) override |
virtual void | PutInteger (const QString &key, int value) override |
virtual void | PutMemento (IMemento::Pointer memento) override |
virtual void | PutString (const QString &key, const QString &value) override |
virtual void | PutBoolean (const QString &key, bool value) override |
virtual void | PutTextData (const QString &data) override |
void | Save (XMLByteOutputStream &writer) |
virtual Poco::XML::Element * | GetElement () const |
Public Member Functions inherited from berry::IMemento | |
berryObjectMacro (berry::IMemento) static const QString TAG_ID | |
virtual | ~IMemento () |
Public Member Functions inherited from berry::Object | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) const |
virtual QString | ToString () const |
virtual uint | HashCode () const |
virtual bool | operator< (const Object *) const |
void | Register () const |
void | UnRegister (bool del=true) const |
int | GetReferenceCount () const |
void | SetReferenceCount (int) |
void | AddDestroyListener (const MessageAbstractDelegate<> &delegate) const |
void | RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const |
virtual bool | operator== (const Object *) const |
Static Public Member Functions | |
static XMLMemento::Pointer | CreateReadRoot (berry::XMLMemento::XMLByteInputStream &reader) |
static XMLMemento::Pointer | CreateReadRoot (berry::XMLMemento::XMLByteInputStream &reader, const QString &baseDir) |
static XMLMemento::Pointer | CreateWriteRoot (const QString &type) |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Public Attributes | |
berryObjectMacro(XMLMemento) typedef std typedef std::istream | XMLByteInputStream |
Additional Inherited Members | |
Public Types inherited from berry::Object | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Protected Member Functions inherited from berry::Object | |
Object () | |
virtual | ~Object () |
virtual QDebug | PrintSelf (QDebug os, Indent indent) const |
virtual QDebug | PrintHeader (QDebug os, Indent indent) const |
virtual QDebug | PrintTrailer (QDebug os, Indent indent) const |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
This class represents the default implementation of the IMemento
interface.
This class is not intended to be extended by clients.
Definition at line 41 of file berryXMLMemento.h.
berry::XMLMemento::XMLMemento | ( | Poco::XML::Document * | document, |
Poco::XML::Element * | elem | ||
) |
Creates a memento for the specified document and element.
Clients should use CreateReadRoot
and CreateWriteRoot
to create the initial memento on a document.
document | the document for the memento |
element | the element node for the memento |
Definition at line 38 of file berryXMLMemento.cpp.
berry::XMLMemento::~XMLMemento | ( | ) |
Definition at line 46 of file berryXMLMemento.cpp.
berry::IMemento::Pointer berry::XMLMemento::CopyChild | ( | IMemento::Pointer | child | ) |
Copies another Memento into this memento
child | the new child memento |
Definition at line 130 of file berryXMLMemento.cpp.
References berry::SmartPointer< TObjectType >::Cast().
|
overridevirtual |
Creates a new child of this memento with the given type
type | the type |
Implements berry::IMemento.
Definition at line 111 of file berryXMLMemento.cpp.
|
overridevirtual |
Creates a new child of this memento with the given type and id. The id is stored in the child memento (using a special reserved key, TAG_ID
) and can be retrieved using getId
.
The getChild
and getChildren
methods are used to retrieve children of a given type.
type | the type |
id | the child id |
Implements berry::IMemento.
Definition at line 120 of file berryXMLMemento.cpp.
|
static |
Creates a Document
from the Reader
and returns a memento on the first Element
for reading the document.
reader | the Reader used to create the memento's document |
Element
for reading the document WorkbenchException | if IO problems, invalid format, or no element. |
Definition at line 52 of file berryXMLMemento.cpp.
|
static |
Creates a Document
from the Reader
and returns a memento on the first Element
for reading the document.
reader | the Reader used to create the memento's document |
baseDir | the directory used to resolve relative file names in the XML document. This directory must exist and include the trailing separator. The directory format, including the separators, must be valid for the platform. Can be null if not needed. |
Element
for reading the document WorkbenchException | if IO problems, invalid format, or no element. |
Definition at line 58 of file berryXMLMemento.cpp.
|
static |
Returns a root memento for writing a document.
type | the element node type to create on the document |
Definition at line 94 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns an array of all the attribute keys of the memento. This will not be null
. If there are no keys, an array of length zero will be returned.
Implements berry::IMemento.
Definition at line 276 of file berryXMLMemento.cpp.
|
overridevirtual |
Implements berry::IMemento.
Definition at line 237 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns the first child with the given type id.
type | the type id |
Implements berry::IMemento.
Definition at line 142 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns all children with the given type id.
type | the type id |
Implements berry::IMemento.
Definition at line 156 of file berryXMLMemento.cpp.
|
virtual |
Returns the element of the memento
Definition at line 430 of file berryXMLMemento.cpp.
Referenced by PutMemento().
|
overridevirtual |
Implements berry::IMemento.
Definition at line 173 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns the ID of this memento
Implements berry::IMemento.
Definition at line 211 of file berryXMLMemento.cpp.
|
overridevirtual |
Implements berry::IMemento.
Definition at line 217 of file berryXMLMemento.cpp.
|
overridevirtual |
Implements berry::IMemento.
Definition at line 254 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns the data of the Text node of the memento. Each memento is allowed only one Text node.
null
if the memento has no Text node. Implements berry::IMemento.
Definition at line 264 of file berryXMLMemento.cpp.
References EMPTY_STRING.
|
overridevirtual |
Returns the Type of this memento
Implements berry::IMemento.
Definition at line 206 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a boolean in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 391 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a float in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 363 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a integer in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 369 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts another memento in this memento as a child
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 375 of file berryXMLMemento.cpp.
References berry::SmartPointer< TObjectType >::Cast(), and GetElement().
|
overridevirtual |
Puts a string in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 382 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a text in this memento
data | the text |
Implements berry::IMemento.
Definition at line 403 of file berryXMLMemento.cpp.
void berry::XMLMemento::Save | ( | XMLByteOutputStream & | writer | ) |
Saves this memento's document current values to the specified writer.
writer | the writer used to save the memento's document |
IOException | if there is a problem serializing the document to the stream. |
Definition at line 417 of file berryXMLMemento.cpp.
berryObjectMacro (XMLMemento) typedef std typedef std::istream berry::XMLMemento::XMLByteInputStream |
Defines a std::ostream as XML output stream Defines a std::istream as XML input stream
Definition at line 45 of file berryXMLMemento.h.