forked from erkyrath/Inform7-IDE-Mac
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIFIntelFile.h
More file actions
48 lines (38 loc) · 2.19 KB
/
IFIntelFile.h
File metadata and controls
48 lines (38 loc) · 2.19 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
//
// IFIntelFile.h
// Inform
//
// Created by Andrew Hunter on 05/02/2005.
// Copyright 2005 Andrew Hunter. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "IFIntelSymbol.h"
extern NSString* IFIntelFileHasChangedNotification;
//
// 'Intelligence' data for a file.
// Basically, maintains a linked list of symbols gathered from a file.
//
// Contains the details stored about a file, and the means to access them
//
@interface IFIntelFile : NSObject {
// Data
NSMutableArray* symbols; // List of symbols added to the file
int* symbolLines; // We access this a lot: C-style array is faster. The line number each symbol in the symbols array occurs on (ie, one entry per symbol)
// Notifications
BOOL notificationPending; // YES if we're preparing to send a notification that this object has changed
}
// Adding and removing symbols
- (void) insertLineBeforeLine: (int) line; // Updates the symbol list as if someone has inserted a new line before the given line
- (void) removeLines: (NSRange) lines; // Removes lines and symbols in the given range (ie, update the symbol locations as if the user had deleted the given range of lines)
- (void) clearSymbolsForLines: (NSRange) lines; // Removes symbols for the given range of lines
- (void) addSymbol: (IFIntelSymbol*) symbol // Adds a new symbol at the given line number
atLine: (int) line;
// Finding symbols
- (IFIntelSymbol*) firstSymbol; // First symbol stored in this object
- (IFIntelSymbol*) nearestSymbolToLine: (int) line; // Nearest symbol to a given line number (first symbol on the line if there are any symbols for that line, or the first symbol on the line before if not)
- (IFIntelSymbol*) firstSymbolOnLine: (int) line; // nil if there are no symbols for the given line, or the first symbol for that line otherwise
- (IFIntelSymbol*) lastSymbolOnLine: (int) line; // nil if there are no symbols for the given line, or the last symbol for that line otherwise
- (NSInteger) lineForSymbol: (IFIntelSymbol*) symbolToFind; // Given a symbol, works out which line number it occurs on
// Sending notifications
- (void) intelFileHasChanged; // Requests that a notification be sent that this object has changed
@end