/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     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: src/sgx/filesystem/io/xml/xmlwriter.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/filesystem/filesystem.hpp"
#include "sgx/filesystem/io/xml/xml.hpp"

tBOOL	
CXMLWriter::write(const sgxString &filename)
{
	CSGXFile file(filename, "rw");

	if (file.open()) {
		tBOOL rt = write(file);
		file.close();
		return rt;
	}
	return FALSE;
}

tBOOL	
CXMLWriter::write(CSGXFile &file)
{
	if (!file.isValid()) {
		return FALSE;
	}

	file << m_Tree;

	return TRUE;
}
