/*
 * $Id: XML_header.cpp 88 2008-12-10 18:31:39Z 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_HEADER +"\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              
