- Timestamp:
- Dec 10, 2008, 7:31:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
r81 r88 7 7 8 8 #include "Behavioural/include/XML.h" 9 #include "Common/include/ErrorMorpheo.h" 9 10 #include <fstream> 10 11 … … 14 15 #undef FUNCTION 15 16 #define FUNCTION "XML::generate_file" 16 void XML::generate_file (std::string encoding)17 void XML::generate_file (std::string dirname, std::string encoding) 17 18 { 18 19 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); … … 20 21 header (encoding); 21 22 22 std::string filename = _name + "."+ _filename_extension;23 std::string filename = dirname + "/" + _name + _filename_extension; 23 24 24 std::cout << "Generate file \""<< filename << "\"" << std::endl;25 msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str()); 25 26 26 27 std::ofstream file; 27 file.open(filename.c_str(),std::ios::out | std::ios::trunc); 28 file.open(filename.c_str() ,std::ios::out | std::ios::trunc); 29 30 if (!file) 31 throw ERRORMORPHEO(FUNCTION,toString(_("Error opening \"%s\" file.\n"),filename.c_str())); 28 32 29 33 file << get_body(); … … 34 38 }; 35 39 36 void XML::generate_file ( void)40 void XML::generate_file (std::string dirname) 37 41 { 38 42 log_printf(FUNC,Behavioural,FUNCTION,"Begin"); 39 generate_file( "UTF-8");43 generate_file(dirname,"UTF-8"); 40 44 log_printf(FUNC,Behavioural,FUNCTION,"End"); 41 45 };
Note: See TracChangeset
for help on using the changeset viewer.