xpcom/io/nsIUnicharOutputStream.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/io/nsIUnicharOutputStream.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +/**
    1.12 + * An interface that allows writing unicode data.
    1.13 + */
    1.14 +[scriptable, uuid(2d00b1bb-8b21-4a63-bcc6-7213f513ac2e)]
    1.15 +interface nsIUnicharOutputStream : nsISupports
    1.16 +{
    1.17 +    /**
    1.18 +     * Write a single character to the stream. When writing many characters,
    1.19 +     * prefer the string-taking write method.
    1.20 +     *
    1.21 +     * @retval true The character was written successfully
    1.22 +     * @retval false Not all bytes of the character could be written.
    1.23 +     */
    1.24 +    boolean write(in unsigned long aCount,
    1.25 +                  [const, array, size_is(aCount)] in char16_t c);
    1.26 +
    1.27 +    /**
    1.28 +     * Write a string to the stream.
    1.29 +     *
    1.30 +     * @retval true The string was written successfully
    1.31 +     * @retval false Not all bytes of the string could be written.
    1.32 +     */
    1.33 +    boolean writeString(in AString str);
    1.34 +
    1.35 +    /**
    1.36 +     * Flush the stream. This finishes the conversion and writes any bytes that
    1.37 +     * finish the current byte sequence.
    1.38 +     *
    1.39 +     * It does NOT flush the underlying stream.
    1.40 +     *
    1.41 +     * @see nsIUnicodeEncoder::Finish
    1.42 +     */
    1.43 +    void flush();
    1.44 +
    1.45 +    /**
    1.46 +     * Close the stream and free associated resources. This also closes the
    1.47 +     * underlying stream.
    1.48 +     */
    1.49 +    void close();
    1.50 +};

mercurial