nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a36e60c
)
lib/core: Added easy `fill_from` method to `NativeString`
author
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 19 May 2016 20:40:32 +0000
(16:40 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Thu, 19 May 2016 20:40:32 +0000
(16:40 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/core/text/abstract_text.nit
patch
|
blob
|
history
diff --git
a/lib/core/text/abstract_text.nit
b/lib/core/text/abstract_text.nit
index
c15901e
..
a372cfc
100644
(file)
--- a/
lib/core/text/abstract_text.nit
+++ b/
lib/core/text/abstract_text.nit
@@
-2112,6
+2112,11
@@
redef class NativeString
# SEE: `abstract_text::Text` for more info on the difference
# between `Text::bytelen` and `Text::length`.
fun to_s_full(bytelen, unilen: Int): String is abstract
+
+ # Copies the content of `src` to `self`
+ #
+ # NOTE: `self` must be large enough to withold `self.bytelen` bytes
+ fun fill_from(src: Text) do src.copy_to_native(self, src.bytelen, 0, 0)
end
redef class NativeArray[E]