16class Blob :
public TypedObject<git_blob> {
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;
std::string_view contentView() const noexcept
Get the content of this Blob (as a string_view).
Definition Blob.h:28
GitTy * blob() const noexcept
Get the stored pointer to libgit2's git_blob.
Definition Blob.h:33
std::string content() const noexcept
Get the content of this Blob (as a string).
Definition Blob.h:24
const Repo & repo() const
Get the Repo this Object lives in.
Definition Object.h:38
git_blob * typed() const noexcept
Definition Object.h:83