Qt 4.8
Classes | Functions
qsequencegeneratingfns.cpp File Reference
#include <QStack>
#include <QStringList>
#include <QFileInfo>
#include "qanyuri_p.h"
#include "qboolean_p.h"
#include "qcommonsequencetypes_p.h"
#include "qcommonvalues_p.h"
#include "qemptysequence_p.h"
#include "qitemmappingiterator_p.h"
#include "qnodesort_p.h"
#include "qpatternistlocale_p.h"
#include "private/qxmlutils_p.h"
#include "qsequencegeneratingfns_p.h"

Go to the source code of this file.

Classes

class  StringSplitter
 Helper class for IdFN. More...
 

Functions

static QUrl resolveScheme (const QUrl &url)
 Attemps to resolve scheme if URL does not have scheme defined. More...
 

Function Documentation

◆ resolveScheme()

static QUrl resolveScheme ( const QUrl url)
static

Attemps to resolve scheme if URL does not have scheme defined.

Definition at line 214 of file qsequencegeneratingfns.cpp.

Referenced by QPatternist::DocAvailableFN::evaluateEBV(), and QPatternist::DocFN::evaluateSingleton().

215 {
216  // On Windows and Symbian the drive letter is detected as the scheme.
217  if (url.scheme().isEmpty() || (url.scheme().length() == 1)) {
218  QString filename = url.toString();
219  QFileInfo file(filename);
220  if (file.exists())
221  return QUrl::fromLocalFile(filename);
222  }
223  return url;
224 }
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
Definition: qurl.cpp:5896
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QString scheme() const
Returns the scheme of the URL.
Definition: qurl.cpp:4550
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
Definition: qurl.cpp:6374
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60