Last change
on this file since 87 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
928 bytes
|
Rev | Line | |
---|
[2] | 1 | /* |
---|
| 2 | * $Id: XML_generate_file.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/include/XML.h" |
---|
[3] | 9 | #include <fstream> |
---|
[2] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | |
---|
[43] | 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "XML::generate_file" |
---|
[71] | 16 | void XML::generate_file (std::string encoding) |
---|
[3] | 17 | { |
---|
[43] | 18 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 19 | |
---|
[3] | 20 | header (encoding); |
---|
| 21 | |
---|
[71] | 22 | std::string filename = _name + "." + _filename_extension; |
---|
[3] | 23 | |
---|
[71] | 24 | std::cout << "Generate file \""<< filename << "\"" << std::endl; |
---|
[3] | 25 | |
---|
[71] | 26 | std::ofstream file; |
---|
| 27 | file.open(filename.c_str(),std::ios::out | std::ios::trunc); |
---|
[3] | 28 | |
---|
| 29 | file << get_body(); |
---|
| 30 | |
---|
| 31 | file.close(); |
---|
[43] | 32 | |
---|
| 33 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
[3] | 34 | }; |
---|
| 35 | |
---|
[2] | 36 | void XML::generate_file (void) |
---|
| 37 | { |
---|
[43] | 38 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
[3] | 39 | generate_file("UTF-8"); |
---|
[43] | 40 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
[2] | 41 | }; |
---|
| 42 | |
---|
| 43 | }; // end namespace behavioural |
---|
| 44 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.