• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
udsentry.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000-2005 David Faure <faure@kde.org>
3 Copyright (C) 2007 Norbert Frese <nf2@scheinwelt.at>
4 Copyright (C) 2007 Thiago Macieira <thiago@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21
22#ifndef UDSENTRY_H
23#define UDSENTRY_H
24
25#include <QtCore/QString>
26#include <QtCore/QList>
27#include <QtCore/QSharedData>
28
29#include <kio/kio_export.h>
30
31namespace KIO
32{
33 class UDSEntryPrivate;
58 class KIO_EXPORT UDSEntry
59 {
60 public:
61
62 UDSEntry();
63 UDSEntry(const UDSEntry &other);
64 ~UDSEntry();
65 UDSEntry &operator=(const UDSEntry &other);
66
70 QString stringValue( uint field ) const;
71
75 long long numberValue( uint field, long long defaultValue = 0 ) const;
76
77 // Convenience methods.
78 // Let's not add one method per field, only methods that have some more logic
79 // than just calling stringValue(field) or numberValue(field).
80
82 bool isDir() const;
84 bool isLink() const;
85
91 void insert(uint field, const QString& value);
92
98 void insert(uint field, long long l);
99
104 int count() const;
105
110 bool contains(uint field) const;
111
116 bool remove(uint field);
117
121 QList<uint> listFields() const;
122
126 void clear();
127
131 enum StandardFieldTypes {
132 // First let's define the item types: bit field
133
135 UDS_STRING = 0x01000000,
137 UDS_NUMBER = 0x02000000,
139 UDS_TIME = 0x04000000 | UDS_NUMBER,
140
141 // The rest isn't a bit field
142
144 UDS_SIZE = 1 | UDS_NUMBER,
146 UDS_SIZE_LARGE = 2 | UDS_NUMBER,
148 UDS_USER = 3 | UDS_STRING,
151 UDS_ICON_NAME = 4 | UDS_STRING,
153 UDS_GROUP = 5 | UDS_STRING,
163 UDS_NAME = 6 | UDS_STRING,
166 UDS_LOCAL_PATH = 7 | UDS_STRING,
169 UDS_HIDDEN = 8 | UDS_NUMBER,
171 UDS_ACCESS = 9 | UDS_NUMBER,
173 UDS_MODIFICATION_TIME = 10 | UDS_TIME,
175 UDS_ACCESS_TIME = 11 | UDS_TIME,
177 UDS_CREATION_TIME = 12 | UDS_TIME,
181 UDS_FILE_TYPE = 13 | UDS_NUMBER,
184 UDS_LINK_DEST = 14 | UDS_STRING,
190 UDS_URL = 15 | UDS_STRING,
192 UDS_MIME_TYPE = 16 | UDS_STRING,
196 UDS_GUESSED_MIME_TYPE = 17 | UDS_STRING,
198 UDS_XML_PROPERTIES = 18 | UDS_STRING,
199
201 UDS_EXTENDED_ACL = 19 | UDS_NUMBER,
203 UDS_ACL_STRING = 20 | UDS_STRING,
206 UDS_DEFAULT_ACL_STRING = 21 | UDS_STRING,
207
211 UDS_DISPLAY_NAME = 22 | UDS_STRING,
215 UDS_TARGET_URL = 23 | UDS_STRING,
216
220 UDS_DISPLAY_TYPE = 24 | UDS_STRING,
221
234 UDS_NEPOMUK_URI = 25 | UDS_STRING,
235
241 UDS_ICON_OVERLAY_NAMES = 26 | UDS_STRING,
242
248 UDS_NEPOMUK_QUERY = 27 | UDS_STRING,
249
254 UDS_COMMENT = 28 | UDS_STRING,
255
258 UDS_DEVICE_ID = 29 | UDS_NUMBER,
261 UDS_INODE = 30 | UDS_NUMBER,
262
266 UDS_EXTRA = 100 | UDS_STRING,
270 UDS_EXTRA_END = 140 | UDS_STRING
271 };
272
273 private:
274 friend class UDSEntryPrivate;
275 QSharedDataPointer<UDSEntryPrivate> d;
276 };
277
294 typedef QList<UDSEntry> UDSEntryList;
295} // end namespace
296
297KIO_EXPORT QDataStream & operator<< ( QDataStream & s, const KIO::UDSEntry & a );
298KIO_EXPORT QDataStream & operator>> ( QDataStream & s, KIO::UDSEntry & a );
299
300#endif /*UDSENTRY_H*/
KIO::UDSEntry
Universal Directory Service.
Definition udsentry.h:59
KIO::UDSEntry::stringValue
QString stringValue(uint field) const
Definition udsentry.cpp:73
KIO::UDSEntry::numberValue
long long numberValue(uint field, long long defaultValue=0) const
Definition udsentry.cpp:78
KIO::UDSEntry::UDSEntry
UDSEntry()
Definition udsentry.cpp:53
KIO::UDSEntry::isLink
bool isLink() const
Definition udsentry.cpp:89
KIO::UDSEntry::UDSEntryPrivate
friend class UDSEntryPrivate
Definition udsentry.h:274
KIO::UDSEntry::StandardFieldTypes
StandardFieldTypes
Constants used to specify the type of a UDSField.
Definition udsentry.h:131
KIO::UDSEntry::UDS_CREATION_TIME
@ UDS_CREATION_TIME
The time the file was created.
Definition udsentry.h:177
KIO::UDSEntry::UDS_ICON_OVERLAY_NAMES
@ UDS_ICON_OVERLAY_NAMES
A comma-separated list of supplementary icon overlays which will be added to the list of overlays cre...
Definition udsentry.h:241
KIO::UDSEntry::UDS_HIDDEN
@ UDS_HIDDEN
Treat the file as a hidden file (if set to 1) or as a normal file (if set to 0).
Definition udsentry.h:169
KIO::UDSEntry::UDS_URL
@ UDS_URL
An alternative URL (If different from the caption).
Definition udsentry.h:190
KIO::UDSEntry::UDS_GROUP
@ UDS_GROUP
Group ID of the file owner.
Definition udsentry.h:153
KIO::UDSEntry::UDS_LINK_DEST
@ UDS_LINK_DEST
Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !...
Definition udsentry.h:184
KIO::UDSEntry::UDS_MIME_TYPE
@ UDS_MIME_TYPE
A mime type; the slave should set it if it's known.
Definition udsentry.h:192
KIO::UDSEntry::UDS_LOCAL_PATH
@ UDS_LOCAL_PATH
A local file path if the ioslave display files sitting on the local filesystem (but in another hierar...
Definition udsentry.h:166
KIO::UDSEntry::UDS_FILE_TYPE
@ UDS_FILE_TYPE
File type, part of the mode returned by stat (for a link, this returns the file type of the pointed i...
Definition udsentry.h:181
KIO::UDSEntry::UDS_STRING
@ UDS_STRING
Indicates that the field is a QString.
Definition udsentry.h:135
KIO::UDSEntry::UDS_DISPLAY_TYPE
@ UDS_DISPLAY_TYPE
User-readable type of file (if not specified, the mimetype's description is used)
Definition udsentry.h:220
KIO::UDSEntry::UDS_MODIFICATION_TIME
@ UDS_MODIFICATION_TIME
The last time the file was modified.
Definition udsentry.h:173
KIO::UDSEntry::UDS_COMMENT
@ UDS_COMMENT
A comment which will be displayed as is to the user.
Definition udsentry.h:254
KIO::UDSEntry::UDS_SIZE
@ UDS_SIZE
Size of the file.
Definition udsentry.h:144
KIO::UDSEntry::UDS_DEVICE_ID
@ UDS_DEVICE_ID
Device number for this file, used to detect hardlinks.
Definition udsentry.h:258
KIO::UDSEntry::UDS_ACCESS_TIME
@ UDS_ACCESS_TIME
The last time the file was opened.
Definition udsentry.h:175
KIO::UDSEntry::UDS_DISPLAY_NAME
@ UDS_DISPLAY_NAME
If set, contains the label to display instead of the 'real name' in UDS_NAME.
Definition udsentry.h:211
KIO::UDSEntry::UDS_TIME
@ UDS_TIME
Indicates that the field represents a time, which is modelled by a long long.
Definition udsentry.h:139
KIO::UDSEntry::UDS_NEPOMUK_QUERY
@ UDS_NEPOMUK_QUERY
A serialized Nepomuk::Query::Query which lists the contents of the folder this UDSEntry describes.
Definition udsentry.h:248
KIO::UDSEntry::UDS_DEFAULT_ACL_STRING
@ UDS_DEFAULT_ACL_STRING
The default access control list serialized into a single string.
Definition udsentry.h:206
KIO::UDSEntry::UDS_NAME
@ UDS_NAME
Filename - as displayed in directory listings etc.
Definition udsentry.h:163
KIO::UDSEntry::UDS_TARGET_URL
@ UDS_TARGET_URL
This file is a shortcut or mount, pointing to an URL in a different hierarchy.
Definition udsentry.h:215
KIO::UDSEntry::UDS_ICON_NAME
@ UDS_ICON_NAME
Name of the icon, that should be used for displaying.
Definition udsentry.h:151
KIO::UDSEntry::UDS_NEPOMUK_URI
@ UDS_NEPOMUK_URI
The URI of the corresponding Nepomuk resource.
Definition udsentry.h:234
KIO::UDSEntry::UDS_EXTRA
@ UDS_EXTRA
Extra data (used only if you specified Columns/ColumnsTypes) KDE 4.0 change: you cannot repeat this e...
Definition udsentry.h:266
KIO::UDSEntry::UDS_NUMBER
@ UDS_NUMBER
Indicates that the field is a number (long long)
Definition udsentry.h:137
KIO::UDSEntry::UDS_ACL_STRING
@ UDS_ACL_STRING
The access control list serialized into a single string.
Definition udsentry.h:203
KIO::UDSEntry::UDS_EXTRA_END
@ UDS_EXTRA_END
Extra data (used only if you specified Columns/ColumnsTypes) KDE 4.0 change: you cannot repeat this e...
Definition udsentry.h:270
KIO::UDSEntry::UDS_GUESSED_MIME_TYPE
@ UDS_GUESSED_MIME_TYPE
A mime type to be used for displaying only.
Definition udsentry.h:196
KIO::UDSEntry::UDS_XML_PROPERTIES
@ UDS_XML_PROPERTIES
XML properties, e.g. for WebDAV.
Definition udsentry.h:198
KIO::UDSEntry::UDS_INODE
@ UDS_INODE
Inode number for this file, used to detect hardlinks.
Definition udsentry.h:261
KIO::UDSEntry::UDS_USER
@ UDS_USER
User ID of the file owner.
Definition udsentry.h:148
KIO::UDSEntry::UDS_EXTENDED_ACL
@ UDS_EXTENDED_ACL
Indicates that the entry has extended ACL entries.
Definition udsentry.h:201
KIO::UDSEntry::UDS_SIZE_LARGE
@ UDS_SIZE_LARGE
Definition udsentry.h:146
KIO::UDSEntry::UDS_ACCESS
@ UDS_ACCESS
Access permissions (part of the mode returned by stat)
Definition udsentry.h:171
KIO::UDSEntry::contains
bool contains(uint field) const
check existence of a field
Definition udsentry.cpp:118
KIO::UDSEntry::insert
void insert(uint field, const QString &value)
insert field with numeric value
Definition udsentry.cpp:94
KIO::UDSEntry::isDir
bool isDir() const
Definition udsentry.cpp:84
KIO::UDSEntry::clear
void clear()
remove all fields
Definition udsentry.cpp:128
KIO::UDSEntry::remove
bool remove(uint field)
remove a field with a certain numeric id
Definition udsentry.cpp:123
KIO::UDSEntry::operator=
UDSEntry & operator=(const UDSEntry &other)
Definition udsentry.cpp:67
KIO::UDSEntry::listFields
QList< uint > listFields() const
lists all fields
Definition udsentry.cpp:108
KIO::UDSEntry::count
int count() const
count fields
Definition udsentry.cpp:113
QList
defaultValue
QString defaultValue(const QString &t)
kio_export.h
KIO
A namespace for KIO globals.
Definition kbookmarkmenu.h:55
KIO::UDSEntryList
QList< UDSEntry > UDSEntryList
A directory listing is a list of UDSEntry instances.
Definition udsentry.h:294
operator<<
QDataStream & operator<<(QDataStream &s, const KIO::UDSEntry &a)
Definition udsentry.cpp:133
operator>>
QDataStream & operator>>(QDataStream &s, KIO::UDSEntry &a)
Definition udsentry.cpp:139
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal