Changeset 3 for trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Timestamp:
- Mar 6, 2007, 3:34:04 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/src
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp
r2 r3 11 11 namespace behavioural { 12 12 13 XML::XML (string filename) :14 _ filename (filename)13 XML::XML (string name) : 14 _name (name) 15 15 { 16 header ("UTF-8");17 };18 19 XML::XML (string filename,20 string encoding) :21 _filename (filename)22 {23 header(encoding);24 16 }; 25 17 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp
r2 r3 13 13 bool XML::balise_open_end (void) 14 14 { 15 _body += " >\n";15 _body += " >\n"; 16 16 17 17 return true; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
r2 r3 7 7 8 8 #include "Behavioural/include/XML.h" 9 #include <fstream> 10 using namespace std; 9 11 10 12 namespace morpheo { 11 13 namespace behavioural { 12 14 15 void XML::generate_file (string encoding) 16 { 17 header (encoding); 18 19 string name = _name; 20 string filename = name + ".xml"; 21 22 cout << "Generate file \""<< filename << "\"" << endl; 23 24 ofstream file; 25 file.open(filename.c_str(),ios::out | ios::trunc); 26 27 file << get_body(); 28 29 file.close(); 30 }; 31 13 32 void XML::generate_file (void) 14 33 { 34 generate_file("UTF-8"); 15 35 }; 16 36 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp
r2 r3 16 16 }; 17 17 18 string XML::get_body (uint32_t depth) 19 { 20 string body = _body; 21 string tabulation = indent(depth); 22 23 body.insert(0,tabulation); 24 for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos)) 25 body.insert(++pos,tabulation); 26 27 return body; 28 }; 29 18 30 }; // end namespace behavioural 19 31 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp
r2 r3 13 13 void XML::header (string encoding) 14 14 { 15 _body += "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n";15 _body = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n" + _body; 16 16 }; 17 17
Note: See TracChangeset
for help on using the changeset viewer.