-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathNSData+Git.h
More file actions
36 lines (28 loc) · 1.15 KB
/
NSData+Git.h
File metadata and controls
36 lines (28 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// NSData+Git.h
//
#import <Foundation/Foundation.h>
#import <ObjectiveGit/git2/buffer.h>
#import <ObjectiveGit/git2/oid.h>
@interface NSData (Git)
+ (NSData *)git_dataWithOid:(git_oid *)oid;
- (BOOL)git_getOid:(git_oid *)oid error:(NSError * __autoreleasing *)error;
/// Creates an NSData object that will take ownership of a libgit2 buffer.
///
/// buffer - A buffer of data to wrap in NSData, which will be copied if
/// necessary. This method will replace the buffer's content with
/// a NULL pointer on success. This argument must not be NULL.
///
/// Returns the wrapped data, or nil if memory allocation fails.
+ (instancetype)git_dataWithBuffer:(git_buf *)buffer;
/// Returns a read-only libgit2 buffer that will proxy the current bytes of the
/// receiver. If the length of the receiver changes after this method, the
/// behavior of the returned buffer is undefined.
- (git_buf)git_buf;
/// Creates a git_buf from the data and then checks if the buffer contains a NUL
/// byte.
- (BOOL)git_containsNUL;
/// Creates a git_buf from the data and then checks if the buffer looks like it
/// contains binary data.
- (BOOL)git_isBinary;
@end