Limb Range Analyzer
Cross-platform application for human limb range analysis.
XmlParser Class Reference

Class introduced in order to maintain XML loading and saving possibilities. More...

#include <xmlparser.hpp>

Inheritance diagram for XmlParser:

Public Member Functions

 XmlParser ()
 Class XmlParser default constructor. More...
 
 ~XmlParser ()
 Default destructor function of XmlParser. More...
 
void XmlParser_InitializePath ()
 Member function that manages required directory check and creation if it does not yet exist. More...
 
void XmlParser_InitializeSettings ()
 Function needed for initial settings XML file creation. More...
 
void XmlParser_InitializeClientData ()
 Function that is responsible for initial client XML file creation. More...
 
QSharedPointer< SettingsXmlParser_LoadSettings ()
 Member function meant for application Settings loading. More...
 
QList< QSharedPointer< Client > > XmlParser_LoadClientData ()
 Function designed for Client data loading from XML file. More...
 
void XmlParser_SaveSettings (QSharedPointer< Settings > settings)
 Member function that manages Settings XML saving. More...
 
void XmlParser_SaveClientData (QList< QSharedPointer< Client > > clientList)
 Function that receives a list of clients and saves it to XML file. More...
 

Private Attributes

QString mDirPath
 QString member variable that carries the directory path used by XML files.
 

Detailed Description

Class introduced in order to maintain XML loading and saving possibilities.

Class XmlParser is responsible for Limb Range Analyzer Client and Settings data model saving through XML documents. Needed files can be created and extended according to program needs, just as they can be accessed and read from.

See also
Client, Settings

Constructor & Destructor Documentation

◆ XmlParser()

XmlParser::XmlParser ( )

Class XmlParser default constructor.

This default function is used as a member initializer when new instance is created.

See also
~XmlParser()

◆ ~XmlParser()

XmlParser::~XmlParser ( )

Default destructor function of XmlParser.

Unextended form of a default destructor function.

See also
XmlParser()

Member Function Documentation

◆ XmlParser_InitializeClientData()

void XmlParser::XmlParser_InitializeClientData ( )

Function that is responsible for initial client XML file creation.

Function that uses XmlParser_InitializePath and creates initial client data XML file. Such file would contain initial Client entry, but is created only in case that clients.xml does not yet exist.

See also
Client

◆ XmlParser_InitializePath()

void XmlParser::XmlParser_InitializePath ( )

Member function that manages required directory check and creation if it does not yet exist.

This member function defines XML directory meant for usage and creates it, if it does not exist.

◆ XmlParser_InitializeSettings()

void XmlParser::XmlParser_InitializeSettings ( )

Function needed for initial settings XML file creation.

Member function that uses XmlParser_InitializePath and creates default Settings file with pre-set application configurables. Initial XML file settings.xml is created only if it does not yet exist.

See also
Settings

◆ XmlParser_LoadClientData()

QList< QSharedPointer< Client > > XmlParser::XmlParser_LoadClientData ( )

Function designed for Client data loading from XML file.

Function serves as an obtainer of client related data stored in a XML file created by XmlParser_SaveClientData function. A required file is opened and read through until its end, while client instances are constructed. A list of Client instances is returned for further use by the application.

Returns
QList<QSharedPointer<Client>> - list pointer structure that represents previously stored and managed clients data
See also
Client

◆ XmlParser_LoadSettings()

QSharedPointer< Settings > XmlParser::XmlParser_LoadSettings ( )

Member function meant for application Settings loading.

Member function responsible for XML file loading. Processed text strings are used for Settings instance creation that is returned by this function and further used by the application.

Returns
QSharedPointer<Settings> - loaded settings data pointer that will be used within the application
See also
Settings

◆ XmlParser_SaveClientData()

void XmlParser::XmlParser_SaveClientData ( QList< QSharedPointer< Client > >  clientList)

Function that receives a list of clients and saves it to XML file.

Parametric member function that uses a list of Client data and saves it to a specific clients.xml file. The list is iterated through and for each entry a new record is made, so that it can be loaded via XmlParser_LoadClientData again when needed.

Parameters
clientList- a list of pointers that carries application clients data meant for saving

◆ XmlParser_SaveSettings()

void XmlParser::XmlParser_SaveSettings ( QSharedPointer< Settings settings)

Member function that manages Settings XML saving.

This function is designed for application settings saving, which is handled through XML file usage. A Settings object transferred as a pointer parameter is decomposed and saved to settings.xml file with the use of QXmlStreamWriter .

Parameters
settings- currently valid application settings to be saved

The documentation for this class was generated from the following files: