Files
gitx/PBGitSHA.h
T
Nathan Kinsinger c17215e55e Create wrapper class around git_oid and use it
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.
2010-07-04 09:46:12 -06:00

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