kshell.h
/*
This file is part of the KDE libraries
Copyright (c) 2003 Oswald Buddenhagen <ossi@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KSHELL_H
#define _KSHELL_H
#include <qstring.h>
#include <qstringlist.h>
#include "kdelibs_export.h"
namespace KShell {
enum Options {
NoOptions = 0,
TildeExpand = 1,
AbortOnMeta = 2
};
enum Errors {
NoError = 0,
BadQuoting,
FoundMeta
};
KDECORE_EXPORT QStringList splitArgs( const QString &cmd, int flags = 0, int *err = 0 );
KDECORE_EXPORT QString joinArgs( const QStringList &args );
KDECORE_EXPORT QString joinArgsDQ( const QStringList &args );
KDECORE_EXPORT QString joinArgs( const char * const *argv, int argc = -1 );
KDECORE_EXPORT QString tildeExpand( const QString &path );
KDECORE_EXPORT QString homeDir( const QString &user );
}
#endif /* _KSHELL_H */
KShell::TildeExpand
Perform tilde expansion.
Definition: kshell.h:46
KShell::FoundMeta
The AbortOnMeta flag was set and a shell meta character was encoutered.
Definition: kshell.h:79
KShell::Errors
Errors
Status codes from splitArgs()
Definition: kshell.h:64
KShell::Options
Options
Flags for splitArgs().
Definition: kshell.h:40
KShell::homeDir
QString homeDir(const QString &user)
Obtain a user's home directory.
Definition: kshell.cpp:369
KShell::joinArgsDQ
QString joinArgsDQ(const QStringList &args)
Same as above, but $'' is used instead of '' for the quoting.
Definition: kshell.cpp:311
KShell::BadQuoting
Indicates a parsing error, like an unterminated quoted string.
Definition: kshell.h:73
KShell::NoError
Success.
Definition: kshell.h:68
KShell::tildeExpand
QString tildeExpand(const QString &path)
Performs tilde expansion on path.
Definition: kshell.cpp:355
KShell::joinArgs
QString joinArgs(const QStringList &args)
Quotes and joins args together according to POSIX shell rules.
Definition: kshell.cpp:257
KShell::AbortOnMeta
Bail out if a non-quoting and not quoted shell meta character is encoutered.
Definition: kshell.h:58
KShell::splitArgs
QStringList splitArgs(const QString &cmd, int flags=0, int *err=0)
Splits cmd according to POSIX shell word splitting and quoting rules.
Definition: kshell.cpp:65

KDE Home | KDE Accessibility Home | Description of Access Keys