/*
 * $Id: XML_header.cpp 81 2008-04-15 18:40:01Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/XML.h"

namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "XML::header"
  void XML::header (std::string encoding)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    time_t current_time;
    time (&current_time);

    std::string str_time = ctime (&current_time );

    std::string str;

    str  = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n";
    str += "\n";
    str += "<!--\n";
    str += "\tFile        : " + _name+"."+_filename_extension + "\n";
    str += "\tDate        : " + str_time;
    str += "\tComment     : it's a autogenerated file : don't modify\n";
    str += "-->\n";
    str += "\n";

    _body = str + _body;

    log_printf(FUNC,Behavioural,FUNCTION,"End");
  };

}; // end namespace behavioural          
}; // end namespace morpheo              
