From b529f046c9a64ac5fcfa60747af940cf972b3ebc Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:34 -0600 Subject: Actually move the kde files that were renamed in the last commit --- tdesu/tdesud/repo.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tdesu/tdesud/repo.h (limited to 'tdesu/tdesud/repo.h') diff --git a/tdesu/tdesud/repo.h b/tdesu/tdesud/repo.h new file mode 100644 index 000000000..70027793f --- /dev/null +++ b/tdesu/tdesud/repo.h @@ -0,0 +1,68 @@ +/* vi: ts=8 sts=4 sw=4 + * + * This file is part of the KDE project, module tdesu. + * Copyright (C) 1999,2000 Geert Jansen + */ + +#ifndef __Repo_h_included__ +#define __Repo_h_included__ + + +#include +#include + + +/** + * Used internally. + */ +struct Data_entry +{ + TQCString value; + TQCString group; + unsigned int timeout; +}; + + +/** + * String repository. + * + * This class implements a string repository with expiration. + */ +class Repository { +public: + Repository(); + ~Repository(); + + /** Remove data elements which are expired. */ + int expire(); + + /** Add a data element */ + void add(const TQCString& key, Data_entry& data); + + /** Delete a data element. */ + int remove(const TQCString& key); + + /** Delete all data entries having the given group. */ + int removeGroup(const TQCString& group); + + /** Delete all data entries based on key. */ + int removeSpecialKey(const TQCString& key ); + + /** Checks for the existence of the specified group. */ + int hasGroup(const TQCString &group) const; + + /** Return a data value. */ + TQCString find(const TQCString& key) const; + + /** Returns the key values for the given group. */ + TQCString findKeys(const TQCString& group, const char *sep= "-") const; + +private: + + TQMap repo; + typedef TQMap::Iterator RepoIterator; + typedef TQMap::ConstIterator RepoCIterator; + unsigned head_time; +}; + +#endif -- cgit v1.2.1