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