Wt examples
3.7.1
|
Git utility class for browsing git archives. More...
#include <Git.h>
Classes | |
class | Exception |
Exception class. More... | |
struct | Object |
Git object. More... | |
class | ObjectId |
Git object Id. More... | |
Public Types | |
enum | ObjectType { Tree, Commit, Blob } |
Git object type. More... | |
typedef std::list< std::pair< std::string, std::string > > | Cache |
Public Member Functions | |
Git () | |
Constructor. More... | |
void | setRepositoryPath (const std::string &repository) |
Set the git repository path. More... | |
ObjectId | getCommitTree (const std::string &revision) const |
Get the tree for a particular revision. More... | |
ObjectId | getCommit (const std::string &revision) const |
Get the commit for a particular revision. More... | |
ObjectId | getTreeFromCommit (const ObjectId &commit) const |
Get the tree for a particular commit. More... | |
Object | treeGetObject (const ObjectId &tree, int index) const |
Get some info on a tree object. More... | |
int | treeSize (const ObjectId &tree) const |
Return the number of objects inside a tree object. More... | |
std::string | catFile (const ObjectId &id) const |
Return the raw contents of a git object. More... | |
Private Member Functions | |
void | checkRepository () const |
Checks the repository. More... | |
bool | getCmdResult (const std::string &cmd, std::string &result, const std::string &tag) const |
Returns a line identified by a tag from the output of a git command. More... | |
bool | getCmdResult (const std::string &cmd, std::string &result, int index) const |
Returns the ith line from the output of a git command. More... | |
int | getCmdResultLineCount (const std::string &cmd) const |
Returns the number of lines in the output of a git command. More... | |
Private Attributes | |
std::string | repository_ |
The path to the repository. More... | |
Cache | cache_ |
A small LRU cache that stores results of git commands. More... | |
Git utility class for browsing git archives.
Far from complete! Only browses git revisions.
typedef std::list<std::pair<std::string, std::string> > Git::Cache |
enum Git::ObjectType |
std::string Git::catFile | ( | const ObjectId & | id | ) | const |
Return the raw contents of a git object.
Exception | : in case of a git error. |
Definition at line 213 of file Git.C.
|
private |
|
private |
|
private |
|
private |
Git::ObjectId Git::getCommit | ( | const std::string & | revision | ) | const |
Get the commit for a particular revision.
Exception | : in case of a git error. |
Definition at line 223 of file Git.C.
Git::ObjectId Git::getCommitTree | ( | const std::string & | revision | ) | const |
Get the tree for a particular revision.
Exception | : in case of a git error. |
Git::ObjectId Git::getTreeFromCommit | ( | const ObjectId & | commit | ) | const |
Get the tree for a particular commit.
Exception | : in case of a git error. |
Definition at line 230 of file Git.C.
void Git::setRepositoryPath | ( | const std::string & | repository | ) |
Git::Object Git::treeGetObject | ( | const ObjectId & | tree, |
int | index | ||
) | const |
Get some info on a tree object.
The object is specified based on its index in the parent tree object.
Exception | : in case of a git error. |
Definition at line 245 of file Git.C.
int Git::treeSize | ( | const ObjectId & | tree | ) | const |
|
mutableprivate |
|
private |