KIO
KIO::UDSEntry Class Reference
#include <udsentry.h>
Detailed Description
Universal Directory Service.UDS entry is the data structure representing all the fields about a given URL (file or directory).
The KIO::listDir() and KIO:stat() operations use this data structure.
KIO defines a number of standard fields, see the UDS_XXX enums (see StandardFieldTypes). at the moment UDSEntry only provides fields with numeric indexes, but there might be named fields with string indexes in the future.
For instance, to retrieve the name of the entry, use:
QString displayName = entry.stringValue( KIO::UDSEntry::UDS_NAME );
To know the modification time of the file/url:
time_t mtime = entry.numberValue( KIO::UDSEntry::UDS_MODIFICATION_TIME, -1 ); if ( mtime != -1 ) ...
Definition at line 58 of file udsentry.h.
Public Types | |
| enum | StandardFieldTypes { UDS_STRING = 0x01000000, UDS_NUMBER = 0x02000000, UDS_TIME = 0x04000000 | UDS_NUMBER, UDS_SIZE = 1 | UDS_NUMBER, UDS_SIZE_LARGE = 2 | UDS_NUMBER, UDS_USER = 3 | UDS_STRING, UDS_ICON_NAME = 4 | UDS_STRING, UDS_GROUP = 5 | UDS_STRING, UDS_NAME = 6 | UDS_STRING, UDS_LOCAL_PATH = 7 | UDS_STRING, UDS_HIDDEN = 8 | UDS_NUMBER, UDS_ACCESS = 9 | UDS_NUMBER, UDS_MODIFICATION_TIME = 10 | UDS_TIME, UDS_ACCESS_TIME = 11 | UDS_TIME, UDS_CREATION_TIME = 12 | UDS_TIME, UDS_FILE_TYPE = 13 | UDS_NUMBER, UDS_LINK_DEST = 14 | UDS_STRING, UDS_URL = 15 | UDS_STRING, UDS_MIME_TYPE = 16 | UDS_STRING, UDS_GUESSED_MIME_TYPE = 17 | UDS_STRING, UDS_XML_PROPERTIES = 18 | UDS_STRING, UDS_EXTENDED_ACL = 19 | UDS_NUMBER, UDS_ACL_STRING = 20 | UDS_STRING, UDS_DEFAULT_ACL_STRING = 21 | UDS_STRING, UDS_EXTRA = 100 | UDS_STRING, UDS_EXTRA_END = 140 | UDS_STRING } |
Public Member Functions | |
| UDSEntry () | |
| UDSEntry (const UDSEntry &other) | |
| ~UDSEntry () | |
| UDSEntry & | operator= (const UDSEntry &other) |
| QString | stringValue (uint field) const |
| long long | numberValue (uint field, long long defaultValue=0) const |
| bool | isDir () const |
| bool | isLink () const |
| void | insert (uint field, const QString &value) |
| void | insert (uint field, long long l) |
| int | count () const |
| bool | contains (uint field) const |
| bool | remove (uint field) |
| QList< uint > | listFields () const |
| void | clear () |
Friends | |
| class | UDSEntryPrivate |
Member Enumeration Documentation
Constants used to specify the type of a UDSField.
- Enumerator:
-
UDS_STRING Indicates that the field is a QString. UDS_NUMBER Indicates that the field is a number (long long). UDS_TIME Indicates that the field represents a time, which is modelled by a long long. UDS_SIZE Size of the file. UDS_SIZE_LARGE UDS_USER User ID of the file owner. UDS_ICON_NAME Name of the icon, that should be used for displaying. It overrides all other detection mechanisms
UDS_GROUP Group ID of the file owner. UDS_NAME Filename - as displayed in directory listings etc. "." has the usual special meaning of "current directory"
UDS_LOCAL_PATH A local file path if the ioslave display files sitting on the local filesystem (but in another hierarchy, e.g. media:/)
UDS_HIDDEN Treat the file as a hidden file (if set to 1) or as a normal file (if set to 0). This field overrides the default behavior (the check for a leading dot in the filename).
UDS_ACCESS Access permissions (part of the mode returned by stat). UDS_MODIFICATION_TIME The last time the file was modified. UDS_ACCESS_TIME The last time the file was opened. UDS_CREATION_TIME The time the file was created. UDS_FILE_TYPE File type, part of the mode returned by stat (for a link, this returns the file type of the pointed item) check UDS_LINK_DEST to know if this is a link. UDS_LINK_DEST Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !). UDS_URL An alternative URL (If different from the caption). UDS_MIME_TYPE A mime type; the slave should set it if it's known. UDS_GUESSED_MIME_TYPE A mime type to be used for displaying only. But when 'running' the file, the mimetype is re-determined This is for special cases like symlinks in FTP; you probably don't want to use this one.
UDS_XML_PROPERTIES XML properties, e.g. for WebDAV. UDS_EXTENDED_ACL Indicates that the entry has extended ACL entries. UDS_ACL_STRING The access control list serialized into a single string. UDS_DEFAULT_ACL_STRING The default access control list serialized into a single string. Only available for directories.
UDS_EXTRA Extra data (used only if you specified Columns/ColumnsTypes) KDE 4.0 change: you cannot repeat this entry anymore, use UDS_EXTRA + i until UDS_EXTRA_END. UDS_EXTRA_END Extra data (used only if you specified Columns/ColumnsTypes) KDE 4.0 change: you cannot repeat this entry anymore, use UDS_EXTRA + i until UDS_EXTRA_END.
Definition at line 131 of file udsentry.h.
Constructor & Destructor Documentation
| UDSEntry::UDSEntry | ( | ) |
Definition at line 53 of file udsentry.cpp.
| UDSEntry::UDSEntry | ( | const UDSEntry & | other | ) |
Definition at line 58 of file udsentry.cpp.
| UDSEntry::~UDSEntry | ( | ) |
Definition at line 63 of file udsentry.cpp.
Member Function Documentation
Definition at line 67 of file udsentry.cpp.
| QString UDSEntry::stringValue | ( | uint | field | ) | const |
| long long UDSEntry::numberValue | ( | uint | field, | |
| long long | defaultValue = 0 | |||
| ) | const |
| bool UDSEntry::isDir | ( | ) | const |
- Returns:
- true if this entry is a directory (or a link to a directory)
Definition at line 84 of file udsentry.cpp.
| bool UDSEntry::isLink | ( | ) | const |
| void UDSEntry::insert | ( | uint | field, | |
| const QString & | value | |||
| ) |
insert field with numeric value
- Parameters:
-
field numeric field id value
Definition at line 94 of file udsentry.cpp.
| void UDSEntry::insert | ( | uint | field, | |
| long long | l | |||
| ) |
insert field with string value
- Parameters:
-
field numeric tield id l value to set
Definition at line 101 of file udsentry.cpp.
| int UDSEntry::count | ( | ) | const |
| bool UDSEntry::contains | ( | uint | field | ) | const |
| bool UDSEntry::remove | ( | uint | field | ) |
remove a field with a certain numeric id
- Parameters:
-
field numeric type id
Definition at line 123 of file udsentry.cpp.
| QList< uint > UDSEntry::listFields | ( | ) | const |
| void UDSEntry::clear | ( | ) |
Friends And Related Function Documentation
friend class UDSEntryPrivate [friend] |
Definition at line 208 of file udsentry.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference