Backed out 2 changesets (bug 1908320) for causing wr failures on align-items-baseline...
[gecko.git] / xpcom / io / nsISeekableStream.idl
blobb12a7f9baf604a7e9d3442021b52b76a7c4f0fa3
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/. */
7 #include "nsITellableStream.idl"
9 /*
10 * nsISeekableStream
12 * Note that a stream might not implement all methods (e.g., a readonly stream
13 * won't implement setEOF)
16 #include "nsISupports.idl"
18 [scriptable, uuid(8429d350-1040-4661-8b71-f2a6ba455980)]
19 interface nsISeekableStream : nsITellableStream
22 * Sets the stream pointer to the value of the 'offset' parameter
24 const int32_t NS_SEEK_SET = 0;
27 * Sets the stream pointer to its current location plus the value
28 * of the offset parameter.
30 const int32_t NS_SEEK_CUR = 1;
33 * Sets the stream pointer to the size of the stream plus the value
34 * of the offset parameter.
36 const int32_t NS_SEEK_END = 2;
38 /**
39 * seek
41 * This method moves the stream offset of the steam implementing this
42 * interface.
44 * @param whence specifies how to interpret the 'offset' parameter in
45 * setting the stream offset associated with the implementing
46 * stream.
48 * @param offset specifies a value, in bytes, that is used in conjunction
49 * with the 'whence' parameter to set the stream offset of the
50 * implementing stream. A negative value causes seeking in
51 * the reverse direction.
53 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
55 void seek(in long whence, in long long offset);
57 /**
58 * setEOF
60 * This method truncates the stream at the current offset.
62 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
64 void setEOF();