#ifndef __DIR_ENTRY_H__
#define __DIR_ENTRY_H__
#include <qdict.h>
#include <qlist.h>
#include <qstring.h>
#include "FileEntry.h"
namespace Perforce {
class DirEntry;
typedef QList< DirEntry > DirEntryList;
class DirEntry {
public:
DirEntry( const char* fullPath ) :
_fullPath( fullPath ) {
_dirEntryCache._parent = this;
_fileEntryCache._parent = this;
}
inline const QString& getFullPath()
{ return _fullPath; }
const QString getName();
const DirEntryList& getDirs( bool forceFlush = false );
const FileEntryList& getFiles( bool forceFlush = false );
DirEntry* getDirEntry( const QString& fullPath, bool forceFlush = false );
private:
QString _fullPath;
struct DirEntryCache : IUpdateable< Perforce::DirEntryList > {
void HandleError( Error* err );
void OutputStat( StrDict* varList );
void updateCache();
DirEntry* _parent;
};
friend DirEntryCache;
friend FileEntry::FileEntryCache;
DirEntryCache _dirEntryCache;
FileEntry::FileEntryCache _fileEntryCache;
};
} // end namespace
#endif