kleopatra
archivedefinition.cpp
Go to the documentation of this file.
107 : Kleo::Exception( GPG_ERR_INV_PARAMETER, i18n("Error in archive definition %1: %2", id, message ), MessageOnly ),
133 QString * command, QStringList * prefix, QStringList * suffix, ArchiveDefinition::ArgumentPassingMethod * method, bool parseFilePlaceholder )
158 l = l.replaceInStrings( QLatin1String("__path_goes_here__"), ArchiveDefinition::installPath() );
187 kDebug() << "ArchiveDefinition[" << id << ']' << *command << *prefix << FILE_PLACEHOLDER << *suffix;
240 &m_packCommand[OpenPGP], &m_packPrefixArguments[OpenPGP], &m_packPostfixArguments[OpenPGP], &method, true );
243 &m_packCommand[OpenPGP], &m_packPrefixArguments[OpenPGP], &m_packPostfixArguments[OpenPGP], &method, true );
249 &m_packCommand[CMS], &m_packPrefixArguments[CMS], &m_packPostfixArguments[CMS], &method, true );
252 &m_packCommand[CMS], &m_packPrefixArguments[CMS], &m_packPostfixArguments[CMS], &method, true );
259 parse_command( group.readEntry( UNPACK_COMMAND_OPENPGP_ENTRY ), id(), UNPACK_COMMAND_OPENPGP_ENTRY,
265 throw ArchiveDefinitionError( id(), i18n("cannot use argument passing on standard input for unpack-command") );
275 throw ArchiveDefinitionError( id(), i18n("cannot use argument passing on standard input for unpack-command") );
316 shared_ptr<Input> ArchiveDefinition::createInputFromPackCommand( GpgME::Protocol p, const QStringList & files ) const {
320 throw Kleo::Exception( GPG_ERR_CONFLICT, i18n("Cannot find common base directory for these files:\n%1", files.join( QLatin1String("\n") ) ) );
345 shared_ptr<Output> ArchiveDefinition::createOutputFromUnpackCommand( GpgME::Protocol p, const QString & file, const QDir & wd ) const {
360 std::vector< shared_ptr<ArchiveDefinition> > ArchiveDefinition::getArchiveDefinitions( QStringList & errors ) {
363 const QStringList groups = config->groupList().filter( QRegExp(QLatin1String("^Archive Definition #")) );
367 const shared_ptr<ArchiveDefinition> ad( new KConfigBasedArchiveDefinition( KConfigGroup( config, group ) ) );
QString heuristicBaseDirectory(const QStringList &files)
Definition: path-helper.cpp:71
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
ArgumentPassingMethod
Definition: archivedefinition.h:63
void checkProtocol(GpgME::Protocol p) const
Definition: archivedefinition.cpp:379
static const QLatin1String INSTALLPATH_PLACEHOLDER("%I")
static QString try_extensions(const QString &path)
Definition: archivedefinition.cpp:119
void push_back(const T &value)
static const QLatin1Char NEWLINE_SEPARATED_STDIN_INDICATOR( '|')
void reserve(int alloc)
static const QLatin1String PACK_COMMAND_ENTRY("pack-command")
static const QLatin1String PACK_COMMAND_CMS_ENTRY("pack-command-cms")
static const QLatin1String EXTENSIONS_ENTRY("extensions")
QString join(const QString &separator) const
QString & remove(int position, int n)
int size() const
virtual ~ArchiveDefinition()
Definition: archivedefinition.cpp:305
QString filePath() const
static const QLatin1String UNPACK_COMMAND_OPENPGP_ENTRY("unpack-command-openpgp")
static const QLatin1String EXTENSIONS_OPENPGP_ENTRY("extensions-openpgp")
static const QLatin1String FILE_PLACEHOLDER("%f")
QStringList makeRelativeTo(const QDir &dir, const QStringList &files)
Definition: path-helper.cpp:90
QString fromLocal8Bit(const char *str, int size)
static const QLatin1String PACK_COMMAND_OPENPGP_ENTRY("pack-command-openpgp")
static const QLatin1String UNPACK_COMMAND_ENTRY("unpack-command")
Definition: classify.h:49
static void parse_command(QString cmdline, const QString &id, const QString &whichCommand, QString *command, QStringList *prefix, QStringList *suffix, ArchiveDefinition::ArgumentPassingMethod *method, bool parseFilePlaceholder)
Definition: archivedefinition.cpp:132
QString absoluteFilePath() const
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
Definition: classify.h:48
QCoreApplication * instance()
QStringList & replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
static const QLatin1String ID_ENTRY("id")
boost::shared_ptr< Output > createOutputFromUnpackCommand(GpgME::Protocol p, const QString &file, const QDir &wd) const
Definition: archivedefinition.cpp:345
bool exists() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
static QByteArray make_input(const QStringList &files, char sep)
Definition: archivedefinition.cpp:307
QString & replace(int position, int n, QChar after)
static boost::shared_ptr< Output > createFromProcessStdIn(const QString &command)
Definition: output.cpp:430
static const QLatin1String NAME_ENTRY("Name")
QList< T > mid(int pos, int length) const
int indexOf(const QRegExp &rx, int from) const
static boost::shared_ptr< Input > createFromProcessStdOut(const QString &command)
Definition: input.cpp:241
QStringList filter(const QString &str, Qt::CaseSensitivity cs) const
static const QLatin1String NULL_SEPARATED_STDIN_INDICATOR("0|")
QString applicationDirPath()
boost::shared_ptr< Input > createInputFromPackCommand(GpgME::Protocol p, const QStringList &files) const
Definition: archivedefinition.cpp:316
QByteArray encodeName(const QString &fileName)
static const QLatin1String UNPACK_COMMAND_CMS_ENTRY("unpack-command-cms")
Definition: archivedefinition.h:57
static const QLatin1String EXTENSIONS_CMS_ENTRY("extensions-cms")
static std::vector< boost::shared_ptr< ArchiveDefinition > > getArchiveDefinitions()
Definition: archivedefinition.cpp:354
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.