10#include <Wt/WAbstractItemModel>
102 using WAbstractItemModel::data;
200 int getTreeId(
int parentId,
int childIndex)
const;
Used to uniquely locate a folder within the folder hierarchy.
Tree(int parentId, int index, const Git::ObjectId &object, int rowCount)
Constructor.
int parentId() const
Returns the parent id.
int index() const
Returns the child index within the parent folder.
int rowCount() const
Returns the (cached) row count.
const Git::ObjectId & treeObject() const
Returns the SHA1 id for the git tree object.
Git::ObjectId treeObject_
A model that retrieves revision trees from a git repository.
virtual int rowCount(const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns the row count.
virtual int columnCount(const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns the column count.
static const int ContentsRole
The role which may be used on a file to retrieve its contents.
Git::Object getObject(const Wt::WModelIndex &index) const
Get the Git::Object that corresponds to an index.
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
int getTreeId(int parentId, int childIndex) const
Get or allocate an id for a folder.
std::vector< Tree > treeData_
List of folder objects.
std::map< ChildIndex, int > ChildPointerMap
virtual boost::any data(const Wt::WModelIndex &index, int role=Wt::DisplayRole) const
Returns data.
static const int FilePathRole
void setRepositoryPath(const std::string &repositoryPath)
Set the repository and load its 'master' revision.
virtual Wt::WModelIndex index(int row, int column, const Wt::WModelIndex &parent=Wt::WModelIndex()) const
Returns a child index.
virtual boost::any headerData(int section, Wt::Orientation orientation=Wt::Horizontal, int role=Wt::DisplayRole) const
Returns header data.
void loadRevision(const std::string &revName)
Load a particular revision.
Git git_
The git repository.
Git utility class for browsing git archives.
Index usable as a key to a map, that identifies a child/row within a tree.
bool operator<(const ChildIndex &other) const
ChildIndex(int aParent, int anIndex)