/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/core/xml/xmlbase.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/core/xml/xmlbase.hpp"

/**
For more attractive printing, this returns a suitable indentation
for @tab'th level.

This is entirely optional, and may be removed if a faster method
is required.
*/
sgxString sgxXMLBase::getTab(const int tab)
{
	sgxString s;
	int n = tab;

	while(n--) {
		s += "   ";
	}

	return s;
}

/**
Replace any character(s) in @in_text with those suitable for storage
in an XML document. This replaces the reserved symbols (e.g. < & >)
with specific entities that won't conflict with XML parsing.
*/
void sgxXMLBase::validate(sgxString &out_text, const sgxString &in_text)
{
	// TODO:
	// < &lt;
	// > &rt;
	// & &amp;
	// " &quot;
	// ' &apos;

	out_text = in_text;
}
