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

KDocTools

  • sources
  • kde-4.12
  • kdelibs
  • kdoctools
xslt_kde.cpp
Go to the documentation of this file.
1 #include "xslt.h"
2 
3 #include <libxslt/xsltconfig.h>
4 #include <libxslt/xsltInternals.h>
5 #include <libxslt/transform.h>
6 #include <libxslt/xsltutils.h>
7 #include <libxml/xmlIO.h>
8 #include <libxml/parserInternals.h>
9 #include <libxml/catalog.h>
10 #include <kdebug.h>
11 #include <kstandarddirs.h>
12 #include <QtCore/QDate>
13 #include <QtCore/QDir>
14 #include <QtCore/QRegExp>
15 #include <kcomponentdata.h>
16 #include <klocale.h>
17 #include <assert.h>
18 #include <kfilterbase.h>
19 #include <kfilterdev.h>
20 #include <QtCore/QTextCodec>
21 #include <stdlib.h>
22 #include <config.h>
23 #include <stdarg.h>
24 #include <kcharsets.h>
25 #include <kurl.h>
26 
27 void fillInstance(KComponentData &ins, const QString &srcdir)
28 {
29  QByteArray catalogs;
30 
31  if ( srcdir.isEmpty() ) {
32  catalogs += KUrl::fromLocalFile( ins.dirs()->findResource("data", "ksgmltools2/customization/catalog.xml") ).toEncoded();
33  ins.dirs()->addResourceType("dtd", "data", "ksgmltools2/");
34  } else {
35  catalogs += KUrl::fromLocalFile( srcdir +"/customization/catalog.xml" ).toEncoded();
36  ins.dirs()->addResourceDir("dtd", srcdir);
37  }
38 
39  setenv( "XML_CATALOG_FILES", catalogs.constData(), 1 );
40  xmlInitializeCatalog();
41 }
42 
43 QIODevice *getBZip2device(const QString &fileName )
44 {
45  return KFilterDev::deviceForFile(fileName);
46 }
47 
48 bool saveToCache( const QString &contents, const QString &filename )
49 {
50  QIODevice *fd = ::getBZip2device(filename);
51  if ( !fd )
52  return false;
53 
54  if (!fd->open(QIODevice::WriteOnly))
55  {
56  delete fd;
57  return false;
58  }
59 
60  fd->write( contents.toUtf8() );
61  fd->close();
62  delete fd;
63  return true;
64 }
KFilterDev::deviceForFile
static QIODevice * deviceForFile(const QString &fileName, const QString &mimetype=QString(), bool forceFilter=false)
kcharsets.h
kdebug.h
KStandardDirs::addResourceType
bool addResourceType(const char *type, const QString &relativename, bool priority=true)
kfilterdev.h
kurl.h
QString
klocale.h
kfilterbase.h
xslt.h
fillInstance
void fillInstance(KComponentData &ins, const QString &srcdir)
Definition: xslt_kde.cpp:27
getBZip2device
QIODevice * getBZip2device(const QString &fileName)
Definition: xslt_kde.cpp:43
saveToCache
bool saveToCache(const QString &contents, const QString &filename)
Definition: xslt_kde.cpp:48
kstandarddirs.h
KStandardDirs::findResource
QString findResource(const char *type, const QString &filename) const
kcomponentdata.h
QIODevice
KComponentData
KStandardDirs::addResourceDir
bool addResourceDir(const char *type, const QString &absdir, bool priority=true)
KComponentData::dirs
KStandardDirs * dirs() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDocTools

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal