Public Types | Public Member Functions | List of all members
ARCSXMLHandler Class Reference

This is an XML Handler for all ARCS native XML formats. More...

#include <arcsxmlhandler.h>

Collaboration diagram for ARCSXMLHandler:
Collaboration graph

Public Types

enum  XMLType {
  XML_BLANK, XML_STATEMACHINE, XML_COMPOSITE, XML_APPLICATION,
  XML_INTERFACE, XML_PROFILE
}
 This enumeration gives the list of ARCS XML structures. More...
 

Public Member Functions

 ARCSXMLHandler ()
 Constructor.
 
bool openFile (QString s)
 Opens a file given its path. The file should describe either an application or a composite component. More...
 
bool saveFile (QString s)
 Saves a file given its path. The file will describe either an application or a composite component. More...
 
bool setContents (QString s)
 Gives the content to parse. More...
 
QString getContents ()
 
void setType (XMLType t)
 
XMLType getType ()
 
bool parseProcess (ARCSProcess *ap, QDomElement processNode)
 Parses the xml description of a process. More...
 
bool parseSheet (ARCSSheet *as, QDomElement father)
 Parses the xml descriptions of a sheet. More...
 
bool parseContext (ARCSContext *)
 Parses a context.
 
QStringList parseLibraries (QDomElement libraries, bool *ok=0)
 
bool parseInterface (ARCSAbstractComponent *aac, QDomNode node=QDomNode())
 
bool parseStateMachine (ARCSStateMachine *)
 
bool parseApplication (ARCSApplicationComponent *)
 
bool parseCompositeComponent (ARCSCompositeComponent *)
 
bool parseProfile (ARCSContext *)
 
void storeSheet (ARCSSheet *as, QDomElement father, QString id=QString::null)
 Stores the xml description of a sheet. More...
 
void storeContext (ARCSContext *)
 
void storeStateMachine (ARCSStateMachine *)
 
void storeProfile (ARCSContext *)
 
void storeProcess (ARCSProcess *, QDomElement father)
 
void storeApplication (ARCSApplicationComponent *)
 
void storeCompositeComponent (ARCSCompositeComponent *)
 
void storeInterface (ARCSAbstractComponent *aac, QDomElement father=QDomElement())
 

Detailed Description

This is an XML Handler for all ARCS native XML formats.

Todo:

Add a path stack somewhere in this class.

Solve some troubles around strings describing components.

The ARCSXMLHandler parses and saves all basic ARCS XML structures.

Amongst them there are contexts, statemachines, applications and composite components.

Here is the markup structure for contexts. A context stores the list of libraries to load, a list of components to instanciate and a list of constants.

dot_inline_dotgraph_1.png
dot_inline_dotgraph_2.png
dot_inline_dotgraph_3.png
dot_inline_dotgraph_4.png
dot_inline_dotgraph_5.png
Author
Jean-Yves Didier
Date
January, the 22nd, 2009

Definition at line 179 of file arcsxmlhandler.h.

Member Function Documentation

bool ARCSXMLHandler::openFile ( QString  s)

Opens a file given its path. The file should describe either an application or a composite component.

Parameters
sthe file path
Returns
true if succeeded, false otherwise

Definition at line 56 of file arcsxmlhandler.cpp.

Here is the caller graph for this function:

bool ARCSXMLHandler::parseInterface ( ARCSAbstractComponent aac,
QDomNode  node = QDomNode() 
)
Todo:
determine how to use interface...

Definition at line 604 of file arcsxmlhandler.cpp.

Here is the call graph for this function:

bool ARCSXMLHandler::parseProcess ( ARCSProcess ap,
QDomElement  processNode 
)

Parses the xml description of a process.

Parameters
apa pointer to a process structure
processNodethe XML node describing a process
Returns
true if successful, false otherwise.
Todo:
See how to prevent sheet name duplication.

Definition at line 433 of file arcsxmlhandler.cpp.

Here is the call graph for this function:

bool ARCSXMLHandler::parseSheet ( ARCSSheet sheet,
QDomElement  father 
)

Parses the xml descriptions of a sheet.

Parameters
asa pointer to a sheet structure ;
fatherthe element containing the xml description of a sheet ;
Returns
true if sucessful, false otherwise.
Todo:
complete this parsing with the appropriate return values
Todo:
insert here something for link coordinates

Definition at line 192 of file arcsxmlhandler.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ARCSXMLHandler::saveFile ( QString  s)

Saves a file given its path. The file will describe either an application or a composite component.

Parameters
sthe file path
Returns
true if succeeded, false otherwise

Definition at line 120 of file arcsxmlhandler.cpp.

Here is the caller graph for this function:

bool ARCSXMLHandler::setContents ( QString  s)

Gives the content to parse.

This is especially interesting for ...

Parameters
sa string representing an xml stream to parse.
Returns
true if succeede, false otherwise

Definition at line 95 of file arcsxmlhandler.cpp.

Here is the caller graph for this function:

void ARCSXMLHandler::storeInterface ( ARCSAbstractComponent aac,
QDomElement  elt = QDomElement() 
)
Todo:
to implement, see how interfaces could be inserted as components
Todo:
Not yet tested.

Definition at line 1185 of file arcsxmlhandler.cpp.

Here is the call graph for this function:

void ARCSXMLHandler::storeSheet ( ARCSSheet as,
QDomElement  father,
QString  id = QString::null 
)

Stores the xml description of a sheet.

Parameters
asa pointer to a sheet structure
fatherthe element to which the sheet xml description will be attached.

Definition at line 848 of file arcsxmlhandler.cpp.

Here is the call graph for this function:


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