/*
 * $Id: XML_get_body.cpp 94 2008-12-15 11:04:03Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/XML.h"
#include "Common/include/Tabulation.h"

namespace morpheo              {
namespace behavioural          {

#undef  FUNCTION
#define FUNCTION "XML::get_body"
  std::string XML::get_body (void)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    log_printf(FUNC,Behavioural,FUNCTION,"End");
    return _body;
  };

  std::string XML::get_body (uint32_t depth)
  {
    log_printf(FUNC,Behavioural,FUNCTION,"Begin");

    std::string body = _body;
    std::string tab  = indent(depth);

    body.insert(0,tab);
    for (size_t pos=body.find('\n',0); (pos<body.length()-1); pos=body.find('\n',++pos))
      body.insert(++pos,tab);

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

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