nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9a73f7
)
lib/cocoa: add services to `NSString` to convert to Nit strings
author
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 16 Nov 2015 21:01:17 +0000
(16:01 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 9 Feb 2016 19:41:47 +0000
(14:41 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/cocoa/foundation.nit
patch
|
blob
|
history
diff --git
a/lib/cocoa/foundation.nit
b/lib/cocoa/foundation.nit
index
06c8ffd
..
c476df9
100644
(file)
--- a/
lib/cocoa/foundation.nit
+++ b/
lib/cocoa/foundation.nit
@@
-30,6
+30,11
@@
end
# Created using `Text::to_nsstring`.
extern class NSString in "ObjC" `{ NSString * `}
super NSObject
+
+ # Get an UTF8 encoded `char*` copy of `self`
+ fun utf8_string: NativeString in "ObjC" `{ return (char *)[self UTF8String]; `}
+
+ redef fun to_s do return utf8_string.to_s
end
redef class NativeString