Generates a list of InteractionEvents by parsing an XML file.
More...
#include <mitkXML2EventParser.h>
|
| typedef std::vector< mitk::InteractionEvent::Pointer > | EventContainerType |
| | Container type for the parsed interaction events. More...
|
| |
Generates a list of InteractionEvents by parsing an XML file.
Reads an XML event configuration file and constructs a list of InteractionEvent objects that can be used for interaction testing.
- See also
- EventRecorder
Definition at line 41 of file mitkXML2EventParser.h.
◆ EventContainerType
◆ XML2EventParser() [1/2]
| mitk::XML2EventParser::XML2EventParser |
( |
const std::string & |
filename, |
|
|
const us::Module * |
module = nullptr |
|
) |
| |
Construct an InteractionEventList object from an XML resource file.
Uses the specified resource file containing an XML event configuration to construct the event list. If the resource is invalid, no events are created.
- Parameters
-
| [in] | filename | The resource name relative to the Interactions resource folder. |
| [in] | module | The module from which to load the resource. If nullptr, the current module context is used. |
◆ XML2EventParser() [2/2]
| mitk::XML2EventParser::XML2EventParser |
( |
std::istream & |
inputStream | ) |
|
Construct an InteractionEventList object from an input stream.
Uses the specified input stream containing XML event configuration data to construct the event list. If the stream contains invalid XML, no events are created and an error is logged.
- Parameters
-
| [in] | inputStream | Input stream referring to XML configuration data. |
◆ ~XML2EventParser()
| mitk::XML2EventParser::~XML2EventParser |
( |
| ) |
|
|
inlineoverride |
◆ EndElement()
| void mitk::XML2EventParser::EndElement |
( |
const char * |
elementName | ) |
|
|
overrideprotected |
Handle the end of an XML element during parsing.
When an event variant element ends, the collected properties are used to create an InteractionEvent and add it to the list.
- Parameters
-
| [in] | elementName | Name of the XML element. |
◆ GetInteractions()
◆ ReadXMLBooleanAttribute()
| bool mitk::XML2EventParser::ReadXMLBooleanAttribute |
( |
const std::string & |
name, |
|
|
const char ** |
atts |
|
) |
| |
|
protected |
Read a boolean attribute value from the XML attribute array.
The attribute is compared case-insensitively against "TRUE".
- Parameters
-
| [in] | name | The attribute name to look for. |
| [in] | atts | Null-terminated array of attribute name/value pairs. |
- Returns
- True if the attribute value is "TRUE" (case-insensitive), false otherwise.
◆ ReadXMLStringAttribute()
| std::string mitk::XML2EventParser::ReadXMLStringAttribute |
( |
const std::string & |
name, |
|
|
const char ** |
atts |
|
) |
| |
|
protected |
Read a string attribute value from the XML attribute array.
- Parameters
-
| [in] | name | The attribute name to look for. |
| [in] | atts | Null-terminated array of attribute name/value pairs. |
- Returns
- The attribute value, or an empty string if not found.
◆ StartElement()
| void mitk::XML2EventParser::StartElement |
( |
const char * |
elementName, |
|
|
const char ** |
atts |
|
) |
| |
|
overrideprotected |
Handle the start of an XML element during parsing.
- Parameters
-
| [in] | elementName | Name of the XML element. |
| [in] | atts | Null-terminated array of attribute name/value pairs. |
The documentation for this class was generated from the following file: