1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
10 * Note that a stream might not implement all methods (e.g., a readonly stream
11 * won't implement setEOF)
14 #include
"nsISupports.idl"
16 [scriptable
, uuid(8429d350
-1040-4661-8b71
-f2a6ba455980
)]
17 interface nsISeekableStream
: nsISupports
20 * Sets the stream pointer to the value of the 'offset' parameter
22 const int32_t NS_SEEK_SET
= 0;
25 * Sets the stream pointer to its current location plus the value
26 * of the offset parameter.
28 const int32_t NS_SEEK_CUR
= 1;
31 * Sets the stream pointer to the size of the stream plus the value
32 * of the offset parameter.
34 const int32_t NS_SEEK_END
= 2;
39 * This method moves the stream offset of the steam implementing this
42 * @param whence specifies how to interpret the 'offset' parameter in
43 * setting the stream offset associated with the implementing
46 * @param offset specifies a value, in bytes, that is used in conjunction
47 * with the 'whence' parameter to set the stream offset of the
48 * implementing stream. A negative value causes seeking in
49 * the reverse direction.
51 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
53 void seek
(in long whence
, in long long offset
);
58 * This method reports the current offset, in bytes, from the start of the
61 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
69 * This method truncates the stream at the current offset.
71 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.