10 #include <Wt/WAbstractItemModel.h>
52 void setRepositoryPath(
const std::string& repositoryPath);
59 void loadRevision(
const std::string& revName);
119 : parentId(aParent), index(anIndex) { }
126 else return index < other.
index;
139 : index_(parentId, index),
154 int index()
const {
return index_.index; }
202 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.
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
std::vector< Tree > treeData_
List of folder objects.
std::map< ChildIndex, int > ChildPointerMap
static const ItemDataRole ContentsRole
The role which may be used on a file to retrieve its contents.
static const ItemDataRole FilePathRole
Git git_
The git repository.
Git utility class for browsing git archives.
static constexpr const int Display
virtual cpp17::any data(const WModelIndex &index, ItemDataRole role=ItemDataRole::Display) const=0
Index usable as a key to a map, that identifies a child/row within a tree.
ChildIndex(int aParent, int anIndex)