aboutsummaryrefslogtreecommitdiff
path: root/src/xmlfilewriter.cpp
blob: 19120a0214f2f2d5e316ad9932bebfb9b44aea4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include "xmlfilewriter.h"

XmlFileWriter::XmlFileWriter( const char *sFileName, const char *sIndent, XmlNode *pRoot ) :
	XmlWriter( sIndent, pRoot )
{
	this->sFileName = sFileName;
	fh = fopen( sFileName, "wt");
	fprintf( fh, "<?xml version=\"1.0\"?>\n");
}

XmlFileWriter::XmlFileWriter( FILE *fh, const char *sIndent, XmlNode *pRoot ) :
	XmlWriter( sIndent, pRoot ),
	fh( fh )
{
}

XmlFileWriter::~XmlFileWriter()
{
	fclose( fh );
}

void XmlFileWriter::writeString( const char *sString )
{
	fprintf( fh, sString );
}