-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathGTDiffFile.h
More file actions
62 lines (46 loc) · 1.75 KB
/
GTDiffFile.h
File metadata and controls
62 lines (46 loc) · 1.75 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// GTDiffFile.h
// ObjectiveGitFramework
//
// Created by Danny Greg on 30/11/2012.
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <git2/diff.h>
/// Flags which may be set on the file.
///
/// GTDiffFileFlagBinaryMask - A mask to just retrieve the binary/not binary
/// information from a set of flags.
///
/// See diff.h for further documentation.
typedef NS_OPTIONS(NSInteger, GTDiffFileFlag) {
GTDiffFileFlagValidID = GIT_DIFF_FLAG_VALID_ID,
GTDiffFileFlagBinary = GIT_DIFF_FLAG_BINARY,
GTDiffFileFlagNotBinary = GIT_DIFF_FLAG_NOT_BINARY,
GTDiffFileFlagBinaryMask = GTDiffFileFlagBinary | GTDiffFileFlagNotBinary,
};
@class GTOID;
NS_ASSUME_NONNULL_BEGIN
/// A class representing a file on one side of a diff.
@interface GTDiffFile : NSObject
/// The location within the working directory of the file.
@property (nonatomic, readonly, copy) NSString *path;
/// The size (in bytes) of the file.
@property (nonatomic, readonly) NSUInteger size;
/// Any flags set on the file (see `GTDiffFileFlag` for more info).
@property (nonatomic, readonly) GTDiffFileFlag flags;
/// The mode of the file.
@property (nonatomic, readonly) mode_t mode;
/// The OID for the file.
@property (nonatomic, readonly, copy, nullable) GTOID *OID;
/// The git_diff_file represented by the receiver.
@property (nonatomic, readonly) git_diff_file git_diff_file;
- (instancetype)init NS_UNAVAILABLE;
/// Initializes the receiver with the provided libgit2 object. Designated initializer.
///
/// file - The git_diff_file wrapped by the receiver.
///
/// Returns an initialized GTDiffFile.
- (nullable instancetype)initWithGitDiffFile:(git_diff_file)file NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END