/usr/include/klfbackend/klffilterprocess.h is in libklatexformula3-dev 3.3.0~beta-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | /***************************************************************************
* file klffilterprocess.h
* This file is part of the KLatexFormula Project.
* Copyright (C) 2011 by Philippe Faist
* philippe.faist at bluewin.ch
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/* $Id: klffilterprocess.h 866 2013-11-24 13:56:22Z phfaist $ */
#ifndef KLFFILTERPROCESS_H
#define KLFFILTERPROCESS_H
#include <klfdefs.h>
#include <klfblockprocess.h>
#include <klfbackend.h>
#define KLFFP_NOERR 0
#define KLFFP_NOSTART 1
#define KLFFP_NOEXIT 2
#define KLFFP_NOSUCCESSEXIT 3
#define KLFFP_NODATA 4
#define KLFFP_DATAREADFAIL 5
#define KLFFP_PAST_LAST_VALUE 6
class KLFFilterProcessPrivate;
class KLF_EXPORT KLFFilterProcess
{
public:
KLFFilterProcess(const QString& pTitle = QString(), const KLFBackend::klfSettings *settings = NULL,
const QString& rundir = QString());
virtual ~KLFFilterProcess();
QString progTitle() const;
void setProgTitle(const QString& title);
QString programCwd() const;
void setProgramCwd(const QString& cwd);
QStringList execEnviron() const;
void setExecEnviron(const QStringList& env);
void addExecEnviron(const QStringList& env);
QStringList argv() const;
void setArgv(const QStringList& argv);
void addArgv(const QStringList& argv);
void addArgv(const QString& argv);
bool outputStdout() const;
/** Set this to false to ignore output on stdout of the program. */
void setOutputStdout(bool on);
bool outputStderr() const;
/** Set this to true to also read stderr as part of the output. If false (the default), stderr
* output is only reported in the error message in case nothing came out on stdout. */
void setOutputStderr(bool on);
/** Set a QByteArray where all stdout data will be stored */
void collectStdoutTo(QByteArray * stdoutstore);
/** Set a QByteArray where all stderr data will be stored */
void collectStderrTo(QByteArray * stderrstore);
/** See \ref setProcessAppEvents() */
bool processAppEvents();
/** specify whether or not to call regularly qApp->processEvents() while executing.
* This will prevent the GUI to freeze. Enabled is the default. However you can choose to
* disable this behavior by passing FALSE here, e.g. if you're not in the GUI thread. */
void setProcessAppEvents(bool processEvents);
/** After run(), this is set to the exit status of the process. See QProcess::exitStatus() */
int exitStatus() const;
/** After run(), this is set to the exit code of the process. See QProcess::exitCode() */
int exitCode() const;
/** This is one of the KLFFP_* define's, such as \ref KLFFP_NOSTART, or \ref KLFFP_NOERR if all OK. */
int resultStatus() const;
/** An explicit error string in case the resultStatus() indicated an error. */
QString resultErrorString() const;
bool run(const QString& outFileName, QByteArray *outdata)
{
return run(QByteArray(), outFileName, outdata);
}
bool run(const QByteArray& indata, const QString& outFileName, QByteArray *outdata)
{
QMap<QString,QByteArray*> fout; fout[outFileName] = outdata;
return run(indata, fout);
}
bool run(const QMap<QString, QByteArray*> outdata)
{
return run(QByteArray(), outdata);
}
bool run(const QByteArray& indata = QByteArray())
{
return run(indata, QMap<QString, QByteArray*>());
}
/**
*
* \note multiple output files possible. Each data is retreived into a pointer given by outdata map.
*
* \param indata a QByteArray to write into the program's standard input
* \param outdatalist a QMap with keys being files that are created by the program. These files are
* read and their contents stored in the QByteArray's pointed by the corresponding pointer.
* \param resError the klfOutput object is initialized to the corresponding error if an error occurred.
*
* An empty file name in the list means to collect the standard output.
*
* \returns TRUE/FALSE for success/failure, respectively.
*/
bool run(const QByteArray& indata, const QMap<QString, QByteArray*> outdatalist);
private:
KLF_DECLARE_PRIVATE(KLFFilterProcess) ;
};
#endif
|