KIO
KIO::UDSEntry Class Reference
Universal Directory Service. More...
#include <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_DISPLAY_NAME = 22 | UDS_STRING, UDS_TARGET_URL = 23 | UDS_STRING, UDS_EXTRA = 100 | UDS_STRING, UDS_EXTRA_END = 140 | UDS_STRING } |
Public Member Functions | |
void | clear () |
bool | contains (uint field) const |
int | count () const |
void | insert (uint field, long long l) |
void | insert (uint field, const QString &value) |
bool | isDir () const |
bool | isLink () const |
QList< uint > | listFields () const |
long long | numberValue (uint field, long long defaultValue=0) const |
UDSEntry & | operator= (const UDSEntry &other) |
bool | remove (uint field) |
QString | stringValue (uint field) const |
UDSEntry (const UDSEntry &other) | |
UDSEntry () | |
~UDSEntry () |
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.
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 For internal use only.
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_NAME must always be set and never be empty, neither contain '/'.
Note that KIO will append the UDS_NAME to the url of their parent directory, so all kioslaves must use that naming scheme ("url_of_parent/filename" will be the full url of that file). To customize the appearance of files without changing the url of the items, use UDS_DISPLAY_NAME.
UDS_LOCAL_PATH A local file path if the ioslave display files sitting on the local filesystem (but in another hierarchy, e.g.
settings:/ or remote:/)
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) WARNING: the use of UDS_URL is deprecated, since KDirModel requires a hierarchical scheme in the urls used by kioslaves.
Use UDS_DISPLAY_NAME if you simply want to customize the user-visible filenames, or use UDS_TARGET_URL if you want "links" to unrelated urls.
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_DISPLAY_NAME If set, contains the label to display instead of the 'real name' in UDS_NAME.
- Since:
- 4.1
UDS_TARGET_URL This file is a shortcut or mount, pointing to an URL in a different hierarchy.
- Since:
- 4.1
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
void UDSEntry::clear | ( | ) |
remove all fields
Definition at line 128 of file udsentry.cpp.
bool UDSEntry::contains | ( | uint | field | ) | const |
int UDSEntry::count | ( | ) | const |
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.
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.
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 |
- Returns:
- true if this entry is a link
Definition at line 89 of file udsentry.cpp.
QList< uint > UDSEntry::listFields | ( | ) | const |
lists all fields
Definition at line 108 of file udsentry.cpp.
long long UDSEntry::numberValue | ( | uint | field, | |
long long | defaultValue = 0 | |||
) | const |
- Returns:
- value of a numeric field
Definition at line 78 of file udsentry.cpp.
Definition at line 67 of file udsentry.cpp.
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.
QString UDSEntry::stringValue | ( | uint | field | ) | const |
- Returns:
- value of a textual field
Definition at line 73 of file udsentry.cpp.
The documentation for this class was generated from the following files: