Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMutableData.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 |
---|---|
33 super(id); | 33 super(id); |
34 } | 34 } |
35 | 35 |
36 public void appendBytes (/*const*/void* bytes, NSUInteger length) | 36 public void appendBytes (/*const*/void* bytes, NSUInteger length) |
37 { | 37 { |
38 OS.objc_msgSend(this.id, OS.sel_appendBytes_1length_1, bytes, length); | 38 OS.objc_msgSend(this.id_, OS.sel_appendBytes_1length_1, bytes, length); |
39 } | 39 } |
40 | 40 |
41 public void appendData (NSData other) | 41 public void appendData (NSData other) |
42 { | 42 { |
43 OS.objc_msgSend(this.id, OS.sel_appendData_1, other !is null ? other.id : null); | 43 OS.objc_msgSend(this.id_, OS.sel_appendData_1, other !is null ? other.id_ : null); |
44 } | 44 } |
45 | 45 |
46 public static id dataWithCapacity (NSUInteger aNumItems) | 46 public static id dataWithCapacity (NSUInteger aNumItems) |
47 { | 47 { |
48 objc.id result = OS.objc_msgSend(OS.class_NSMutableData, OS.sel_dataWithCapacity_1, aNumItems); | 48 objc.id result = OS.objc_msgSend(OS.class_NSMutableData, OS.sel_dataWithCapacity_1, aNumItems); |
55 return result !is null ? new id(result) : null; | 55 return result !is null ? new id(result) : null; |
56 } | 56 } |
57 | 57 |
58 public void increaseLengthBy (NSUInteger extraLength) | 58 public void increaseLengthBy (NSUInteger extraLength) |
59 { | 59 { |
60 OS.objc_msgSend(this.id, OS.sel_increaseLengthBy_1, extraLength); | 60 OS.objc_msgSend(this.id_, OS.sel_increaseLengthBy_1, extraLength); |
61 } | 61 } |
62 | 62 |
63 public NSMutableData initWithCapacity (NSUInteger capacity) | 63 public NSMutableData initWithCapacity (NSUInteger capacity) |
64 { | 64 { |
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, capacity); | 65 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCapacity_1, capacity); |
66 return result !is null ? this : null; | 66 return result !is null ? this : null; |
67 } | 67 } |
68 | 68 |
69 public NSMutableData initWithLength (NSUInteger length) | 69 public NSMutableData initWithLength (NSUInteger length) |
70 { | 70 { |
71 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithLength_1, length); | 71 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithLength_1, length); |
72 return result !is null ? this : null; | 72 return result !is null ? this : null; |
73 } | 73 } |
74 | 74 |
75 public void* mutableBytes () | 75 public void* mutableBytes () |
76 { | 76 { |
77 return OS.objc_msgSend(this.id, OS.sel_mutableBytes); | 77 return OS.objc_msgSend(this.id_, OS.sel_mutableBytes); |
78 } | 78 } |
79 | 79 |
80 public void replaceBytesInRange_withBytes_ (NSRange range, /*const*/void* bytes) | 80 public void replaceBytesInRange_withBytes_ (NSRange range, /*const*/void* bytes) |
81 { | 81 { |
82 OS.objc_msgSend(this.id, OS.sel_replaceBytesInRange_1withBytes_1, range, bytes); | 82 OS.objc_msgSend(this.id_, OS.sel_replaceBytesInRange_1withBytes_1, range, bytes); |
83 } | 83 } |
84 | 84 |
85 public void replaceBytesInRange_withBytes_length_ (NSRange range, /*const*/void* replacementBytes, NSUInteger replacementLength) | 85 public void replaceBytesInRange_withBytes_length_ (NSRange range, /*const*/void* replacementBytes, NSUInteger replacementLength) |
86 { | 86 { |
87 OS.objc_msgSend(this.id, OS.sel_replaceBytesInRange_1withBytes_1length_1, range, replacementBytes, replacementLength); | 87 OS.objc_msgSend(this.id_, OS.sel_replaceBytesInRange_1withBytes_1length_1, range, replacementBytes, replacementLength); |
88 } | 88 } |
89 | 89 |
90 public void resetBytesInRange (NSRange range) | 90 public void resetBytesInRange (NSRange range) |
91 { | 91 { |
92 OS.objc_msgSend(this.id, OS.sel_resetBytesInRange_1, range); | 92 OS.objc_msgSend(this.id_, OS.sel_resetBytesInRange_1, range); |
93 } | 93 } |
94 | 94 |
95 public void setData (NSData data) | 95 public void setData (NSData data) |
96 { | 96 { |
97 OS.objc_msgSend(this.id, OS.sel_setData_1, data !is null ? data.id : null); | 97 OS.objc_msgSend(this.id_, OS.sel_setData_1, data !is null ? data.id_ : null); |
98 } | 98 } |
99 | 99 |
100 public void setLength (NSUInteger length) | 100 public void setLength (NSUInteger length) |
101 { | 101 { |
102 OS.objc_msgSend(this.id, OS.sel_setLength_1, length); | 102 OS.objc_msgSend(this.id_, OS.sel_setLength_1, length); |
103 } | 103 } |
104 | 104 |
105 } | 105 } |