xpcom/io/nsIMultiplexInputStream.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/io/nsIMultiplexInputStream.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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 "nsIInputStream.idl"
    1.10 +
    1.11 +/**
    1.12 + * The multiplex stream concatenates a list of input streams into a single
    1.13 + * stream.
    1.14 + */
    1.15 +
    1.16 +[scriptable, uuid(a076fd12-1dd1-11b2-b19a-d53b5dffaade)]
    1.17 +interface nsIMultiplexInputStream : nsIInputStream
    1.18 +{
    1.19 +    /**
    1.20 +     * Number of streams in this multiplex-stream
    1.21 +     */
    1.22 +    readonly attribute unsigned long count;
    1.23 +
    1.24 +    /**
    1.25 +     * Appends a stream to the end of the streams. The cursor of the stream
    1.26 +     * should be located at the beginning of the stream if the implementation
    1.27 +     * of this nsIMultiplexInputStream also is used as an nsISeekableStream.
    1.28 +     * @param stream  stream to append
    1.29 +     */
    1.30 +    void appendStream(in nsIInputStream stream);
    1.31 +
    1.32 +    /**
    1.33 +     * Insert a stream at specified index.  If the cursor of this stream is at
    1.34 +     * the beginning of the stream at index, the cursor will be placed at the
    1.35 +     * beginning of the inserted stream instead.
    1.36 +     * The cursor of the new stream should be located at the beginning of the
    1.37 +     * stream if the implementation of this nsIMultiplexInputStream also is
    1.38 +     * used as an nsISeekableStream.
    1.39 +     * @param stream  stream to insert
    1.40 +     * @param index   index to insert stream at, must be <= count
    1.41 +     */
    1.42 +    void insertStream(in nsIInputStream stream, in unsigned long index);
    1.43 +
    1.44 +    /**
    1.45 +     * Remove stream at specified index. If this stream is the one currently
    1.46 +     * being read the readcursor is moved to the beginning of the next
    1.47 +     * stream
    1.48 +     * @param index   remove stream at this index, must be < count
    1.49 +     */
    1.50 +    void removeStream(in unsigned long index);
    1.51 +
    1.52 +    /**
    1.53 +     * Get stream at specified index.
    1.54 +     * @param index   return stream at this index, must be < count
    1.55 +     * @return        stream at specified index
    1.56 +     */
    1.57 +    nsIInputStream getStream(in unsigned long index);
    1.58 +};

mercurial