Logo Search packages:      
Sourcecode: inkscape version File versions

void Inkscape::IO::XsltOutputStream::flush (  )  throw (StreamException) [virtual]

Flushes this output stream and forces any buffered output bytes to be written out.

Reimplemented from Inkscape::IO::BasicOutputStream.

Definition at line 163 of file xsltstream.cpp.

References Inkscape::IO::OutputStream::flush(), Inkscape::IO::OutputStream::put(), and Inkscape::IO::XsltStyleSheet::stylesheet.

Referenced by close().

{
    if (flushed)
        {
        destination.flush();
        return;
        }
        
    //Do the processing
    xmlChar *resbuf;
    int resSize;
    const char *params[1];
    params[0] = NULL;
    xmlDocPtr srcDoc = xmlParseMemory(outbuf.raw().c_str(), outbuf.size());
    xmlDocPtr resDoc = xsltApplyStylesheet(stylesheet.stylesheet, srcDoc, params);
    xmlDocDumpFormatMemory(resDoc, &resbuf, &resSize, 1);
    /*
    xmlErrorPtr err = xmlGetLastError();
    if (err)
        {
        throw StreamException(err->message);
        }
    */

    for (int i=0 ; i<resSize ; i++)
        {
        char ch = resbuf[i];
        destination.put(ch);
        }
        
    //Free our mem
    xmlFree(resbuf);
    xmlFreeDoc(resDoc);
    xmlFreeDoc(srcDoc);
    destination.flush();
    flushed = true;
}


Generated by  Doxygen 1.6.0   Back to index