#ifndef __BRANCHSPEC_H__
#define __BRANCHSPEC_H__
#include "IUpdateable.h"
#include <qdatetime.h>
#include <qlist.h>
#include <qlistview.h>
#include <qstring.h>
namespace Perforce {
class BranchSpec;
typedef QList< BranchSpec > BranchSpecList;
typedef enum Lock {
Locked,
Unlocked
};
class BranchSpec {
public:
virtual ~BranchSpec() { }
inline const QString& getBranchName( void ) const;
inline const QString& getOwner( void ) const;
inline const Lock getLock( void ) const;
inline const QDateTime& getDate( void ) const;
inline const QString& getDescription( void ) const;
public:
static QString lockToString( Lock l );
static const BranchSpecList& getBranches();
private:
BranchSpec() { }
QString _branchName;
QString _owner;
Lock _lock;
QDateTime _date;
QString _description;
private:
struct BranchSpecCache : IUpdateable< Perforce::BranchSpecList > {
void OutputStat( StrDict *varList );
void updateCache();
};
friend BranchSpecCache;
static BranchSpecCache _branchSpecCache;
};
inline const QString& BranchSpec::getBranchName( void ) const
{
return _branchName;
}
inline const QString& BranchSpec::getOwner( void ) const
{
return _owner;
}
inline const Lock BranchSpec::getLock( void ) const
{
return _lock;
}
inline const QDateTime& BranchSpec::getDate( void ) const
{
return _date;
}
inline const QString& BranchSpec::getDescription( void ) const
{
return _description;
}
} // end namespace
#endif