1 | |
---|
2 | #include "Indentation.h" |
---|
3 | |
---|
4 | // ... |
---|
5 | |
---|
6 | string Lofig::modeToString ( unsigned int mode ) |
---|
7 | { |
---|
8 | switch ( mode ) { |
---|
9 | case Full: return "Full"; |
---|
10 | case Abstract: return "Abstract"; |
---|
11 | case Empty: return "Empty"; |
---|
12 | } |
---|
13 | return "Unknown"; |
---|
14 | } |
---|
15 | |
---|
16 | |
---|
17 | void Lofig::xmlDrive ( ostream& o, unsigned int mode ) |
---|
18 | { |
---|
19 | o << indent++ << "<Lofig"; |
---|
20 | o << " name=\"" << _name << "\""; |
---|
21 | o << " mode=\"" << modeToString(_mode) << "\""; |
---|
22 | o << " signalsIds=\"" << _signalIds << "\">\n"; |
---|
23 | |
---|
24 | o << indent++ << "<signals>\n"; |
---|
25 | for ( list<Losig*>::iterator isig=_signals.begin() ; isig!=_signals.end() ; isig++ ) |
---|
26 | (*isig)->xmlDrive ( o ); |
---|
27 | o << --indent << "</signals>\n"; |
---|
28 | |
---|
29 | o << indent++ << "<connectors>\n"; |
---|
30 | for ( list<Locon*>::iterator icon=_connectors.begin() ; icon!=_connectors.end() ; icon++ ) |
---|
31 | (*icon)->xmlDrive ( o ); |
---|
32 | o << --indent << "</connectors>\n"; |
---|
33 | |
---|
34 | if ( mode == Full ) { |
---|
35 | o << indent++ << "<models>\n"; |
---|
36 | for ( list<Lofig*>::iterator ifig=_models.begin() ; ifig!=_models.end() ; ifig++ ) |
---|
37 | (*ifig)->xmlDrive ( o, Abstract ); |
---|
38 | o << --indent << "</models>\n"; |
---|
39 | |
---|
40 | o << indent++ << "<instances>\n"; |
---|
41 | for ( list<Loins*>::iterator iins=_instances.begin() ; iins!=_instances.end() ; iins++ ) |
---|
42 | (*iins)->xmlDrive ( o ); |
---|
43 | o << --indent << "</instances>\n"; |
---|
44 | } |
---|
45 | |
---|
46 | o << --indent << "</Lofig>\n"; |
---|
47 | } |
---|