mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kdecore: initialize KMacroMapExpander and KWordMacroExpander variables
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d2b312f5a1
commit
9e021af628
2 changed files with 158 additions and 138 deletions
|
@ -26,7 +26,8 @@
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
KMacroExpanderBase::KMacroExpanderBase( QChar c ) : d(new KMacroExpanderBasePrivate(c))
|
KMacroExpanderBase::KMacroExpanderBase(QChar c)
|
||||||
|
: d(new KMacroExpanderBasePrivate(c))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,19 +36,17 @@ KMacroExpanderBase::~KMacroExpanderBase()
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void KMacroExpanderBase::setEscapeChar(QChar c)
|
||||||
KMacroExpanderBase::setEscapeChar( QChar c )
|
|
||||||
{
|
{
|
||||||
d->escapechar = c;
|
d->escapechar = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
QChar
|
QChar KMacroExpanderBase::escapeChar() const
|
||||||
KMacroExpanderBase::escapeChar() const
|
|
||||||
{
|
{
|
||||||
return d->escapechar;
|
return d->escapechar;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMacroExpanderBase::expandMacros( QString &str )
|
void KMacroExpanderBase::expandMacros(QString &str)
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
int len;
|
int len;
|
||||||
|
@ -57,53 +56,64 @@ void KMacroExpanderBase::expandMacros( QString &str )
|
||||||
|
|
||||||
for (pos = 0; pos < str.length(); ) {
|
for (pos = 0; pos < str.length(); ) {
|
||||||
if (ec != 0) {
|
if (ec != 0) {
|
||||||
if (str.unicode()[pos].unicode() != ec)
|
if (str[pos].unicode() != ec) {
|
||||||
goto nohit;
|
goto nohit;
|
||||||
if (!(len = expandEscapedMacro( str, pos, rst )))
|
|
||||||
goto nohit;
|
|
||||||
} else {
|
|
||||||
if (!(len = expandPlainMacro( str, pos, rst )))
|
|
||||||
goto nohit;
|
|
||||||
}
|
|
||||||
if (len < 0) {
|
|
||||||
pos -= len;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
rsts = rst.join( QLatin1String(" ") );
|
if (!(len = expandEscapedMacro(str, pos, rst))) {
|
||||||
rst.clear();
|
goto nohit;
|
||||||
str.replace( pos, len, rsts );
|
}
|
||||||
pos += rsts.length();
|
} else {
|
||||||
|
if (!(len = expandPlainMacro(str, pos, rst))) {
|
||||||
|
goto nohit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (len < 0) {
|
||||||
|
pos -= len;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
rsts = rst.join(QLatin1String(" "));
|
||||||
|
rst.clear();
|
||||||
|
str.replace(pos, len, rsts);
|
||||||
|
pos += rsts.length();
|
||||||
|
continue;
|
||||||
nohit:
|
nohit:
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KMacroExpanderBase::expandMacrosShellQuote( QString &str )
|
bool KMacroExpanderBase::expandMacrosShellQuote(QString &str)
|
||||||
{
|
{
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
return expandMacrosShellQuote( str, pos ) && pos == str.length();
|
return expandMacrosShellQuote(str, pos) && pos == str.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
int KMacroExpanderBase::expandPlainMacro( const QString &, int, QStringList & )
|
int KMacroExpanderBase::expandPlainMacro(const QString &, int, QStringList &)
|
||||||
{ qFatal( "KMacroExpanderBase::expandPlainMacro called!" ); return 0; }
|
{
|
||||||
|
qFatal("KMacroExpanderBase::expandPlainMacro called!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int KMacroExpanderBase::expandEscapedMacro( const QString &, int, QStringList & )
|
int KMacroExpanderBase::expandEscapedMacro(const QString &, int, QStringList &)
|
||||||
{ qFatal( "KMacroExpanderBase::expandEscapedMacro called!" ); return 0; }
|
{
|
||||||
|
qFatal("KMacroExpanderBase::expandEscapedMacro called!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
template <typename KT, typename VT>
|
template <typename KT, typename VT>
|
||||||
class KMacroMapExpander : public KMacroExpanderBase {
|
class KMacroMapExpander : public KMacroExpanderBase
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
KMacroMapExpander( const QHash<KT,VT> &map, QChar c = QLatin1Char('%') ) :
|
KMacroMapExpander(const QHash<KT,VT> &map, QChar c = QLatin1Char('%'))
|
||||||
KMacroExpanderBase( c ), macromap( map ) {}
|
: KMacroExpanderBase(c), macromap(map)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int expandPlainMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandPlainMacro(const QString &str, int pos, QStringList &ret);
|
||||||
virtual int expandEscapedMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandEscapedMacro(const QString &str, int pos, QStringList &ret);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<KT,VT> macromap;
|
QHash<KT,VT> macromap;
|
||||||
|
@ -111,8 +121,7 @@ private:
|
||||||
|
|
||||||
////////
|
////////
|
||||||
|
|
||||||
static bool
|
static bool isIdentifier(ushort c)
|
||||||
isIdentifier( ushort c )
|
|
||||||
{
|
{
|
||||||
return c == '_' ||
|
return c == '_' ||
|
||||||
(c >= 'A' && c <= 'Z') ||
|
(c >= 'A' && c <= 'Z') ||
|
||||||
|
@ -123,25 +132,27 @@ isIdentifier( ushort c )
|
||||||
////////
|
////////
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
class KMacroMapExpander<QChar,VT> : public KMacroExpanderBase {
|
class KMacroMapExpander<QChar,VT> : public KMacroExpanderBase
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
KMacroMapExpander( const QHash<QChar,VT> &map, QChar c = QLatin1Char('%') ) :
|
KMacroMapExpander(const QHash<QChar,VT> &map, QChar c = QLatin1Char('%'))
|
||||||
KMacroExpanderBase( c ), macromap( map ) {}
|
: KMacroExpanderBase(c),
|
||||||
|
macromap(map)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int expandPlainMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandPlainMacro(const QString &str, int pos, QStringList &ret);
|
||||||
virtual int expandEscapedMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandEscapedMacro(const QString &str, int pos, QStringList &ret);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<QChar,VT> macromap;
|
QHash<QChar,VT> macromap;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
int
|
int KMacroMapExpander<QChar,VT>::expandPlainMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KMacroMapExpander<QChar,VT>::expandPlainMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
typename QHash<QChar,VT>::const_iterator it = macromap.constFind(str.unicode()[pos]);
|
typename QHash<QChar,VT>::const_iterator it = macromap.constFind(str[pos]);
|
||||||
if (it != macromap.constEnd()) {
|
if (it != macromap.constEnd()) {
|
||||||
ret += it.value();
|
ret += it.value();
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -150,53 +161,55 @@ KMacroMapExpander<QChar,VT>::expandPlainMacro( const QString &str, int pos, QStr
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
int
|
int KMacroMapExpander<QChar,VT>::expandEscapedMacro(const QString &str, int pos, QStringList &ret )
|
||||||
KMacroMapExpander<QChar,VT>::expandEscapedMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (str.length() <= pos + 1)
|
if (str.length() <= pos + 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
if (str.unicode()[pos + 1] == escapeChar()) {
|
if (str[pos + 1] == escapeChar()) {
|
||||||
ret += QString( escapeChar() );
|
ret += QString( escapeChar() );
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
typename QHash<QChar,VT>::const_iterator it = macromap.constFind(str.unicode()[pos + 1]);
|
typename QHash<QChar,VT>::const_iterator it = macromap.constFind(str[pos + 1]);
|
||||||
if (it != macromap.constEnd()) {
|
if (it != macromap.constEnd()) {
|
||||||
ret += it.value();
|
ret += it.value();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
class KMacroMapExpander<QString,VT> : public KMacroExpanderBase {
|
class KMacroMapExpander<QString,VT> : public KMacroExpanderBase
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
KMacroMapExpander( const QHash<QString,VT> &map, QChar c = QLatin1Char('%') ) :
|
KMacroMapExpander(const QHash<QString,VT> &map, QChar c = QLatin1Char('%'))
|
||||||
KMacroExpanderBase( c ), macromap( map ) {}
|
: KMacroExpanderBase(c),
|
||||||
|
macromap(map)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int expandPlainMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandPlainMacro(const QString &str, int pos, QStringList &ret);
|
||||||
virtual int expandEscapedMacro( const QString &str, int pos, QStringList &ret );
|
virtual int expandEscapedMacro(const QString &str, int pos, QStringList &ret);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHash<QString,VT> macromap;
|
QHash<QString,VT> macromap;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
int
|
int KMacroMapExpander<QString,VT>::expandPlainMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KMacroMapExpander<QString,VT>::expandPlainMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (pos && isIdentifier( str.unicode()[pos - 1].unicode() ))
|
if (pos && isIdentifier(str[pos - 1].unicode())) {
|
||||||
return 0;
|
return 0;
|
||||||
int sl;
|
}
|
||||||
for (sl = 0; isIdentifier( str.unicode()[pos + sl].unicode() ); sl++)
|
int sl = 0;
|
||||||
|
for (sl = 0; isIdentifier(str[pos + sl].unicode()); sl++) {
|
||||||
;
|
;
|
||||||
if (!sl)
|
}
|
||||||
|
if (!sl) {
|
||||||
return 0;
|
return 0;
|
||||||
typename QHash<QString,VT>::const_iterator it =
|
}
|
||||||
macromap.constFind( str.mid( pos, sl ) );
|
typename QHash<QString,VT>::const_iterator it = macromap.constFind(str.mid(pos, sl));
|
||||||
if (it != macromap.constEnd()) {
|
if (it != macromap.constEnd()) {
|
||||||
ret += it.value();
|
ret += it.value();
|
||||||
return sl;
|
return sl;
|
||||||
|
@ -205,18 +218,19 @@ KMacroMapExpander<QString,VT>::expandPlainMacro( const QString &str, int pos, QS
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VT>
|
template <typename VT>
|
||||||
int
|
int KMacroMapExpander<QString,VT>::expandEscapedMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KMacroMapExpander<QString,VT>::expandEscapedMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (str.length() <= pos + 1)
|
if (str.length() <= pos + 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
if (str.unicode()[pos + 1] == escapeChar()) {
|
if (str[pos + 1] == escapeChar()) {
|
||||||
ret += QString( escapeChar() );
|
ret += QString(escapeChar());
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
int sl, rsl, rpos;
|
int sl = 0;
|
||||||
if (str.unicode()[pos + 1].unicode() == '{') {
|
int rsl = 0;
|
||||||
|
int rpos = 0;
|
||||||
|
if (str[pos + 1].unicode() == '{') {
|
||||||
rpos = pos + 2;
|
rpos = pos + 2;
|
||||||
if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0)
|
if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -224,14 +238,15 @@ KMacroMapExpander<QString,VT>::expandEscapedMacro( const QString &str, int pos,
|
||||||
rsl = sl + 3;
|
rsl = sl + 3;
|
||||||
} else {
|
} else {
|
||||||
rpos = pos + 1;
|
rpos = pos + 1;
|
||||||
for (sl = 0; isIdentifier( str.unicode()[rpos + sl].unicode() ); ++sl)
|
for (sl = 0; isIdentifier(str[rpos + sl].unicode()); ++sl) {
|
||||||
;
|
;
|
||||||
|
}
|
||||||
rsl = sl + 1;
|
rsl = sl + 1;
|
||||||
}
|
}
|
||||||
if (!sl)
|
if (!sl) {
|
||||||
return 0;
|
return 0;
|
||||||
typename QHash<QString,VT>::const_iterator it =
|
}
|
||||||
macromap.constFind( str.mid( rpos, sl ) );
|
typename QHash<QString,VT>::const_iterator it = macromap.constFind(str.mid(rpos, sl));
|
||||||
if (it != macromap.constEnd()) {
|
if (it != macromap.constEnd()) {
|
||||||
ret += it.value();
|
ret += it.value();
|
||||||
return rsl;
|
return rsl;
|
||||||
|
@ -241,115 +256,120 @@ KMacroMapExpander<QString,VT>::expandEscapedMacro( const QString &str, int pos,
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
int
|
int KCharMacroExpander::expandPlainMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KCharMacroExpander::expandPlainMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (expandMacro( str.unicode()[pos], ret ))
|
if (expandMacro(str[pos], ret))
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int KCharMacroExpander::expandEscapedMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KCharMacroExpander::expandEscapedMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (str.length() <= pos + 1)
|
if (str.length() <= pos + 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (str.unicode()[pos + 1] == escapeChar()) {
|
if (str[pos + 1] == escapeChar()) {
|
||||||
ret += QString( escapeChar() );
|
ret += QString(escapeChar());
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
if (expandMacro( str.unicode()[pos + 1], ret ))
|
if (expandMacro(str[pos + 1], ret)) {
|
||||||
return 2;
|
return 2;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int KWordMacroExpander::expandPlainMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KWordMacroExpander::expandPlainMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (pos && isIdentifier( str.unicode()[pos - 1].unicode() ))
|
if (pos && isIdentifier(str[pos - 1].unicode())) {
|
||||||
return 0;
|
return 0;
|
||||||
int sl;
|
}
|
||||||
for (sl = 0; isIdentifier( str.unicode()[pos + sl].unicode() ); sl++)
|
int sl = 0;
|
||||||
|
for (sl = 0; isIdentifier(str[pos + sl].unicode()); sl++) {
|
||||||
;
|
;
|
||||||
if (!sl)
|
}
|
||||||
|
if (!sl) {
|
||||||
return 0;
|
return 0;
|
||||||
if (expandMacro( str.mid( pos, sl ), ret ))
|
}
|
||||||
|
if (expandMacro(str.mid(pos, sl), ret)) {
|
||||||
return sl;
|
return sl;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int KWordMacroExpander::expandEscapedMacro(const QString &str, int pos, QStringList &ret)
|
||||||
KWordMacroExpander::expandEscapedMacro( const QString &str, int pos, QStringList &ret )
|
|
||||||
{
|
{
|
||||||
if (str.length() <= pos + 1)
|
if (str.length() <= pos + 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
if (str.unicode()[pos + 1] == escapeChar()) {
|
if (str[pos + 1] == escapeChar()) {
|
||||||
ret += QString( escapeChar() );
|
ret += QString(escapeChar());
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
int sl, rsl, rpos;
|
int sl = 0;
|
||||||
if (str.unicode()[pos + 1].unicode() == '{') {
|
int rsl = 0;
|
||||||
|
int rpos = 0;
|
||||||
|
if (str[pos + 1].unicode() == '{') {
|
||||||
rpos = pos + 2;
|
rpos = pos + 2;
|
||||||
if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0)
|
if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
sl -= rpos;
|
sl -= rpos;
|
||||||
rsl = sl + 3;
|
rsl = sl + 3;
|
||||||
} else {
|
} else {
|
||||||
rpos = pos + 1;
|
rpos = pos + 1;
|
||||||
for (sl = 0; isIdentifier( str.unicode()[rpos + sl].unicode() ); ++sl)
|
for (sl = 0; isIdentifier(str[rpos + sl].unicode()); ++sl) {
|
||||||
;
|
;
|
||||||
|
}
|
||||||
rsl = sl + 1;
|
rsl = sl + 1;
|
||||||
}
|
}
|
||||||
if (!sl)
|
if (!sl) {
|
||||||
return 0;
|
return 0;
|
||||||
if (expandMacro( str.mid( rpos, sl ), ret ))
|
}
|
||||||
|
if (expandMacro(str.mid(rpos, sl), ret)) {
|
||||||
return rsl;
|
return rsl;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
template <typename KT, typename VT>
|
template <typename KT, typename VT>
|
||||||
inline QString
|
inline QString TexpandMacros(const QString &ostr, const QHash<KT,VT> &map, QChar c)
|
||||||
TexpandMacros( const QString &ostr, const QHash<KT,VT> &map, QChar c )
|
|
||||||
{
|
{
|
||||||
QString str( ostr );
|
QString str(ostr);
|
||||||
KMacroMapExpander<KT,VT> kmx( map, c );
|
KMacroMapExpander<KT,VT> kmx(map, c);
|
||||||
kmx.expandMacros( str );
|
kmx.expandMacros(str);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename KT, typename VT>
|
template <typename KT, typename VT>
|
||||||
inline QString
|
inline QString TexpandMacrosShellQuote(const QString &ostr, const QHash<KT,VT> &map, QChar c)
|
||||||
TexpandMacrosShellQuote( const QString &ostr, const QHash<KT,VT> &map, QChar c )
|
|
||||||
{
|
{
|
||||||
QString str( ostr );
|
QString str(ostr);
|
||||||
KMacroMapExpander<KT,VT> kmx( map, c );
|
KMacroMapExpander<KT,VT> kmx(map, c);
|
||||||
if (!kmx.expandMacrosShellQuote( str ))
|
if (!kmx.expandMacrosShellQuote(str)) {
|
||||||
return QString();
|
return QString();
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public API
|
// public API
|
||||||
namespace KMacroExpander {
|
namespace KMacroExpander {
|
||||||
|
QString expandMacros(const QString &ostr, const QHash<QChar,QString> &map, QChar c)
|
||||||
QString expandMacros( const QString &ostr, const QHash<QChar,QString> &map, QChar c )
|
{ return TexpandMacros(ostr, map, c); }
|
||||||
{ return TexpandMacros( ostr, map, c ); }
|
QString expandMacrosShellQuote(const QString &ostr, const QHash<QChar,QString> &map, QChar c)
|
||||||
QString expandMacrosShellQuote( const QString &ostr, const QHash<QChar,QString> &map, QChar c )
|
{ return TexpandMacrosShellQuote(ostr, map, c); }
|
||||||
{ return TexpandMacrosShellQuote( ostr, map, c ); }
|
QString expandMacros(const QString &ostr, const QHash<QString,QString> &map, QChar c)
|
||||||
QString expandMacros( const QString &ostr, const QHash<QString,QString> &map, QChar c )
|
{ return TexpandMacros(ostr, map, c); }
|
||||||
{ return TexpandMacros( ostr, map, c ); }
|
QString expandMacrosShellQuote(const QString &ostr, const QHash<QString,QString> &map, QChar c)
|
||||||
QString expandMacrosShellQuote( const QString &ostr, const QHash<QString,QString> &map, QChar c )
|
{ return TexpandMacrosShellQuote(ostr, map, c); }
|
||||||
{ return TexpandMacrosShellQuote( ostr, map, c ); }
|
QString expandMacros(const QString &ostr, const QHash<QChar,QStringList> &map, QChar c)
|
||||||
QString expandMacros( const QString &ostr, const QHash<QChar,QStringList> &map, QChar c )
|
{ return TexpandMacros(ostr, map, c); }
|
||||||
{ return TexpandMacros( ostr, map, c ); }
|
QString expandMacrosShellQuote(const QString &ostr, const QHash<QChar,QStringList> &map, QChar c)
|
||||||
QString expandMacrosShellQuote( const QString &ostr, const QHash<QChar,QStringList> &map, QChar c )
|
{ return TexpandMacrosShellQuote( ostr, map, c); }
|
||||||
{ return TexpandMacrosShellQuote( ostr, map, c ); }
|
QString expandMacros(const QString &ostr, const QHash<QString,QStringList> &map, QChar c)
|
||||||
QString expandMacros( const QString &ostr, const QHash<QString,QStringList> &map, QChar c )
|
{ return TexpandMacros(ostr, map, c); }
|
||||||
{ return TexpandMacros( ostr, map, c ); }
|
QString expandMacrosShellQuote(const QString &ostr, const QHash<QString,QStringList> &map, QChar c)
|
||||||
QString expandMacrosShellQuote( const QString &ostr, const QHash<QString,QStringList> &map, QChar c )
|
{ return TexpandMacrosShellQuote(ostr, map, c); }
|
||||||
{ return TexpandMacrosShellQuote( ostr, map, c ); }
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -317,7 +317,7 @@ namespace KMacroExpander {
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
KDECORE_EXPORT QString expandMacrosShellQuote(const QString &str, const QHash<QChar,QString> &map,
|
KDECORE_EXPORT QString expandMacrosShellQuote(const QString &str, const QHash<QChar,QString> &map,
|
||||||
QChar c = QLatin1Char('%') );
|
QChar c = QLatin1Char('%'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform safe macro expansion (substitution) on a string.
|
* Perform safe macro expansion (substitution) on a string.
|
||||||
|
|
Loading…
Add table
Reference in a new issue