Git object Id.
More...
#include <Git.h>
Public Member Functions |
| | ObjectId () |
| | Default constructor.
|
| | ObjectId (const std::string &id) |
| | Construct from a 40-digit hexadecimal number.
|
| std::string | toString () const |
| | Print as a 40-digit hexadecimal number.
|
Detailed Description
Git object Id.
Class for compactly storing a 20-byte SHA1 digest.
Definition at line 38 of file Git.h.
Constructor & Destructor Documentation
| Git::ObjectId::ObjectId |
( |
| ) |
|
Default constructor.
Definition at line 151 of file Git.C.
| Git::ObjectId::ObjectId |
( |
const std::string & |
id | ) |
|
|
explicit |
Construct from a 40-digit hexadecimal number.
- Exceptions
-
| Exception | : if the id does not represent a valid SHA1 digest. |
Definition at line 154 of file Git.C.
{
if (id.length() != 40)
for (int i = 0; i < 20; ++i)
(*this)[i] = fromHex(id[2 * i], id[2 * i + 1]);
}
Member Function Documentation
| std::string Git::ObjectId::toString |
( |
| ) |
const |
Print as a 40-digit hexadecimal number.
Definition at line 163 of file Git.C.
{
std::string result(40, '-');
for (int i = 0; i < 20; ++i)
toHex((*this)[i], result[2 * i], result[2 * i + 1]);
return result;
}
The documentation for this class was generated from the following files:
- /build/witty-aQS8OP/witty-3.2.1/examples/gitmodel/Git.h
- /build/witty-aQS8OP/witty-3.2.1/examples/gitmodel/Git.C