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;
211 #endif // GIT_MODEL_H_ int rowCount() const
Returns the (cached) row count.
Tree(int parentId, int index, const Git::ObjectId &object, int rowCount)
Constructor.
Index usable as a key to a map, that identifies a child/row within a tree.
const Git::ObjectId & treeObject() const
Returns the SHA1 id for the git tree object.
Git git_
The git repository.
static constexpr int Display
Git::ObjectId treeObject_
static const ItemDataRole FilePathRole
Git utility class for browsing git archives.
ChildIndex(int aParent, int anIndex)
ChildPointerMap childPointer_
Maps child indexes to tree indexes.
virtual cpp17::any data(const WModelIndex &index, ItemDataRole role=ItemDataRole::Display) const =0
std::map< ChildIndex, int > ChildPointerMap
static const ItemDataRole ContentsRole
The role which may be used on a file to retrieve its contents.
A model that retrieves revision trees from a git repository.
int parentId() const
Returns the parent id.
int index() const
Returns the child index within the parent folder.
std::vector< Tree > treeData_
List of folder objects.
Used to uniquely locate a folder within the folder hierarchy.