| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). |
| 4 | ** Contact: http://www.qt-project.org/legal |
| 5 | ** |
| 6 | ** This file is part of the QtNetwork module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and Digia. For licensing terms and |
| 14 | ** conditions see http://qt.digia.com/licensing. For further information |
| 15 | ** use the contact form at http://qt.digia.com/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 2.1 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements |
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
| 24 | ** |
| 25 | ** In addition, as a special exception, Digia gives you certain additional |
| 26 | ** rights. These rights are described in the Digia Qt LGPL Exception |
| 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
| 28 | ** |
| 29 | ** GNU General Public License Usage |
| 30 | ** Alternatively, this file may be used under the terms of the GNU |
| 31 | ** General Public License version 3.0 as published by the Free Software |
| 32 | ** Foundation and appearing in the file LICENSE.GPL included in the |
| 33 | ** packaging of this file. Please review the following information to |
| 34 | ** ensure the GNU General Public License version 3.0 requirements will be |
| 35 | ** met: http://www.gnu.org/copyleft/gpl.html. |
| 36 | ** |
| 37 | ** |
| 38 | ** $QT_END_LICENSE$ |
| 39 | ** |
| 40 | ****************************************************************************/ |
| 41 | |
| 42 | #include "qurlinfo.h"cxx . . $ `<file>/src/qurlinfo.h`/ |
| 43 | |
| 44 | #include "qurl.h" |
| 45 | #include "qdir.h" |
| 46 | #include "limits.h" |
| 47 | |
| 48 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 49 | |
| 50 | class QUrlInfoPrivatecxx . . $ QUrlInfoPrivate# |
| 51 | { |
| 52 | public: |
| 53 | QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).() : |
| 54 | permissionscxx . . $ QUrlInfoPrivate#permissions.(0), |
| 55 | sizecxx . . $ QUrlInfoPrivate#size.(0), |
| 56 | isDircxx . . $ QUrlInfoPrivate#isDir.(false), |
| 57 | isFilecxx . . $ QUrlInfoPrivate#isFile.(true), |
| 58 | isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink.(false), |
| 59 | isWritablecxx . . $ QUrlInfoPrivate#isWritable.(true), |
| 60 | isReadablecxx . . $ QUrlInfoPrivate#isReadable.(true), |
| 61 | isExecutablecxx . . $ QUrlInfoPrivate#isExecutable.(false) |
| 62 | {} |
| 63 | |
| 64 | QStringcxx . . $ QString# namecxx . . $ QUrlInfoPrivate#name.; |
| 65 | int permissionscxx . . $ QUrlInfoPrivate#permissions.; |
| 66 | QStringcxx . . $ QString# ownercxx . . $ QUrlInfoPrivate#owner.; |
| 67 | QStringcxx . . $ QString# groupcxx . . $ QUrlInfoPrivate#group.; |
| 68 | qint64cxx . . $ qint64# sizecxx . . $ QUrlInfoPrivate#size.; |
| 69 | |
| 70 | QDateTimecxx . . $ QDateTime# lastModifiedcxx . . $ QUrlInfoPrivate#lastModified.; |
| 71 | QDateTimecxx . . $ QDateTime# lastReadcxx . . $ QUrlInfoPrivate#lastRead.; |
| 72 | bool isDircxx . . $ QUrlInfoPrivate#isDir.; |
| 73 | bool isFilecxx . . $ QUrlInfoPrivate#isFile.; |
| 74 | bool isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink.; |
| 75 | bool isWritablecxx . . $ QUrlInfoPrivate#isWritable.; |
| 76 | bool isReadablecxx . . $ QUrlInfoPrivate#isReadable.; |
| 77 | bool isExecutablecxx . . $ QUrlInfoPrivate#isExecutable.; |
| 78 | }; |
| 79 | |
| 80 | |
| 81 | /*! |
| 82 | \class QUrlInfo |
| 83 | \brief The QUrlInfo class stores information about URLs. |
| 84 | |
| 85 | \ingroup io |
| 86 | \ingroup network |
| 87 | \inmodule QtNetwork |
| 88 | |
| 89 | The information about a URL that can be retrieved includes name(), |
| 90 | permissions(), owner(), group(), size(), lastModified(), |
| 91 | lastRead(), isDir(), isFile(), isSymLink(), isWritable(), |
| 92 | isReadable() and isExecutable(). |
| 93 | |
| 94 | You can create your own QUrlInfo objects passing in all the |
| 95 | relevant information in the constructor, and you can modify a |
| 96 | QUrlInfo; for each getter mentioned above there is an equivalent |
| 97 | setter. Note that setting values does not affect the underlying |
| 98 | resource that the QUrlInfo provides information about; for example |
| 99 | if you call setWritable(true) on a read-only resource the only |
| 100 | thing changed is the QUrlInfo object, not the resource. |
| 101 | |
| 102 | \sa QUrl, {FTP Example} |
| 103 | */ |
| 104 | |
| 105 | /*! |
| 106 | \enum QUrlInfo::PermissionSpec |
| 107 | |
| 108 | This enum is used by the permissions() function to report the |
| 109 | permissions of a file. |
| 110 | |
| 111 | \value ReadOwner The file is readable by the owner of the file. |
| 112 | \value WriteOwner The file is writable by the owner of the file. |
| 113 | \value ExeOwner The file is executable by the owner of the file. |
| 114 | \value ReadGroup The file is readable by the group. |
| 115 | \value WriteGroup The file is writable by the group. |
| 116 | \value ExeGroup The file is executable by the group. |
| 117 | \value ReadOther The file is readable by anyone. |
| 118 | \value WriteOther The file is writable by anyone. |
| 119 | \value ExeOther The file is executable by anyone. |
| 120 | */ |
| 121 | |
| 122 | /*! |
| 123 | Constructs an invalid QUrlInfo object with default values. |
| 124 | |
| 125 | \sa isValid() |
| 126 | */ |
| 127 | |
| 128 | QUrlInfocxx . . $ QUrlInfo#::QUrlInfocxx . . $ QUrlInfo#QUrlInfo(49f6e7a06ebc5aa8).() |
| 129 | { |
| 130 | dcxx . . $ QUrlInfo#d. = 0; |
| 131 | } |
| 132 | |
| 133 | /*! |
| 134 | Copy constructor, copies \a ui to this URL info object. |
| 135 | */ |
| 136 | |
| 137 | QUrlInfocxx . . $ QUrlInfo#::QUrlInfocxx . . $ QUrlInfo#QUrlInfo(ed216b1bc01b0eea).(const QUrlInfocxx . . $ QUrlInfo# &ui) |
| 138 | { |
| 139 | if (ui.dcxx . . $ QUrlInfo#d.) { |
| 140 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 141 | *dcxx . . $ QUrlInfo#d. =cxx . . $ QUrlInfoPrivate#`operator=`(eaf6d3f23f12ecc7). *ui.dcxx . . $ QUrlInfo#d.; |
| 142 | } else { |
| 143 | dcxx . . $ QUrlInfo#d. = 0; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | /*! |
| 148 | Constructs a QUrlInfo object by specifying all the URL's |
| 149 | information. |
| 150 | |
| 151 | The information that is passed is the \a name, file \a |
| 152 | permissions, \a owner and \a group and the file's \a size. Also |
| 153 | passed is the \a lastModified date/time and the \a lastRead |
| 154 | date/time. Flags are also passed, specifically, \a isDir, \a |
| 155 | isFile, \a isSymLink, \a isWritable, \a isReadable and \a |
| 156 | isExecutable. |
| 157 | */ |
| 158 | |
| 159 | QUrlInfocxx . . $ QUrlInfo#::QUrlInfocxx . . $ QUrlInfo#QUrlInfo(61783fdb3df82e7e).(const QStringcxx . . $ QString# &name, int permissions, const QStringcxx . . $ QString# &owner, |
| 160 | const QStringcxx . . $ QString# &group, qint64cxx . . $ qint64# size, const QDateTimecxx . . $ QDateTime# &lastModified, |
| 161 | const QDateTimecxx . . $ QDateTime# &lastRead, bool isDir, bool isFile, bool isSymLink, |
| 162 | bool isWritable, bool isReadable, bool isExecutable) |
| 163 | { |
| 164 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 165 | dcxx . . $ QUrlInfo#d.->namecxx . . $ QUrlInfoPrivate#name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). name; |
| 166 | dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions. = permissions; |
| 167 | dcxx . . $ QUrlInfo#d.->ownercxx . . $ QUrlInfoPrivate#owner. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). owner; |
| 168 | dcxx . . $ QUrlInfo#d.->groupcxx . . $ QUrlInfoPrivate#group. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). group; |
| 169 | dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size. = size; |
| 170 | dcxx . . $ QUrlInfo#d.->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). lastModified; |
| 171 | dcxx . . $ QUrlInfo#d.->lastReadcxx . . $ QUrlInfoPrivate#lastRead. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). lastRead; |
| 172 | dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir. = isDir; |
| 173 | dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile. = isFile; |
| 174 | dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink. = isSymLink; |
| 175 | dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable. = isWritable; |
| 176 | dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable. = isReadable; |
| 177 | dcxx . . $ QUrlInfo#d.->isExecutablecxx . . $ QUrlInfoPrivate#isExecutable. = isExecutable; |
| 178 | } |
| 179 | |
| 180 | |
| 181 | /*! |
| 182 | Constructs a QUrlInfo object by specifying all the URL's |
| 183 | information. |
| 184 | |
| 185 | The information that is passed is the \a url, file \a |
| 186 | permissions, \a owner and \a group and the file's \a size. Also |
| 187 | passed is the \a lastModified date/time and the \a lastRead |
| 188 | date/time. Flags are also passed, specifically, \a isDir, \a |
| 189 | isFile, \a isSymLink, \a isWritable, \a isReadable and \a |
| 190 | isExecutable. |
| 191 | */ |
| 192 | |
| 193 | QUrlInfocxx . . $ QUrlInfo#::QUrlInfocxx . . $ QUrlInfo#QUrlInfo(73cb98864710cde6).(const QUrlcxx . . $ QUrl# &url, int permissions, const QStringcxx . . $ QString# &owner, |
| 194 | const QStringcxx . . $ QString# &group, qint64cxx . . $ qint64# size, const QDateTimecxx . . $ QDateTime# &lastModified, |
| 195 | const QDateTimecxx . . $ QDateTime# &lastRead, bool isDir, bool isFile, bool isSymLink, |
| 196 | bool isWritable, bool isReadable, bool isExecutable) |
| 197 | { |
| 198 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 199 | dcxx . . $ QUrlInfo#d.->namecxx . . $ QUrlInfoPrivate#name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QFileInfocxx . . $ QFileInfo#(url.pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).()).fileNamecxx . . $ QFileInfo#fileName(6ef7b6c27b00b43d).(); |
| 200 | dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions. = permissions; |
| 201 | dcxx . . $ QUrlInfo#d.->ownercxx . . $ QUrlInfoPrivate#owner. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). owner; |
| 202 | dcxx . . $ QUrlInfo#d.->groupcxx . . $ QUrlInfoPrivate#group. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). group; |
| 203 | dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size. = size; |
| 204 | dcxx . . $ QUrlInfo#d.->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). lastModified; |
| 205 | dcxx . . $ QUrlInfo#d.->lastReadcxx . . $ QUrlInfoPrivate#lastRead. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). lastRead; |
| 206 | dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir. = isDir; |
| 207 | dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile. = isFile; |
| 208 | dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink. = isSymLink; |
| 209 | dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable. = isWritable; |
| 210 | dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable. = isReadable; |
| 211 | dcxx . . $ QUrlInfo#d.->isExecutablecxx . . $ QUrlInfoPrivate#isExecutable. = isExecutable; |
| 212 | } |
| 213 | |
| 214 | |
| 215 | /*! |
| 216 | Sets the name of the URL to \a name. The name is the full text, |
| 217 | for example, "http://qt.nokia.com/doc/qurlinfo.html". |
| 218 | |
| 219 | If you call this function for an invalid URL info, this function |
| 220 | turns it into a valid one. |
| 221 | |
| 222 | \sa isValid() |
| 223 | */ |
| 224 | |
| 225 | void QUrlInfocxx . . $ QUrlInfo#::setNamecxx . . $ QUrlInfo#setName(3520e46b33348bf6).(const QStringcxx . . $ QString# &name) |
| 226 | { |
| 227 | if (!dcxx . . $ QUrlInfo#d.) |
| 228 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 229 | dcxx . . $ QUrlInfo#d.->namecxx . . $ QUrlInfoPrivate#name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). name; |
| 230 | } |
| 231 | |
| 232 | |
| 233 | /*! |
| 234 | If \a b is true then the URL is set to be a directory; if \a b is |
| 235 | false then the URL is set not to be a directory (which normally |
| 236 | means it is a file). (Note that a URL can refer to both a file and |
| 237 | a directory even though most file systems do not support this.) |
| 238 | |
| 239 | If you call this function for an invalid URL info, this function |
| 240 | turns it into a valid one. |
| 241 | |
| 242 | \sa isValid() |
| 243 | */ |
| 244 | |
| 245 | void QUrlInfocxx . . $ QUrlInfo#::setDircxx . . $ QUrlInfo#setDir(b45ddcbc8423892c).(bool b) |
| 246 | { |
| 247 | if (!dcxx . . $ QUrlInfo#d.) |
| 248 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 249 | dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir. = b; |
| 250 | } |
| 251 | |
| 252 | |
| 253 | /*! |
| 254 | If \a b is true then the URL is set to be a file; if \b is false |
| 255 | then the URL is set not to be a file (which normally means it is a |
| 256 | directory). (Note that a URL can refer to both a file and a |
| 257 | directory even though most file systems do not support this.) |
| 258 | |
| 259 | If you call this function for an invalid URL info, this function |
| 260 | turns it into a valid one. |
| 261 | |
| 262 | \sa isValid() |
| 263 | */ |
| 264 | |
| 265 | void QUrlInfocxx . . $ QUrlInfo#::setFilecxx . . $ QUrlInfo#setFile(b45ddcbc8423892c).(bool b) |
| 266 | { |
| 267 | if (!dcxx . . $ QUrlInfo#d.) |
| 268 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 269 | dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile. = b; |
| 270 | } |
| 271 | |
| 272 | |
| 273 | /*! |
| 274 | Specifies that the URL refers to a symbolic link if \a b is true |
| 275 | and that it does not if \a b is false. |
| 276 | |
| 277 | If you call this function for an invalid URL info, this function |
| 278 | turns it into a valid one. |
| 279 | |
| 280 | \sa isValid() |
| 281 | */ |
| 282 | |
| 283 | void QUrlInfocxx . . $ QUrlInfo#::setSymLinkcxx . . $ QUrlInfo#setSymLink(b45ddcbc8423892c).(bool b) |
| 284 | { |
| 285 | if (!dcxx . . $ QUrlInfo#d.) |
| 286 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 287 | dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink. = b; |
| 288 | } |
| 289 | |
| 290 | |
| 291 | /*! |
| 292 | Specifies that the URL is writable if \a b is true and not |
| 293 | writable if \a b is false. |
| 294 | |
| 295 | If you call this function for an invalid URL info, this function |
| 296 | turns it into a valid one. |
| 297 | |
| 298 | \sa isValid() |
| 299 | */ |
| 300 | |
| 301 | void QUrlInfocxx . . $ QUrlInfo#::setWritablecxx . . $ QUrlInfo#setWritable(b45ddcbc8423892c).(bool b) |
| 302 | { |
| 303 | if (!dcxx . . $ QUrlInfo#d.) |
| 304 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 305 | dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable. = b; |
| 306 | } |
| 307 | |
| 308 | |
| 309 | /*! |
| 310 | Specifies that the URL is readable if \a b is true and not |
| 311 | readable if \a b is false. |
| 312 | |
| 313 | If you call this function for an invalid URL info, this function |
| 314 | turns it into a valid one. |
| 315 | |
| 316 | \sa isValid() |
| 317 | */ |
| 318 | |
| 319 | void QUrlInfocxx . . $ QUrlInfo#::setReadablecxx . . $ QUrlInfo#setReadable(b45ddcbc8423892c).(bool b) |
| 320 | { |
| 321 | if (!dcxx . . $ QUrlInfo#d.) |
| 322 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 323 | dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable. = b; |
| 324 | } |
| 325 | |
| 326 | /*! |
| 327 | Specifies that the owner of the URL is called \a s. |
| 328 | |
| 329 | If you call this function for an invalid URL info, this function |
| 330 | turns it into a valid one. |
| 331 | |
| 332 | \sa isValid() |
| 333 | */ |
| 334 | |
| 335 | void QUrlInfocxx . . $ QUrlInfo#::setOwnercxx . . $ QUrlInfo#setOwner(3520e46b33348bf6).(const QStringcxx . . $ QString# &s) |
| 336 | { |
| 337 | if (!dcxx . . $ QUrlInfo#d.) |
| 338 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 339 | dcxx . . $ QUrlInfo#d.->ownercxx . . $ QUrlInfoPrivate#owner. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s; |
| 340 | } |
| 341 | |
| 342 | /*! |
| 343 | Specifies that the owning group of the URL is called \a s. |
| 344 | |
| 345 | If you call this function for an invalid URL info, this function |
| 346 | turns it into a valid one. |
| 347 | |
| 348 | \sa isValid() |
| 349 | */ |
| 350 | |
| 351 | void QUrlInfocxx . . $ QUrlInfo#::setGroupcxx . . $ QUrlInfo#setGroup(3520e46b33348bf6).(const QStringcxx . . $ QString# &s) |
| 352 | { |
| 353 | if (!dcxx . . $ QUrlInfo#d.) |
| 354 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 355 | dcxx . . $ QUrlInfo#d.->groupcxx . . $ QUrlInfoPrivate#group. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s; |
| 356 | } |
| 357 | |
| 358 | /*! |
| 359 | Specifies the \a size of the URL. |
| 360 | |
| 361 | If you call this function for an invalid URL info, this function |
| 362 | turns it into a valid one. |
| 363 | |
| 364 | \sa isValid() |
| 365 | */ |
| 366 | |
| 367 | void QUrlInfocxx . . $ QUrlInfo#::setSizecxx . . $ QUrlInfo#setSize(35cb52607f6af42f).(qint64cxx . . $ qint64# size) |
| 368 | { |
| 369 | if (!dcxx . . $ QUrlInfo#d.) |
| 370 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 371 | dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size. = size; |
| 372 | } |
| 373 | |
| 374 | /*! |
| 375 | Specifies that the URL has access permissions \a p. |
| 376 | |
| 377 | If you call this function for an invalid URL info, this function |
| 378 | turns it into a valid one. |
| 379 | |
| 380 | \sa isValid() |
| 381 | */ |
| 382 | |
| 383 | void QUrlInfocxx . . $ QUrlInfo#::setPermissionscxx . . $ QUrlInfo#setPermissions(d4f767463ce0a6b3).(int p) |
| 384 | { |
| 385 | if (!dcxx . . $ QUrlInfo#d.) |
| 386 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 387 | dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions. = p; |
| 388 | } |
| 389 | |
| 390 | /*! |
| 391 | Specifies that the object the URL refers to was last modified at |
| 392 | \a dt. |
| 393 | |
| 394 | If you call this function for an invalid URL info, this function |
| 395 | turns it into a valid one. |
| 396 | |
| 397 | \sa isValid() |
| 398 | */ |
| 399 | |
| 400 | void QUrlInfocxx . . $ QUrlInfo#::setLastModifiedcxx . . $ QUrlInfo#setLastModified(3672ecc950120406).(const QDateTimecxx . . $ QDateTime# &dt) |
| 401 | { |
| 402 | if (!dcxx . . $ QUrlInfo#d.) |
| 403 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 404 | dcxx . . $ QUrlInfo#d.->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). dt; |
| 405 | } |
| 406 | |
| 407 | /*! |
| 408 | \since 4.4 |
| 409 | |
| 410 | Specifies that the object the URL refers to was last read at |
| 411 | \a dt. |
| 412 | |
| 413 | If you call this function for an invalid URL info, this function |
| 414 | turns it into a valid one. |
| 415 | |
| 416 | \sa isValid() |
| 417 | */ |
| 418 | |
| 419 | void QUrlInfocxx . . $ QUrlInfo#::setLastReadcxx . . $ QUrlInfo#setLastRead(3672ecc950120406).(const QDateTimecxx . . $ QDateTime# &dt) |
| 420 | { |
| 421 | if (!dcxx . . $ QUrlInfo#d.) |
| 422 | dcxx . . $ QUrlInfo#d. = new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 423 | dcxx . . $ QUrlInfo#d.->lastReadcxx . . $ QUrlInfoPrivate#lastRead. =cxx . . $ QDateTime#`operator=`(c9ee2a3e4c661ab0). dt; |
| 424 | } |
| 425 | |
| 426 | /*! |
| 427 | Destroys the URL info object. |
| 428 | */ |
| 429 | |
| 430 | QUrlInfocxx . . $ QUrlInfo#::~cxx . . $ QUrlInfo#`~QUrlInfo`(ced63f7c635d850d).QUrlInfocxx . . $ QUrlInfo#() |
| 431 | { |
| 432 | delete dcxx . . $ QUrlInfo#d.; |
| 433 | } |
| 434 | |
| 435 | /*! |
| 436 | Assigns the values of \a ui to this QUrlInfo object. |
| 437 | */ |
| 438 | |
| 439 | QUrlInfocxx . . $ QUrlInfo# &QUrlInfocxx . . $ QUrlInfo#::operatorcxx . . $ QUrlInfo#`operator=`(7113a6b264a23c52).=(const QUrlInfocxx . . $ QUrlInfo# &ui) |
| 440 | { |
| 441 | if (ui.dcxx . . $ QUrlInfo#d.) { |
| 442 | if (!dcxx . . $ QUrlInfo#d.) |
| 443 | dcxx . . $ QUrlInfo#d.= new QUrlInfoPrivatecxx . . $ QUrlInfoPrivate#QUrlInfoPrivate(49f6e7a06ebc5aa8).; |
| 444 | *dcxx . . $ QUrlInfo#d. =cxx . . $ QUrlInfoPrivate#`operator=`(eaf6d3f23f12ecc7). *ui.dcxx . . $ QUrlInfo#d.; |
| 445 | } else { |
| 446 | delete dcxx . . $ QUrlInfo#d.; |
| 447 | dcxx . . $ QUrlInfo#d. = 0; |
| 448 | } |
| 449 | return *this; |
| 450 | } |
| 451 | |
| 452 | /*! |
| 453 | Returns the file name of the URL. |
| 454 | |
| 455 | \sa isValid() |
| 456 | */ |
| 457 | |
| 458 | QStringcxx . . $ QString# QUrlInfocxx . . $ QUrlInfo#::namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).() const |
| 459 | { |
| 460 | if (!dcxx . . $ QUrlInfo#d.) |
| 461 | return QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 462 | return dcxx . . $ QString#QString(132dd6869045752b).->namecxx . . $ QUrlInfoPrivate#name.; |
| 463 | } |
| 464 | |
| 465 | /*! |
| 466 | Returns the permissions of the URL. You can use the \c PermissionSpec flags |
| 467 | to test for certain permissions. |
| 468 | |
| 469 | \sa isValid() |
| 470 | */ |
| 471 | |
| 472 | int QUrlInfocxx . . $ QUrlInfo#::permissionscxx . . $ QUrlInfo#permissions(455f465bc33b4cdf).() const |
| 473 | { |
| 474 | if (!dcxx . . $ QUrlInfo#d.) |
| 475 | return 0; |
| 476 | return dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions.; |
| 477 | } |
| 478 | |
| 479 | /*! |
| 480 | Returns the owner of the URL. |
| 481 | |
| 482 | \sa isValid() |
| 483 | */ |
| 484 | |
| 485 | QStringcxx . . $ QString# QUrlInfocxx . . $ QUrlInfo#::ownercxx . . $ QUrlInfo#owner(6ef7b6c27b00b43d).() const |
| 486 | { |
| 487 | if (!dcxx . . $ QUrlInfo#d.) |
| 488 | return QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 489 | return dcxx . . $ QString#QString(132dd6869045752b).->ownercxx . . $ QUrlInfoPrivate#owner.; |
| 490 | } |
| 491 | |
| 492 | /*! |
| 493 | Returns the group of the URL. |
| 494 | |
| 495 | \sa isValid() |
| 496 | */ |
| 497 | |
| 498 | QStringcxx . . $ QString# QUrlInfocxx . . $ QUrlInfo#::groupcxx . . $ QUrlInfo#group(6ef7b6c27b00b43d).() const |
| 499 | { |
| 500 | if (!dcxx . . $ QUrlInfo#d.) |
| 501 | return QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 502 | return dcxx . . $ QString#QString(132dd6869045752b).->groupcxx . . $ QUrlInfoPrivate#group.; |
| 503 | } |
| 504 | |
| 505 | /*! |
| 506 | Returns the size of the URL. |
| 507 | |
| 508 | \sa isValid() |
| 509 | */ |
| 510 | |
| 511 | qint64cxx . . $ qint64# QUrlInfocxx . . $ QUrlInfo#::sizecxx . . $ QUrlInfo#size(98833e9ab7de59a4).() const |
| 512 | { |
| 513 | if (!dcxx . . $ QUrlInfo#d.) |
| 514 | return 0; |
| 515 | return dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size.; |
| 516 | } |
| 517 | |
| 518 | /*! |
| 519 | Returns the last modification date of the URL. |
| 520 | |
| 521 | \sa isValid() |
| 522 | */ |
| 523 | |
| 524 | QDateTimecxx . . $ QDateTime# QUrlInfocxx . . $ QUrlInfo#::lastModifiedcxx . . $ QUrlInfo#lastModified(4e062b5c490497ac).() const |
| 525 | { |
| 526 | if (!dcxx . . $ QUrlInfo#d.) |
| 527 | return QDateTimecxx . . $ QDateTime#QDateTime(ced63f7c635d850d).(); |
| 528 | return dcxx . . $ QDateTime#QDateTime(5da15eb5af6b9895).->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified.; |
| 529 | } |
| 530 | |
| 531 | /*! |
| 532 | Returns the date when the URL was last read. |
| 533 | |
| 534 | \sa isValid() |
| 535 | */ |
| 536 | |
| 537 | QDateTimecxx . . $ QDateTime# QUrlInfocxx . . $ QUrlInfo#::lastReadcxx . . $ QUrlInfo#lastRead(4e062b5c490497ac).() const |
| 538 | { |
| 539 | if (!dcxx . . $ QUrlInfo#d.) |
| 540 | return QDateTimecxx . . $ QDateTime#QDateTime(ced63f7c635d850d).(); |
| 541 | return dcxx . . $ QDateTime#QDateTime(5da15eb5af6b9895).->lastReadcxx . . $ QUrlInfoPrivate#lastRead.; |
| 542 | } |
| 543 | |
| 544 | /*! |
| 545 | Returns true if the URL is a directory; otherwise returns false. |
| 546 | |
| 547 | \sa isValid() |
| 548 | */ |
| 549 | |
| 550 | bool QUrlInfocxx . . $ QUrlInfo#::isDircxx . . $ QUrlInfo#isDir(50ce9a9e25b4a850).() const |
| 551 | { |
| 552 | if (!dcxx . . $ QUrlInfo#d.) |
| 553 | return false; |
| 554 | return dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir.; |
| 555 | } |
| 556 | |
| 557 | /*! |
| 558 | Returns true if the URL is a file; otherwise returns false. |
| 559 | |
| 560 | \sa isValid() |
| 561 | */ |
| 562 | |
| 563 | bool QUrlInfocxx . . $ QUrlInfo#::isFilecxx . . $ QUrlInfo#isFile(50ce9a9e25b4a850).() const |
| 564 | { |
| 565 | if (!dcxx . . $ QUrlInfo#d.) |
| 566 | return false; |
| 567 | return dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile.; |
| 568 | } |
| 569 | |
| 570 | /*! |
| 571 | Returns true if the URL is a symbolic link; otherwise returns false. |
| 572 | |
| 573 | \sa isValid() |
| 574 | */ |
| 575 | |
| 576 | bool QUrlInfocxx . . $ QUrlInfo#::isSymLinkcxx . . $ QUrlInfo#isSymLink(50ce9a9e25b4a850).() const |
| 577 | { |
| 578 | if (!dcxx . . $ QUrlInfo#d.) |
| 579 | return false; |
| 580 | return dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink.; |
| 581 | } |
| 582 | |
| 583 | /*! |
| 584 | Returns true if the URL is writable; otherwise returns false. |
| 585 | |
| 586 | \sa isValid() |
| 587 | */ |
| 588 | |
| 589 | bool QUrlInfocxx . . $ QUrlInfo#::isWritablecxx . . $ QUrlInfo#isWritable(50ce9a9e25b4a850).() const |
| 590 | { |
| 591 | if (!dcxx . . $ QUrlInfo#d.) |
| 592 | return false; |
| 593 | return dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable.; |
| 594 | } |
| 595 | |
| 596 | /*! |
| 597 | Returns true if the URL is readable; otherwise returns false. |
| 598 | |
| 599 | \sa isValid() |
| 600 | */ |
| 601 | |
| 602 | bool QUrlInfocxx . . $ QUrlInfo#::isReadablecxx . . $ QUrlInfo#isReadable(50ce9a9e25b4a850).() const |
| 603 | { |
| 604 | if (!dcxx . . $ QUrlInfo#d.) |
| 605 | return false; |
| 606 | return dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable.; |
| 607 | } |
| 608 | |
| 609 | /*! |
| 610 | Returns true if the URL is executable; otherwise returns false. |
| 611 | |
| 612 | \sa isValid() |
| 613 | */ |
| 614 | |
| 615 | bool QUrlInfocxx . . $ QUrlInfo#::isExecutablecxx . . $ QUrlInfo#isExecutable(50ce9a9e25b4a850).() const |
| 616 | { |
| 617 | if (!dcxx . . $ QUrlInfo#d.) |
| 618 | return false; |
| 619 | return dcxx . . $ QUrlInfo#d.->isExecutablecxx . . $ QUrlInfoPrivate#isExecutable.; |
| 620 | } |
| 621 | |
| 622 | /*! |
| 623 | Returns true if \a i1 is greater than \a i2; otherwise returns |
| 624 | false. The objects are compared by the value, which is specified |
| 625 | by \a sortBy. This must be one of QDir::Name, QDir::Time or |
| 626 | QDir::Size. |
| 627 | */ |
| 628 | |
| 629 | bool QUrlInfocxx . . $ QUrlInfo#::greaterThancxx . . $ QUrlInfo#greaterThan(ca79cdb475f4efb9).(const QUrlInfocxx . . $ QUrlInfo# &i1, const QUrlInfocxx . . $ QUrlInfo# &i2, |
| 630 | int sortBy) |
| 631 | { |
| 632 | switch (sortBy) { |
| 633 | case QDircxx . . $ QDir#::Namecxx . . $ QDir#Name.: |
| 634 | return i1.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).() >cxx . . $ `operator>`(5bc2975d2d751687). i2.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).(); |
| 635 | case QDircxx . . $ QDir#::Timecxx . . $ QDir#Time.: |
| 636 | return i1.lastModifiedcxx . . $ QUrlInfo#lastModified(4e062b5c490497ac).() >cxx . . $ QDateTime#`operator>`(147858620bc979f5). i2.lastModifiedcxx . . $ QUrlInfo#lastModified(4e062b5c490497ac).(); |
| 637 | case QDircxx . . $ QDir#::Sizecxx . . $ QDir#Size.: |
| 638 | return i1.sizecxx . . $ QUrlInfo#size(98833e9ab7de59a4).() > i2.sizecxx . . $ QUrlInfo#size(98833e9ab7de59a4).(); |
| 639 | default: |
| 640 | return false; |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | /*! |
| 645 | Returns true if \a i1 is less than \a i2; otherwise returns false. |
| 646 | The objects are compared by the value, which is specified by \a |
| 647 | sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size. |
| 648 | */ |
| 649 | |
| 650 | bool QUrlInfocxx . . $ QUrlInfo#::lessThancxx . . $ QUrlInfo#lessThan(ca79cdb475f4efb9).(const QUrlInfocxx . . $ QUrlInfo# &i1, const QUrlInfocxx . . $ QUrlInfo# &i2, |
| 651 | int sortBy) |
| 652 | { |
| 653 | return !greaterThancxx . . $ QUrlInfo#greaterThan(ca79cdb475f4efb9).(i1, i2, sortBy); |
| 654 | } |
| 655 | |
| 656 | /*! |
| 657 | Returns true if \a i1 equals to \a i2; otherwise returns false. |
| 658 | The objects are compared by the value, which is specified by \a |
| 659 | sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size. |
| 660 | */ |
| 661 | |
| 662 | bool QUrlInfocxx . . $ QUrlInfo#::equalcxx . . $ QUrlInfo#equal(ca79cdb475f4efb9).(const QUrlInfocxx . . $ QUrlInfo# &i1, const QUrlInfocxx . . $ QUrlInfo# &i2, |
| 663 | int sortBy) |
| 664 | { |
| 665 | switch (sortBy) { |
| 666 | case QDircxx . . $ QDir#::Namecxx . . $ QDir#Name.: |
| 667 | return i1.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).() ==cxx . . $ `operator==`(5bc2975d2d751687). i2.namecxx . . $ QUrlInfo#name(6ef7b6c27b00b43d).(); |
| 668 | case QDircxx . . $ QDir#::Timecxx . . $ QDir#Time.: |
| 669 | return i1.lastModifiedcxx . . $ QUrlInfo#lastModified(4e062b5c490497ac).() ==cxx . . $ QDateTime#`operator==`(147858620bc979f5). i2.lastModifiedcxx . . $ QUrlInfo#lastModified(4e062b5c490497ac).(); |
| 670 | case QDircxx . . $ QDir#::Sizecxx . . $ QDir#Size.: |
| 671 | return i1.sizecxx . . $ QUrlInfo#size(98833e9ab7de59a4).() == i2.sizecxx . . $ QUrlInfo#size(98833e9ab7de59a4).(); |
| 672 | default: |
| 673 | return false; |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | /*! |
| 678 | Returns true if this QUrlInfo is equal to \a other; otherwise |
| 679 | returns false. |
| 680 | |
| 681 | \sa lessThan(), equal() |
| 682 | */ |
| 683 | |
| 684 | bool QUrlInfocxx . . $ QUrlInfo#::operatorcxx . . $ QUrlInfo#`operator==`(db16b59c5a189d6d).==(const QUrlInfocxx . . $ QUrlInfo# &other) const |
| 685 | { |
| 686 | if (!dcxx . . $ QUrlInfo#d.) |
| 687 | return other.dcxx . . $ QUrlInfo#d. == 0; |
| 688 | if (!other.dcxx . . $ QUrlInfo#d.) |
| 689 | return false; |
| 690 | |
| 691 | return (dcxx . . $ QUrlInfo#d.->namecxx . . $ QUrlInfoPrivate#name. ==cxx . . $ `operator==`(5bc2975d2d751687). other.dcxx . . $ QUrlInfo#d.->namecxx . . $ QUrlInfoPrivate#name. && |
| 692 | dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions. == other.dcxx . . $ QUrlInfo#d.->permissionscxx . . $ QUrlInfoPrivate#permissions. && |
| 693 | dcxx . . $ QUrlInfo#d.->ownercxx . . $ QUrlInfoPrivate#owner. ==cxx . . $ `operator==`(5bc2975d2d751687). other.dcxx . . $ QUrlInfo#d.->ownercxx . . $ QUrlInfoPrivate#owner. && |
| 694 | dcxx . . $ QUrlInfo#d.->groupcxx . . $ QUrlInfoPrivate#group. ==cxx . . $ `operator==`(5bc2975d2d751687). other.dcxx . . $ QUrlInfo#d.->groupcxx . . $ QUrlInfoPrivate#group. && |
| 695 | dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size. == other.dcxx . . $ QUrlInfo#d.->sizecxx . . $ QUrlInfoPrivate#size. && |
| 696 | dcxx . . $ QUrlInfo#d.->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified. ==cxx . . $ QDateTime#`operator==`(147858620bc979f5). other.dcxx . . $ QUrlInfo#d.->lastModifiedcxx . . $ QUrlInfoPrivate#lastModified. && |
| 697 | dcxx . . $ QUrlInfo#d.->lastReadcxx . . $ QUrlInfoPrivate#lastRead. ==cxx . . $ QDateTime#`operator==`(147858620bc979f5). other.dcxx . . $ QUrlInfo#d.->lastReadcxx . . $ QUrlInfoPrivate#lastRead. && |
| 698 | dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir. == other.dcxx . . $ QUrlInfo#d.->isDircxx . . $ QUrlInfoPrivate#isDir. && |
| 699 | dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile. == other.dcxx . . $ QUrlInfo#d.->isFilecxx . . $ QUrlInfoPrivate#isFile. && |
| 700 | dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink. == other.dcxx . . $ QUrlInfo#d.->isSymLinkcxx . . $ QUrlInfoPrivate#isSymLink. && |
| 701 | dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable. == other.dcxx . . $ QUrlInfo#d.->isWritablecxx . . $ QUrlInfoPrivate#isWritable. && |
| 702 | dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable. == other.dcxx . . $ QUrlInfo#d.->isReadablecxx . . $ QUrlInfoPrivate#isReadable. && |
| 703 | dcxx . . $ QUrlInfo#d.->isExecutablecxx . . $ QUrlInfoPrivate#isExecutable. == other.dcxx . . $ QUrlInfo#d.->isExecutablecxx . . $ QUrlInfoPrivate#isExecutable.); |
| 704 | } |
| 705 | |
| 706 | /*! |
| 707 | \fn bool QUrlInfo::operator!=(const QUrlInfo &other) const |
| 708 | \since 4.2 |
| 709 | |
| 710 | Returns true if this QUrlInfo is not equal to \a other; otherwise |
| 711 | returns false. |
| 712 | |
| 713 | \sa lessThan(), equal() |
| 714 | */ |
| 715 | |
| 716 | /*! |
| 717 | Returns true if the URL info is valid; otherwise returns false. |
| 718 | Valid means that the QUrlInfo contains real information. |
| 719 | |
| 720 | You should always check if the URL info is valid before relying on |
| 721 | the values. |
| 722 | */ |
| 723 | bool QUrlInfocxx . . $ QUrlInfo#::isValidcxx . . $ QUrlInfo#isValid(50ce9a9e25b4a850).() const |
| 724 | { |
| 725 | return dcxx . . $ QUrlInfo#d. != 0; |
| 726 | } |
| 727 | |
| 728 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |