|
mupp 1.1.0
|
XML parser for mupp configuration files. More...
#include <PmuppAdmin.h>

Public Member Functions | |
| PmuppAdminXMLParser (const QString &fln, PmuppAdmin *) | |
| Constructor that parses the XML configuration file. | |
| virtual | ~PmuppAdminXMLParser () |
| Destructor. | |
| virtual bool | isValid () |
| Checks if the XML parsing was successful. | |
Private Types | |
| enum | EAdminKeyWords { eEmpty , eRecentFile , eIgnoreThemeAutoDetection , eDarkThemeIconsMenu , eDarkThemeIconsToolbar , eMarker , eColor } |
| Enumeration of recognized XML element types. More... | |
Private Member Functions | |
| bool | parse (QIODevice *device) |
| Main parsing method that processes the XML document. | |
| bool | startDocument () |
| Handler for XML document start. | |
| bool | startElement () |
| Handler for XML element opening tags. | |
| bool | endElement () |
| Handler for XML element closing tags. | |
| bool | characters () |
| Handler for XML element text content. | |
| bool | endDocument () |
| Handler for XML document end. | |
Private Attributes | |
| QXmlStreamReader | fXml |
| Qt XML stream reader object for parsing. | |
| bool | fValid |
| flag indicating successful XML parsing | |
| EAdminKeyWords | fKeyWord |
| current element type being processed | |
| PmuppAdmin * | fAdmin |
| pointer to the admin object being populated | |
XML parser for mupp configuration files.
PmuppAdminXMLParser is responsible for reading and parsing the mupp startup XML file (mupp_startup.xml). This configuration file contains:
The parser uses Qt's QXmlStreamReader for efficient XML processing and populates a PmuppAdmin object with the configuration data.
XML structure handled:
Definition at line 223 of file PmuppAdmin.h.
|
private |
Enumeration of recognized XML element types.
These keywords determine how to process the content of each XML element.
Definition at line 250 of file PmuppAdmin.h.
| PmuppAdminXMLParser::PmuppAdminXMLParser | ( | const QString & | fln, |
| PmuppAdmin * | admin ) |
Constructor that parses the XML configuration file.
Constructor for XML parser.
| fln | path to the mupp_startup.xml file |
| admin | pointer to PmuppAdmin object to populate with parsed data |
Initializes the XML parser and attempts to open and parse the specified configuration file. The parsed data is stored in the provided PmuppAdmin object.
| fln | path to the mupp_startup.xml configuration file |
| admin | pointer to the PmuppAdmin instance to populate with parsed data |
Definition at line 123 of file PmuppAdmin.cpp.
|
inlinevirtual |
Destructor.
Definition at line 236 of file PmuppAdmin.h.
|
private |
Handler for XML element text content.
Handler called to process XML element content.
This method processes the text content between XML opening and closing tags. The content interpretation depends on the current fKeyWord state (set by startElement).
Content processing by element type:
Definition at line 272 of file PmuppAdmin.cpp.
|
private |
Handler for XML document end.
Handler called at the end of XML document parsing.
This is invoked when the parser reaches the end of the XML document. Currently performs no post-processing but provides a hook for future finalization tasks such as path expansion or validation.
Definition at line 364 of file PmuppAdmin.cpp.
|
private |
Handler for XML element closing tags.
Handler called when an XML closing tag is encountered.
This method is invoked when the parser encounters a closing XML tag. It resets the fKeyWord state to eEmpty, ending the current element's context for content processing.
Definition at line 247 of file PmuppAdmin.cpp.
|
inlinevirtual |
Checks if the XML parsing was successful.
Definition at line 242 of file PmuppAdmin.h.
|
private |
Main parsing method that processes the XML document.
Parses the mupp startup XML file.
| device | QIODevice containing the XML data to parse |
This method uses Qt's QXmlStreamReader to parse the configuration file. It processes each XML element sequentially, calling appropriate handler methods (startElement, characters, endElement) based on the element type.
The parser is event-driven and maintains state through the fKeyWord enumeration to determine how to process element content.
| device | QIODevice (typically QFile) containing the XML data |
Definition at line 151 of file PmuppAdmin.cpp.
|
private |
Handler for XML document start.
Handler called at the start of XML document parsing.
This is invoked when the XML parser encounters the document start. Currently performs no actions but provides a hook for future initialization.
Definition at line 191 of file PmuppAdmin.cpp.
|
private |
Handler for XML element opening tags.
Handler called when a new XML element is encountered.
This method is invoked when the parser encounters an opening XML tag. It identifies the element type and sets the fKeyWord state accordingly, which determines how the element's content will be processed in the characters() method.
Recognized elements:
Definition at line 216 of file PmuppAdmin.cpp.
|
private |
pointer to the admin object being populated
Definition at line 298 of file PmuppAdmin.h.
|
private |
current element type being processed
Definition at line 297 of file PmuppAdmin.h.
|
private |
flag indicating successful XML parsing
Definition at line 296 of file PmuppAdmin.h.
|
private |
Qt XML stream reader object for parsing.
Definition at line 295 of file PmuppAdmin.h.