File indexing completed on 2025-02-16 13:03:31
0001 /* 0002 This file is part of KDE Frameworks - KDocTools 0003 The following contributors changed the signatures of the functions 0004 exported here: 0005 0006 SPDX-FileCopyrightText: 2001 Stephan Kulow <coolo@kde.org> 0007 SPDX-FileCopyrightText: 2005 Frerich Raabe <raabe@kde.org> 0008 SPDX-FileCopyrightText: 2010 Albert Astals Cid <aacid@kde.org> 0009 SPDX-FileCopyrightText: 2010, 2016, 2017 Luigi Toscano <luigi.toscano@tiscali.it> 0010 0011 SPDX-License-Identifier: LGPL-2.1-or-later 0012 */ 0013 0014 #ifndef _KDOCTOOLS_XSLT_H_ 0015 #define _KDOCTOOLS_XSLT_H_ 0016 0017 #include <QStandardPaths> 0018 #include <QVector> 0019 #include <kdoctools_export.h> 0020 0021 class QByteArray; 0022 class QString; 0023 0024 /** 0025 * @namespace KDocTools 0026 * Utility methods to generate documentation in various format from DocBook files 0027 */ 0028 namespace KDocTools 0029 { 0030 /** 0031 * Transform and return the content of file with the specified XSLT stylesheet 0032 * (both already in memory) using the optional parameters. 0033 */ 0034 KDOCTOOLS_EXPORT QString transform(const QString &file, const QString &stylesheet, const QVector<const char *> ¶ms = QVector<const char *>()); 0035 0036 /** 0037 * Extract the content of a single file from the content string 0038 * generated by the transformation scripts. 0039 * @since 5.32 0040 */ 0041 KDOCTOOLS_EXPORT QByteArray extractFileToBuffer(const QString &content, const QString &filename); 0042 0043 /** 0044 * Save the content (compressed) in the specified filename. 0045 */ 0046 KDOCTOOLS_EXPORT bool saveToCache(const QString &contents, const QString &filename); 0047 0048 /** 0049 * Initialize the XML catalog used by XSLT functions from the standard 0050 directories or from the specified srcdir. 0051 */ 0052 KDOCTOOLS_EXPORT void setupStandardDirs(const QString &srcdir = QString()); 0053 0054 /** 0055 * Find a specified file amongst the resource shipped with KDocTools. 0056 */ 0057 KDOCTOOLS_EXPORT QString locateFileInDtdResource(const QString &file, const QStandardPaths::LocateOptions option = QStandardPaths::LocateFile); 0058 0059 /** 0060 * Returns the directories which can contain documentation. 0061 * @since 5.36 0062 */ 0063 KDOCTOOLS_EXPORT QStringList documentationDirs(); 0064 0065 } 0066 0067 #endif