• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDocTools

xslt_kde.cpp

Go to the documentation of this file.
00001 #include "xslt.h"
00002 
00003 #include <libxslt/xsltconfig.h>
00004 #include <libxslt/xsltInternals.h>
00005 #include <libxslt/transform.h>
00006 #include <libxslt/xsltutils.h>
00007 #include <libxml/xmlIO.h>
00008 #include <libxml/parserInternals.h>
00009 #include <libxml/catalog.h>
00010 #include <kdebug.h>
00011 #include <kstandarddirs.h>
00012 #include <QtCore/QDate>
00013 #include <QtCore/QDir>
00014 #include <QtCore/QRegExp>
00015 #include <kcomponentdata.h>
00016 #include <klocale.h>
00017 #include <assert.h>
00018 #include <kfilterbase.h>
00019 #include <kfilterdev.h>
00020 #include <QtCore/QTextCodec>
00021 #include <stdlib.h>
00022 #include <config.h>
00023 #include <stdarg.h>
00024 #include <kcharsets.h>
00025 #include <kurl.h>
00026 
00027 void fillInstance(KComponentData &ins, const QString &srcdir)
00028 {
00029     QByteArray catalogs;
00030 
00031     if ( srcdir.isEmpty() ) {
00032         catalogs += KUrl::fromLocalFile( ins.dirs()->findResource("data", "ksgmltools2/customization/catalog.xml") ).toEncoded();
00033         ins.dirs()->addResourceType("dtd", "data", "ksgmltools2/");
00034     } else {
00035         catalogs += KUrl::fromLocalFile( srcdir +"/customization/catalog.xml" ).toEncoded();
00036         ins.dirs()->addResourceDir("dtd", srcdir);
00037     }
00038 
00039     setenv( "XML_CATALOG_FILES", catalogs.constData(), 1 );
00040     xmlInitializeCatalog();
00041 }
00042 
00043 QIODevice *getBZip2device(const QString &fileName )
00044 {
00045     return KFilterDev::deviceForFile(fileName);
00046 }
00047 
00048 bool saveToCache( const QString &contents, const QString &filename )
00049 {
00050     QIODevice *fd = ::getBZip2device(filename);
00051     if ( !fd )
00052         return false;
00053 
00054     if (!fd->open(QIODevice::WriteOnly))
00055     {
00056        delete fd;
00057        return false;
00058     }
00059 
00060     fd->write( contents.toUtf8() );
00061     fd->close();
00062     delete fd;
00063     return true;
00064 }

KDocTools

Skip menu "KDocTools"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal