forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIFCblorbProblem.m
More file actions
58 lines (43 loc) · 1.29 KB
/
IFCblorbProblem.m
File metadata and controls
58 lines (43 loc) · 1.29 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
//
// IFCblorbProblem.m
// Inform-xc2
//
// Created by Andrew Hunter on 28/01/2006.
// Copyright 2006 Andrew Hunter. All rights reserved.
//
#import "IFCblorbProblem.h"
@implementation IFCblorbProblem
- (id) initWithBuildDir: (NSString*) newBuildDir {
self = [super init];
if (self) {
buildDir = [newBuildDir copy];
}
return self;
}
- (void) dealloc {
[buildDir autorelease]; buildDir = nil;
[super dealloc];
}
- (NSURL*) urlForProblemWithErrorCode: (int) errorCode {
// If a build directory is supplied, then look there for the error file
if (buildDir) {
NSString* errorPath = [buildDir stringByAppendingPathComponent: @"StatusCblorb.html"];
if ([[NSFileManager defaultManager] fileExistsAtPath: errorPath]) {
return [NSURL fileURLWithPath: errorPath];
}
}
// Otherwise, use the default
return [NSURL URLWithString: @"inform:/ErrorCblorb.html"];
}
- (NSURL*) urlForSuccess {
// If a build directory is supplied, then look there for the error file
if (buildDir) {
NSString* errorPath = [buildDir stringByAppendingPathComponent: @"StatusCblorb.html"];
if ([[NSFileManager defaultManager] fileExistsAtPath: errorPath]) {
return [NSURL fileURLWithPath: errorPath];
}
}
// Otherwise, use the default
return [NSURL URLWithString: @"inform:/GoodCblorb.html"];
}
@end