Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <berryXMLMemento.h>
Public Types | |
typedef std::ostream | XMLByteOutputStream |
typedef std::istream | XMLByteInputStream |
![]() | |
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 |
Public Member Functions | |
berryObjectMacro (XMLMemento) | |
XMLMemento (Poco::XML::Document *document, Poco::XML::Element *elem) | |
~XMLMemento () override | |
IMemento::Pointer | CopyChild (IMemento::Pointer child) |
IMemento::Pointer | CreateChild (const QString &type) override |
IMemento::Pointer | CreateChild (const QString &type, const QString &id) override |
IMemento::Pointer | GetChild (const QString &type) const override |
QList< IMemento::Pointer > | GetChildren (const QString &type) const override |
QString | GetType () const override |
QString | GetID () const override |
bool | GetInteger (const QString &key, int &value) const override |
bool | GetFloat (const QString &key, double &value) const override |
bool | GetString (const QString &key, QString &value) const override |
bool | GetBoolean (const QString &key, bool &value) const override |
QString | GetTextData () const override |
QList< QString > | GetAttributeKeys () const override |
void | PutFloat (const QString &key, double value) override |
void | PutInteger (const QString &key, int value) override |
void | PutMemento (IMemento::Pointer memento) override |
void | PutString (const QString &key, const QString &value) override |
void | PutBoolean (const QString &key, bool value) override |
void | PutTextData (const QString &data) override |
void | Save (XMLByteOutputStream &writer) |
virtual Poco::XML::Element * | GetElement () const |
![]() | |
berryObjectMacro (berry::IMemento) | |
~IMemento () override | |
![]() | |
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 const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Additional Inherited Members | |
![]() | |
static const QString | TAG_ID |
![]() | |
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 |
![]() | |
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 37 of file berryXMLMemento.h.
typedef std::istream berry::XMLMemento::XMLByteInputStream |
Defines a std::istream as XML input stream
Definition at line 51 of file berryXMLMemento.h.
typedef std::ostream berry::XMLMemento::XMLByteOutputStream |
Defines a std::ostream as XML output stream
Definition at line 46 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 34 of file berryXMLMemento.cpp.
Referenced by CopyChild(), CreateChild(), CreateReadRoot(), and CreateWriteRoot().
|
override |
Definition at line 42 of file berryXMLMemento.cpp.
berry::XMLMemento::berryObjectMacro | ( | XMLMemento | ) |
berry::IMemento::Pointer berry::XMLMemento::CopyChild | ( | IMemento::Pointer | child | ) |
Copies another Memento into this memento
child | the new child memento |
Definition at line 126 of file berryXMLMemento.cpp.
References berry::SmartPointer< TObjectType >::Cast(), GetElement(), and XMLMemento().
|
overridevirtual |
Creates a new child of this memento with the given type
type | the type |
Implements berry::IMemento.
Definition at line 107 of file berryXMLMemento.cpp.
References XMLMemento().
Referenced by GetAttributeKeys().
|
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 116 of file berryXMLMemento.cpp.
References berry::IMemento::TAG_ID, and XMLMemento().
|
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 48 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 54 of file berryXMLMemento.cpp.
References XMLMemento().
|
static |
Returns a root memento for writing a document.
type | the element node type to create on the document |
Definition at line 90 of file berryXMLMemento.cpp.
References XMLMemento().
|
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 272 of file berryXMLMemento.cpp.
References berry::SmartPointer< TObjectType >::Cast(), CreateChild(), PutString(), and PutTextData().
|
overridevirtual |
Implements berry::IMemento.
Definition at line 233 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns the first child with the given type id.
type | the type id |
Implements berry::IMemento.
Definition at line 138 of file berryXMLMemento.cpp.
|
overridevirtual |
Returns all children with the given type id.
type | the type id |
Implements berry::IMemento.
Definition at line 152 of file berryXMLMemento.cpp.
|
virtual |
Returns the element of the memento
Definition at line 426 of file berryXMLMemento.cpp.
Referenced by CopyChild(), and PutMemento().
|
overridevirtual |
Implements berry::IMemento.
Definition at line 169 of file berryXMLMemento.cpp.
References berry::WorkbenchPlugin::Log().
|
overridevirtual |
Returns the ID of this memento
Implements berry::IMemento.
Definition at line 207 of file berryXMLMemento.cpp.
References berry::IMemento::TAG_ID.
|
overridevirtual |
Implements berry::IMemento.
Definition at line 213 of file berryXMLMemento.cpp.
References berry::WorkbenchPlugin::Log().
|
overridevirtual |
Implements berry::IMemento.
Definition at line 250 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 260 of file berryXMLMemento.cpp.
References EMPTY_STRING.
|
overridevirtual |
Returns the Type of this memento
Implements berry::IMemento.
Definition at line 202 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a boolean in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 387 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a float in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 359 of file berryXMLMemento.cpp.
|
overridevirtual |
Puts a integer in this memento
key | the key |
value | the value |
Implements berry::IMemento.
Definition at line 365 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 371 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 378 of file berryXMLMemento.cpp.
Referenced by GetAttributeKeys().
|
overridevirtual |
Puts a text in this memento
data | the text |
Implements berry::IMemento.
Definition at line 399 of file berryXMLMemento.cpp.
Referenced by GetAttributeKeys().
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 413 of file berryXMLMemento.cpp.