45 #include <QtCore/qbytearray.h> 46 #include <QtCore/qobjectdefs.h> 47 #include <QtCore/qpair.h> 48 #include <QtCore/qstring.h> 49 #include <QtCore/qhash.h> 74 RemoveUserInfo = RemovePassword | 0x4,
76 RemoveAuthority = RemoveUserInfo | RemovePort | 0x10,
79 RemoveFragment = 0x80,
82 StripTrailingSlash = 0x10000
87 #ifdef QT_NO_URL_CAST_FROM_STRING 95 #ifndef QT_NO_URL_CAST_FROM_STRING 98 #ifdef Q_COMPILER_RVALUE_REFS 100 {
qSwap(
d, other.d);
return *
this; }
106 void setUrl(
const QString &url);
113 bool isValid()
const;
119 void setScheme(
const QString &scheme);
122 void setAuthority(
const QString &authority);
125 void setUserInfo(
const QString &userInfo);
128 void setUserName(
const QString &userName);
130 void setEncodedUserName(
const QByteArray &userName);
133 void setPassword(
const QString &password);
135 void setEncodedPassword(
const QByteArray &password);
138 void setHost(
const QString &host);
143 void setPort(
int port);
145 int port(
int defaultPort)
const;
148 void setPath(
const QString &path);
153 bool hasQuery()
const;
155 void setEncodedQuery(
const QByteArray &query);
158 void setQueryDelimiters(
char valueDelimiter,
char pairDelimiter);
159 char queryValueDelimiter()
const;
160 char queryPairDelimiter()
const;
165 bool hasQueryItem(
const QString &key)
const;
168 void removeQueryItem(
const QString &key);
169 void removeAllQueryItems(
const QString &key);
174 bool hasEncodedQueryItem(
const QByteArray &key)
const;
177 void removeEncodedQueryItem(
const QByteArray &key);
178 void removeAllEncodedQueryItems(
const QByteArray &key);
180 void setFragment(
const QString &fragment);
182 void setEncodedFragment(
const QByteArray &fragment);
184 bool hasFragment()
const;
185 #ifndef QT_BOOTSTRAPPED 186 QString topLevelDomain()
const;
189 QUrl resolved(
const QUrl &relative)
const;
191 bool isRelative()
const;
192 bool isParentOf(
const QUrl &url)
const;
194 static QUrl fromLocalFile(
const QString &localfile);
196 bool isLocalFile()
const;
205 static QUrl fromUserInput(
const QString &userInput);
208 bool isDetached()
const;
225 #if defined QT3_SUPPORT 226 inline QT3_SUPPORT
QString protocol()
const {
return scheme(); }
227 inline QT3_SUPPORT
void setProtocol(
const QString &s) { setScheme(s); }
228 inline QT3_SUPPORT
void setUser(
const QString &s) { setUserName(s); }
229 inline QT3_SUPPORT
QString user()
const {
return userName(); }
230 inline QT3_SUPPORT
bool hasUser()
const {
return !userName().
isEmpty(); }
231 inline QT3_SUPPORT
bool hasPassword()
const {
return !password().
isEmpty(); }
232 inline QT3_SUPPORT
bool hasHost()
const {
return !host().
isEmpty(); }
233 inline QT3_SUPPORT
bool hasPort()
const {
return port() != -1; }
234 inline QT3_SUPPORT
bool hasPath()
const {
return !path().
isEmpty(); }
235 inline QT3_SUPPORT
void setQuery(
const QString &txt)
239 inline QT3_SUPPORT
QString query()
const 243 inline QT3_SUPPORT
QString ref()
const {
return fragment(); }
244 inline QT3_SUPPORT
void setRef(
const QString &txt) { setFragment(txt); }
245 inline QT3_SUPPORT
bool hasRef()
const {
return !fragment().
isEmpty(); }
246 inline QT3_SUPPORT
void addPath(
const QString &p) { setPath(path() +
QLatin1Char(
'/') + p); }
247 QT3_SUPPORT
void setFileName(
const QString &txt);
249 QT3_SUPPORT
QString dirPath()
const;
250 static inline QT3_SUPPORT
void decode(
QString &url)
254 static inline QT3_SUPPORT
void encode(
QString &url)
259 inline QT3_SUPPORT
bool cdUp()
264 static inline QT3_SUPPORT
bool isRelativeUrl(
const QString &url)
273 #if defined (QT3_SUPPORT) 294 #ifndef QT_NO_DATASTREAM 299 #ifndef QT_NO_DEBUG_STREAM The QDebug class provides an output stream for debugging information.
static QString fromPercentEncoding(const QByteArray &)
Returns a decoded copy of input.
static QByteArray toPercentEncoding(const QString &, const QByteArray &exclude=QByteArray(), const QByteArray &include=QByteArray())
Returns an encoded copy of input.
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QUrl &)
#define QT_END_NAMESPACE
This macro expands to.
uint qHash(const QUrl &url)
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
The QByteArray class provides an array of bytes.
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
static void clear(QVariant::Private *d)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool operator!=(QBool b1, bool b2)
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QUrl &)
bool operator<(int priority, const QPair< QRunnable *, int > &p)
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
#define Q_DECLARE_SHARED(TYPE)
void swap(QUrl &other)
Swaps URL other with this URL.
static QString toString(Register *reg, int type, bool *ok=0)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
The QStringList class provides a list of strings.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
FormattingOption
The formatting options define how the URL is formatted when written out as text.
void qSwap(T &value1, T &value2)
QByteArray toEncoded(FormattingOptions options=None) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QDataStream class provides serialization of binary data to a QIODevice.
ParsingMode
The parsing mode controls the way QUrl parses strings.
static QString fileName(const QString &fileUrl)
bool operator==(QBool b1, bool b2)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
The QList class is a template class that provides lists.