michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIInputStream.idl" michael@0: michael@0: /** michael@0: * The multiplex stream concatenates a list of input streams into a single michael@0: * stream. michael@0: */ michael@0: michael@0: [scriptable, uuid(a076fd12-1dd1-11b2-b19a-d53b5dffaade)] michael@0: interface nsIMultiplexInputStream : nsIInputStream michael@0: { michael@0: /** michael@0: * Number of streams in this multiplex-stream michael@0: */ michael@0: readonly attribute unsigned long count; michael@0: michael@0: /** michael@0: * Appends a stream to the end of the streams. The cursor of the stream michael@0: * should be located at the beginning of the stream if the implementation michael@0: * of this nsIMultiplexInputStream also is used as an nsISeekableStream. michael@0: * @param stream stream to append michael@0: */ michael@0: void appendStream(in nsIInputStream stream); michael@0: michael@0: /** michael@0: * Insert a stream at specified index. If the cursor of this stream is at michael@0: * the beginning of the stream at index, the cursor will be placed at the michael@0: * beginning of the inserted stream instead. michael@0: * The cursor of the new stream should be located at the beginning of the michael@0: * stream if the implementation of this nsIMultiplexInputStream also is michael@0: * used as an nsISeekableStream. michael@0: * @param stream stream to insert michael@0: * @param index index to insert stream at, must be <= count michael@0: */ michael@0: void insertStream(in nsIInputStream stream, in unsigned long index); michael@0: michael@0: /** michael@0: * Remove stream at specified index. If this stream is the one currently michael@0: * being read the readcursor is moved to the beginning of the next michael@0: * stream michael@0: * @param index remove stream at this index, must be < count michael@0: */ michael@0: void removeStream(in unsigned long index); michael@0: michael@0: /** michael@0: * Get stream at specified index. michael@0: * @param index return stream at this index, must be < count michael@0: * @return stream at specified index michael@0: */ michael@0: nsIInputStream getStream(in unsigned long index); michael@0: };