17 using GitTy = git_blob;
25 return std::string(static_cast<const char *>(rawcontent()), rawsize());
29 return std::string_view(static_cast<const char *>(rawcontent()), rawsize());
35 git_object_size_t rawsize() const noexcept {
return git_blob_rawsize(
blob()); }
36 const void *rawcontent() const noexcept {
return git_blob_rawcontent(
blob()); }
39 explicit Blob(
const Repo &
repo, GitTy *
blob) noexcept;
Git Object class – base for Blob, Commit, Tag, Tree.
Definition: Object.h:65
std::string_view contentView() const noexcept
Get the content of this Blob (as a string_view)
Definition: Blob.h:28
The most important Git class.
Definition: Repo.h:45
Blob is a representation of a git blob.
Definition: Blob.h:16
git_blob * typed() const noexcept
Get the stored pointer typed to one of libgit2's types.
Definition: Object.h:83
GitTy * blob() const noexcept
Get the stored pointer to libgit2's git_blob.
Definition: Blob.h:33
const Repo & repo() const
Get the Repo this Object lives in.
Definition: Object.h:38
std::string content() const noexcept
Get the content of this Blob (as a string)
Definition: Blob.h:24