lib: remove remaining declaration of old-style attributes.
[nit.git] / lib / string_experimentations / utf8.nit
index b1ba7d1..14f8550 100644 (file)
@@ -16,6 +16,7 @@
 module utf8
 
 intrude import standard::string
+intrude import standard::file
 
 in "C Header" `{
 
@@ -396,3 +397,17 @@ redef class NativeString
                return new FlatString.with_infos_index(new_self, real_len.item, 0, real_len.item - 1, x, length)
        end
 end
+
+redef class OFStream
+       redef fun write(s)
+       do
+               assert is_writable
+               if s isa FlatText then
+                       if s isa FlatString then
+                               write_native(s.to_cstring, s.bytelen)
+                       else
+                               write_native(s.to_cstring, s.length)
+                       end
+               else for i in s.substrings do write_native(i.to_cstring, i.length)
+       end
+end