/*
* XSL Transforming input and output classes
*
* Authors:
* Bob Jamison <ishmalius@gmail.com>
*
* Copyright (C) 2004-2008 Inkscape.org
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "xsltstream.h"
#include "stringstream.h"
#include <libxslt/transform.h>
namespace Inkscape
{
namespace IO
{
//#########################################################################
//# X S L T S T Y L E S H E E T
//#########################################################################
/**
*
*/
: stylesheet(NULL)
{
if (!read(xsltSource)) {
throw StreamException("read failed");
}
}
/**
*
*/
: stylesheet(NULL)
{
}
/**
*
*/
{
//following not necessary. handled by xsltFreeStylesheet(stylesheet);
//xmlFreeDoc(doc);
if (!stylesheet)
return false;
return true;
}
/**
*
*/
{
if (stylesheet)
}
//#########################################################################
//# X S L T I N P U T S T R E A M
//#########################################################################
/**
*
*/
{
//Load the data
//Do the processing
outpos = 0;
//Free our mem
}
/**
*
*/
{
}
/**
* Returns the number of bytes that can be read (or skipped over) from
* this input stream without blocking by the next caller of a method for
* this input stream.
*/
{
}
/**
* Closes this input stream and releases any system resources
* associated with the stream.
*/
{
closed = true;
}
/**
* Reads the next byte of data from the input stream. -1 if EOF
*/
{
if (closed)
return -1;
return -1;
return ch;
}
//#########################################################################
//# X S L T O U T P U T S T R E A M
//#########################################################################
/**
*
*/
{
flushed = false;
}
/**
*
*/
{
//do not automatically close
}
/**
* Closes this output stream and releases any system resources
* associated with this stream.
*/
{
flush();
destination.close();
}
/**
* Flushes this output stream and forces any buffered output
* bytes to be written out.
*/
{
if (flushed)
{
destination.flush();
return;
}
//Do the processing
int resSize;
/*
xmlErrorPtr err = xmlGetLastError();
if (err)
{
throw StreamException(err->message);
}
*/
for (int i=0 ; i<resSize ; i++)
{
}
//Free our mem
destination.flush();
flushed = true;
}
/**
* Writes the specified byte to this output stream.
*/
{
return 1;
}
} // namespace IO
} // namespace Inkscape
//#########################################################################
//# E N D O F F I L E
//#########################################################################