[libgit2-glib] Added ggit_blob_is_binary
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Added ggit_blob_is_binary
- Date: Wed, 25 Jun 2014 08:49:15 +0000 (UTC)
commit 1b36e4ced6f056bb3b3d47711be5fe9653b3d725
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Wed Jun 25 10:49:01 2014 +0200
Added ggit_blob_is_binary
libgit2-glib/ggit-blob.c | 17 +++++++++++++++++
libgit2-glib/ggit-blob.h | 2 ++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-blob.c b/libgit2-glib/ggit-blob.c
index cf537e3..3f2803e 100644
--- a/libgit2-glib/ggit-blob.c
+++ b/libgit2-glib/ggit-blob.c
@@ -86,4 +86,21 @@ ggit_blob_get_raw_content (GgitBlob *blob,
return (const guchar *)git_blob_rawcontent (b);
}
+/**
+ * ggit_blob_is_binary:
+ * @blob: a #GgitBlob.
+ *
+ * Check whether the blob is binary.
+ *
+ * Returns: %TRUE if the blob is binary, %FALSE otherwise.
+ *
+ **/
+gboolean
+ggit_blob_is_binary (GgitBlob *blob)
+{
+ g_return_val_if_fail (GGIT_IS_BLOB (blob), FALSE);
+
+ return git_blob_is_binary (_ggit_native_get (blob));
+}
+
/* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-blob.h b/libgit2-glib/ggit-blob.h
index ebb0757..22aaa3d 100644
--- a/libgit2-glib/ggit-blob.h
+++ b/libgit2-glib/ggit-blob.h
@@ -68,6 +68,8 @@ GgitBlob *_ggit_blob_wrap (git_blob *blob,
const guchar *ggit_blob_get_raw_content (GgitBlob *blob,
gsize *length);
+gboolean ggit_blob_is_binary (GgitBlob *blob);
+
G_END_DECLS
#endif /* __GGIT_BLOB_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]