1 | |
---|
2 | #include "Indentation.h" |
---|
3 | |
---|
4 | /// ... |
---|
5 | |
---|
6 | std::string Locon::typeToString ( unsigned int type ) |
---|
7 | { |
---|
8 | switch ( type ) { |
---|
9 | case Internal: return "Internal"; |
---|
10 | case External: return "External"; |
---|
11 | } |
---|
12 | return "Unknown"; |
---|
13 | } |
---|
14 | |
---|
15 | |
---|
16 | std::string Locon::dirToString ( unsigned int direction ) |
---|
17 | { |
---|
18 | switch ( direction ) { |
---|
19 | case In: return "In"; |
---|
20 | case Out: return "Out"; |
---|
21 | case Inout: return "Inout"; |
---|
22 | case Tristate: return "Tristate"; |
---|
23 | case Transcv: return "Transcv"; |
---|
24 | } |
---|
25 | return "Unknown"; |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | void Locon::xmlDrive ( std::ostream& o ) |
---|
30 | { |
---|
31 | o << indent << "<Locon name=\"" << _name << "\""; |
---|
32 | o << " signal=\"" << ((_signal != NULL) ? _signal->getName() : "NULL") << "\""; |
---|
33 | if ( _type == External ) o << " model=\"" << getModel ()->getName() << "\""; |
---|
34 | else o << " instance=\"" << getInstance()->getName() << "\""; |
---|
35 | o << " dir=\"" << dirToString(_direction) << "\""; |
---|
36 | o << " type=\"" << typeToString(_type) << "\"/>\n"; |
---|
37 | } |
---|