summaryrefslogtreecommitdiff
path: root/src/xmlfilewriter.cpp
blob: 3c6fb418e16df9c26fd32c568e7fc1fe8bc22a9c (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 )
{
	fputs( sString, fh );
}