Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMutableString.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
11 * Port to the D Programming language: | 11 * Port to the D Programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSMutableString; | 14 module dwt.internal.cocoa.NSMutableString; |
15 | 15 |
16 import dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSInteger; | 17 import dwt.internal.cocoa.NSInteger; |
18 import dwt.internal.cocoa.NSRange; | |
17 import dwt.internal.cocoa.NSString; | 19 import dwt.internal.cocoa.NSString; |
18 import dwt.internal.cocoa.OS; | 20 import dwt.internal.cocoa.OS; |
19 import objc = dwt.internal.objc.runtime; | 21 import objc = dwt.internal.objc.runtime; |
20 | 22 |
21 public class NSMutableString : NSString | 23 public class NSMutableString : NSString |
31 super(id); | 33 super(id); |
32 } | 34 } |
33 | 35 |
34 public void appendFormat (NSString appendFormat) | 36 public void appendFormat (NSString appendFormat) |
35 { | 37 { |
36 OS.objc_msgSend(this.id, OS.sel_appendFormat_1, appendFormat !is null ? appendFormat.id : null); | 38 OS.objc_msgSend(this.id_, OS.sel_appendFormat_1, appendFormat !is null ? appendFormat.id_ : null); |
37 } | 39 } |
38 | 40 |
39 public void appendString (NSString aString) | 41 public void appendString (NSString aString) |
40 { | 42 { |
41 OS.objc_msgSend(this.id, OS.sel_appendString_1, aString !is null ? aString.id : null); | 43 OS.objc_msgSend(this.id_, OS.sel_appendString_1, aString !is null ? aString.id_ : null); |
42 } | 44 } |
43 | 45 |
44 public void deleteCharactersInRange (NSRange range) | 46 public void deleteCharactersInRange (NSRange range) |
45 { | 47 { |
46 OS.objc_msgSend(this.id, OS.sel_deleteCharactersInRange_1, range); | 48 OS.objc_msgSend(this.id_, OS.sel_deleteCharactersInRange_1, range); |
47 } | 49 } |
48 | 50 |
49 public NSMutableString initWithCapacity (NSUInteger capacity) | 51 public NSMutableString initWithCapacity (NSUInteger capacity) |
50 { | 52 { |
51 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, capacity); | 53 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCapacity_1, capacity); |
52 return result !is null ? this : null; | 54 return result !is null ? this : null; |
53 } | 55 } |
54 | 56 |
55 public void insertString (NSString aString, NSUInteger loc) | 57 public void insertString (NSString aString, NSUInteger loc) |
56 { | 58 { |
57 OS.objc_msgSend(this.id, OS.sel_insertString_1atIndex_1, aString !is null ? aString.id : null, loc); | 59 OS.objc_msgSend(this.id_, OS.sel_insertString_1atIndex_1, aString !is null ? aString.id_ : null, loc); |
58 } | 60 } |
59 | 61 |
60 public void replaceCharactersInRange (NSRange range, NSString aString) | 62 public void replaceCharactersInRange (NSRange range, NSString aString) |
61 { | 63 { |
62 OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withString_1, range, aString !is null ? aString.id : null); | 64 OS.objc_msgSend(this.id_, OS.sel_replaceCharactersInRange_1withString_1, range, aString !is null ? aString.id_ : null); |
63 } | 65 } |
64 | 66 |
65 public NSUInteger replaceOccurrencesOfString (NSString target, NSString replacement, int options, NSRange searchRange) | 67 public NSUInteger replaceOccurrencesOfString (NSString target, NSString replacement, NSStringCompareOptions options, NSRange searchRange) |
66 { | 68 { |
67 return cast(NSUInteger) OS.objc_msgSend(this.id, OS.sel_replaceOccurrencesOfString_1withString_1options_1range_1, target !is null ? target.id : null, | 69 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_replaceOccurrencesOfString_1withString_1options_1range_1, target !is null ? target.id_ : null, |
68 replacement !is null ? replacement.id : null, options, searchRange); | 70 replacement !is null ? replacement.id_ : null, options, searchRange); |
69 } | 71 } |
70 | 72 |
71 public void setString (NSString aString) | 73 public void setString (NSString aString) |
72 { | 74 { |
73 OS.objc_msgSend(this.id, OS.sel_setString_1, aString !is null ? aString.id : null); | 75 OS.objc_msgSend(this.id_, OS.sel_setString_1, aString !is null ? aString.id_ : null); |
74 } | 76 } |
75 | 77 |
76 public static id stringWithCapacity (NSUInteger capacity) | 78 public static id stringWithCapacity (NSUInteger capacity) |
77 { | 79 { |
78 objc.id result = OS.objc_msgSend(OS.class_NSMutableString, OS.sel_stringWithCapacity_1, capacity); | 80 objc.id result = OS.objc_msgSend(OS.class_NSMutableString, OS.sel_stringWithCapacity_1, capacity); |