// $Id: CHttpReader.cc,v 1.5 2003/04/08 13:54:16 ta_muto Exp $

#include <CHttpReader.h>
#include <libxml/nanohttp.h>

wax::CHttpReader::~CHttpReader()
{
	if(ctx != NULL) {
		close();
	}
}

bool wax::CHttpReader::open()
{
	char* contentType;
	ctx = xmlNanoHTTPOpen((const char*)path, &contentType);
	if(ctx == NULL)	return false;
	return false;
}

int wax::CHttpReader::read(char* buffer, int size)
{
	return xmlNanoHTTPRead(ctx, buffer, size);
}

void wax::CHttpReader::close()
{
	xmlNanoHTTPClose(ctx);
}
