mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
c17215e55e
This is a convenience class to replace using NSStrings to store and compare SHAs. PBGitSHA has a much faster isEqual: function. It is <NSCopying> compliant and implements isEqual: and hash so it can be used as a key in dictionaries.
29 lines
522 B
Objective-C
29 lines
522 B
Objective-C
//
|
|
// PBGitSHA.h
|
|
// GitX
|
|
//
|
|
// Created by BrotherBard on 3/28/10.
|
|
// Copyright 2010 BrotherBard. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
#include "git/oid.h"
|
|
|
|
|
|
@interface PBGitSHA : NSObject <NSCopying> {
|
|
git_oid oid;
|
|
NSString *string;
|
|
}
|
|
|
|
|
|
+ (PBGitSHA *)shaWithOID:(git_oid)oid;
|
|
+ (PBGitSHA *)shaWithString:(NSString *)shaString;
|
|
+ (PBGitSHA *)shaWithCString:(const char *)shaCString;
|
|
|
|
- (BOOL)isEqualToOID:(git_oid)other_oid;
|
|
|
|
@property (readonly) git_oid oid;
|
|
@property (readonly) NSString *string;
|
|
|
|
@end
|