16 #ifndef QGSPATHRESOLVER_H
17 #define QGSPATHRESOLVER_H
19 #include "qgis_core.h"
42 QString writePath(
const QString &filename )
const;
45 QString readPath(
const QString &filename )
const;
67 static QString setPathPreprocessor(
const std::function< QString(
const QString &filename )> &processor );
112 static QString setPathPreprocessor( SIP_PYCALLABLE / AllowNone / );
115 Py_BEGIN_ALLOW_THREADS
121 PyObject *s = sipCallMethod( NULL, a0,
"D", &arg, sipType_QString, NULL );
124 QString *t1 =
reinterpret_cast<QString *
>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
125 if ( sipIsError == 0 )
127 res = QString( *t1 );
129 sipReleaseType( t1, sipType_QString, state );
134 s = sipConvertFromNewType(
new QString(
id ), sipType_QString, 0 );
152 static bool removePathPreprocessor(
const QString &
id );
164 static void removePathPreprocessor(
const QString &
id );
168 PyErr_SetString( PyExc_KeyError, QStringLiteral(
"No processor with id %1 exists." ).arg( *a0 ).toUtf8().constData() );
176 QString mBaseFileName;
Resolves relative paths into absolute paths and vice versa.
static bool removePathPreprocessor(const QString &id)
Removes the custom pre-processor function with matching id.
static QString setPathPreprocessor(const std::function< QString(const QString &filename)> &processor)
Sets a path pre-processor function, which allows for manipulation of paths and data sources prior to ...