/*
 * $Id: XML_header.cpp 85 2008-05-14 13:09:48Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/XML.h"
#include "Behavioural/include/Version.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;

    str  = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n";
    str += "\n";
    str += "<!--\n";
    str += "\t"+toString(_("File : "))            + _name+"."+_filename_extension + "\n";
    str += "\t"+toString(_("Date : "))            + ctime (&current_time );
    str += "\t"+toString(_("Morpheo version : ")) + MORPHEO_VERSION +"\n";
    str += "\t"+toString(_("Comment : "))         + toString(_("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              
