Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / xpcom / io / nsIUnicharOutputStream.idl
blob743f532e03d5c91e5bb4c62449693a63beff432d
1 /* vim:set expandtab ts=4 sw=4 sts=4 cin: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 /**
9 * An interface that allows writing unicode data.
11 [scriptable, uuid(2d00b1bb-8b21-4a63-bcc6-7213f513ac2e)]
12 interface nsIUnicharOutputStream : nsISupports
14 /**
15 * Write a single character to the stream. When writing many characters,
16 * prefer the string-taking write method.
18 * @retval true The character was written successfully
19 * @retval false Not all bytes of the character could be written.
21 boolean write(in unsigned long aCount,
22 [const, array, size_is(aCount)] in char16_t c);
24 /**
25 * Write a string to the stream.
27 * @retval true The string was written successfully
28 * @retval false Not all bytes of the string could be written.
30 boolean writeString(in AString str);
32 /**
33 * Flush the stream. This finishes the conversion and writes any bytes that
34 * finish the current byte sequence.
36 * It does NOT flush the underlying stream.
38 void flush();
40 /**
41 * Close the stream and free associated resources. This also closes the
42 * underlying stream.
44 void close();