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. |
Git object Id.
Class for compactly storing a 20-byte SHA1 digest.
Definition at line 38 of file Git.h.
Git::ObjectId::ObjectId | ( | const std::string & | id | ) | [explicit] |
Construct from a 40-digit hexadecimal number.
Exception | : if the id does not represent a valid SHA1 digest. |
Definition at line 153 of file Git.C.
00154 { 00155 if (id.length() != 40) 00156 throw Git::Exception("Git: not a valid SHA1 id: " + id); 00157 00158 for (int i = 0; i < 20; ++i) 00159 (*this)[i] = fromHex(id[2 * i], id[2 * i + 1]); 00160 }
std::string Git::ObjectId::toString | ( | ) | const |