Fix typo in 9b54bd30006c008b4a951331b273613d5bac3abf
[pm.git] / xpcom / io / nsISeekableStream.idl
blob1be7ea60c6648df45f41231defc6d1144a334c61
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 /*
8 * nsISeekableStream
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
19 /*
20 * Sets the stream pointer to the value of the 'offset' parameter
22 const int32_t NS_SEEK_SET = 0;
24 /*
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;
30 /*
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;
36 /**
37 * seek
39 * This method moves the stream offset of the steam implementing this
40 * interface.
42 * @param whence specifies how to interpret the 'offset' parameter in
43 * setting the stream offset associated with the implementing
44 * stream.
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);
55 /**
56 * tell
58 * This method reports the current offset, in bytes, from the start of the
59 * stream.
61 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
63 long long tell();
66 /**
67 * setEOF
69 * This method truncates the stream at the current offset.
71 * @throws NS_BASE_STREAM_CLOSED if called on a closed stream.
73 void setEOF();