kio Library API Documentation

KFileMetaInfoGroup Class Reference

This is one group of meta information items about a file (see KFileMetaInfo). More...

#include <kfilemetainfo.h>

List of all members.

Public Methods

 KFileMetaInfoGroup (const KFileMetaInfoGroup &original)
 Copy onstructor.

const KFileMetaInfoGroup & operator= (const KFileMetaInfoGroup &info)
 The assignment operator, so you can do:.

 KFileMetaInfoGroup ()
 Default constructor.

bool isValid () const
bool isEmpty () const
bool isModified () const
 Returns true if an item as added or removed from the group.

KFileMetaInfoItem operator[] (const QString &key) const
 operator for convenience.

KFileMetaInfoItem item (const QString &key) const
 This method searches for the specified item.

KFileMetaInfoItem item (uint hint) const
const QVariant value (const QString &key) const
 Convenience function.

QStringList supportedKeys () const
 Use this method to get a list of keys in the specified group that the plugin knows about.

bool supportsVariableKeys () const
bool contains (const QString &key) const
QStringList keys () const
QStringList preferredKeys () const
KFileMetaInfoItem addItem (const QString &key)
 add an item to the info.

bool removeItem (const QString &key)
 remove this item from the meta info of the file.


Detailed Description

This is one group of meta information items about a file (see KFileMetaInfo).

Definition at line 656 of file kfilemetainfo.h.


Constructor & Destructor Documentation

KFileMetaInfoGroup::KFileMetaInfoGroup const KFileMetaInfoGroup &    original
 

Copy onstructor.

Definition at line 1033 of file kfilemetainfo.cpp.

KFileMetaInfoGroup::KFileMetaInfoGroup  
 

Default constructor.

This creates an "invalid" item

Since:
3.1

Definition at line 1040 of file kfilemetainfo.cpp.


Member Function Documentation

const KFileMetaInfoGroup & KFileMetaInfoGroup::operator= const KFileMetaInfoGroup &    info
 

The assignment operator, so you can do:.

    KFileMetaInfoGroup group = info.group("Technical");
 

This will create a shared copy of the object. The actual data is automatically deleted if all copies go out of scope

Definition at line 1050 of file kfilemetainfo.cpp.

References d.

bool KFileMetaInfoGroup::isValid  
 

Returns:
true if the item is valid, i.e. if it contains data, false if it's invalid (created with the default constructor and not been assigned anything), or if KFileMetaInfoGroup::item() didn't find your requested item)

Definition at line 1063 of file kfilemetainfo.cpp.

Referenced by removeItem().

bool KFileMetaInfoGroup::isEmpty  
 

Returns:
false if the object contains data, true if it's empty. An empty group is a group with no items (amazing, isn't it?)

Definition at line 1069 of file kfilemetainfo.cpp.

bool KFileMetaInfoGroup::isModified  
 

Returns true if an item as added or removed from the group.

Returns:
true if an item was added or removed from the group, otherwise false.
Since:
3.1

Definition at line 1173 of file kfilemetainfo.cpp.

KFileMetaInfoItem KFileMetaInfoGroup::operator[] const QString   key const [inline]
 

operator for convenience.

It does the same as item(), but you cannot specify a group to search in

Definition at line 723 of file kfilemetainfo.h.

References item(), and KStdAccel::key().

KFileMetaInfoItem KFileMetaInfoGroup::item const QString   key const
 

This method searches for the specified item.

Returns:
the specified item if found, an invalid item, if not

Definition at line 1138 of file kfilemetainfo.cpp.

References QMapIterator::data(), and KStdAccel::key().

Referenced by addItem(), operator[](), preferredKeys(), and value().

KFileMetaInfoItem KFileMetaInfoGroup::item uint    hint const
 

Returns:
the item with the specified hint

Definition at line 1147 of file kfilemetainfo.cpp.

References QMapIterator::data().

const QVariant KFileMetaInfoGroup::value const QString   key const [inline]
 

Convenience function.

Returns the value of the specified key. It does the same as item(key).value()

Definition at line 742 of file kfilemetainfo.h.

References item(), KStdAccel::key(), and KFileMetaInfoItem::value().

QStringList KFileMetaInfoGroup::supportedKeys  
 

Use this method to get a list of keys in the specified group that the plugin knows about.

No variable keys. For a group that doesn't support variable keys, all keys that this group may have are returned. For a group that does support them, the non-variable ones are returned. See KFileMetaInfo about variable keys

Returns:
the list of keys supported for this mimetype

Definition at line 1123 of file kfilemetainfo.cpp.

bool KFileMetaInfoGroup::supportsVariableKeys  
 

Returns:
true if this group supports adding or removing arbitrary keys, false if not.

Definition at line 1128 of file kfilemetainfo.cpp.

bool KFileMetaInfoGroup::contains const QString   key const
 

Returns:
whether an item for this key exists.

Definition at line 1133 of file kfilemetainfo.cpp.

References KStdAccel::key().

Referenced by KFileMetaInfo::contains().

QStringList KFileMetaInfoGroup::keys  
 

Returns:
a list of all keys in the order they were inserted.

Definition at line 1105 of file kfilemetainfo.cpp.

References QMapConstIterator::data().

Referenced by preferredKeys().

QStringList KFileMetaInfoGroup::preferredKeys  
 

Returns:
a list of all keys in preference order.

Definition at line 1074 of file kfilemetainfo.cpp.

References KStdAccel::end(), item(), keys(), and preferredKeys().

Referenced by preferredKeys().

KFileMetaInfoItem KFileMetaInfoGroup::addItem const QString   key
 

add an item to the info.

This is only possible if the specified key is in the supportedKeys list and not yet defined or if the group supports variable keys.

Definition at line 1198 of file kfilemetainfo.cpp.

References QMapIterator::data(), KFileMimeTypeInfo::ItemInfo::isVariableItem(), item(), KFileMimeTypeInfo::GroupInfo::itemInfo(), KStdAccel::key(), KFileMetaInfoItem::setAdded(), and KFileMimeTypeInfo::GroupInfo::variableItemInfo().

bool KFileMetaInfoGroup::removeItem const QString   key
 

remove this item from the meta info of the file.

You cannot query KFileMetaInfo for a removed object, but you can query for a list of removed items with removedItems() if you need to. If you re-add it, its value will be cleared

Definition at line 1231 of file kfilemetainfo.cpp.

References isValid(), and KStdAccel::key().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:35 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001