3 * This file is part of the KDE project, module kdesu.
4 * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
7 #ifndef __Repo_h_included__
8 #define __Repo_h_included__
29 * This class implements a string repository with expiration.
36 /** Remove data elements which are expired. */
39 /** Add a data element */
40 void add(const QByteArray
& key
, Data_entry
& data
);
42 /** Delete a data element. */
43 int remove(const QByteArray
& key
);
45 /** Delete all data entries having the given group. */
46 int removeGroup(const QByteArray
& group
);
48 /** Delete all data entries based on key. */
49 int removeSpecialKey(const QByteArray
& key
);
51 /** Checks for the existence of the specified group. */
52 int hasGroup(const QByteArray
&group
) const;
54 /** Return a data value. */
55 QByteArray
find(const QByteArray
& key
) const;
57 /** Returns the key values for the given group. */
58 QByteArray
findKeys(const QByteArray
& group
, const char *sep
= "-") const;
62 QMap
<QByteArray
,Data_entry
> repo
;
63 typedef QMap
<QByteArray
,Data_entry
>::Iterator RepoIterator
;
64 typedef QMap
<QByteArray
,Data_entry
>::ConstIterator RepoCIterator
;