/*
 * filelistretriever.h
 *
 * Copyright (c) 2002, 2003 Frerich Raabe <raabe@kde.org>
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
 * accompanying file 'COPYING'.
 */
#ifndef FILELISTRETRIEVER_H
#define FILELISTRETRIEVER_H

#include <qstringlist.h>

class QDateTime;

namespace Barry
{
	class PortInterface;

	class FileListRetriever
	{
		public:
			static QStringList fileList( const PortInterface &port );

			FileListRetriever( const PortInterface &port );

			QStringList fileList();
	
		private:
			bool cacheIsValid() const;
			QDateTime sourceMTime() const;
			QDateTime cachedMTime() const;
			void rebuildCache();
			QStringList processCache();

			QString m_sourceFile;
			QString m_cacheFile;
			const PortInterface &m_port;
	};
};

#endif // FILELISTRETRIEVER_H
// vim:ts=4:sw=4:noet:list
