Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIInputStream.idl
3 : */
4 :
5 : #ifndef __gen_nsIInputStream_h__
6 : #define __gen_nsIInputStream_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : /* For IDL files that don't want to include root IDL files. */
14 : #ifndef NS_NO_VTABLE
15 : #define NS_NO_VTABLE
16 : #endif
17 : class nsIInputStream; /* forward declaration */
18 :
19 : /**
20 : * The signature of the writer function passed to ReadSegments. This
21 : * is the "consumer" of data that gets read from the stream's buffer.
22 : *
23 : * @param aInStream stream being read
24 : * @param aClosure opaque parameter passed to ReadSegments
25 : * @param aFromSegment pointer to memory owned by the input stream. This is
26 : * where the writer function should start consuming data.
27 : * @param aToOffset amount of data already consumed by this writer during this
28 : * ReadSegments call. This is also the sum of the aWriteCount
29 : * returns from this writer over the previous invocations of
30 : * the writer by this ReadSegments call.
31 : * @param aCount Number of bytes available to be read starting at aFromSegment
32 : * @param [out] aWriteCount number of bytes read by this writer function call
33 : *
34 : * Implementers should return the following:
35 : *
36 : * @return NS_OK and (*aWriteCount > 0) if consumed some data
37 : * @return <any-error> if not interested in consuming any data
38 : *
39 : * Errors are never passed to the caller of ReadSegments.
40 : *
41 : * NOTE: returning NS_OK and (*aWriteCount = 0) has undefined behavior.
42 : */
43 : typedef nsresult (*nsWriteSegmentFun)(nsIInputStream *aInStream,
44 : void *aClosure,
45 : const char *aFromSegment,
46 : uint32_t aToOffset,
47 : uint32_t aCount,
48 : uint32_t *aWriteCount);
49 :
50 : /* starting interface: nsIInputStream */
51 : #define NS_IINPUTSTREAM_IID_STR "53cdbc97-c2d7-4e30-b2c3-45b2ee79db18"
52 :
53 : #define NS_IINPUTSTREAM_IID \
54 : {0x53cdbc97, 0xc2d7, 0x4e30, \
55 : { 0xb2, 0xc3, 0x45, 0xb2, 0xee, 0x79, 0xdb, 0x18 }}
56 :
57 867 : class NS_NO_VTABLE nsIInputStream : public nsISupports {
58 : public:
59 :
60 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAM_IID)
61 :
62 : /* void close (); */
63 : NS_IMETHOD Close(void) = 0;
64 :
65 : /* unsigned long long available (); */
66 : NS_IMETHOD Available(uint64_t *_retval) = 0;
67 :
68 : /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
69 : NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) = 0;
70 :
71 : /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
72 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) = 0;
73 :
74 : /* boolean isNonBlocking (); */
75 : NS_IMETHOD IsNonBlocking(bool *_retval) = 0;
76 :
77 : };
78 :
79 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStream, NS_IINPUTSTREAM_IID)
80 :
81 : /* Use this macro when declaring classes that implement this interface. */
82 : #define NS_DECL_NSIINPUTSTREAM \
83 : NS_IMETHOD Close(void) override; \
84 : NS_IMETHOD Available(uint64_t *_retval) override; \
85 : NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) override; \
86 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) override; \
87 : NS_IMETHOD IsNonBlocking(bool *_retval) override;
88 :
89 : /* Use this macro when declaring the members of this interface when the
90 : class doesn't implement the interface. This is useful for forwarding. */
91 : #define NS_DECL_NON_VIRTUAL_NSIINPUTSTREAM \
92 : nsresult Close(void); \
93 : nsresult Available(uint64_t *_retval); \
94 : nsresult Read(char *aBuf, uint32_t aCount, uint32_t *_retval); \
95 : nsresult ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval); \
96 : nsresult IsNonBlocking(bool *_retval);
97 :
98 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
99 : #define NS_FORWARD_NSIINPUTSTREAM(_to) \
100 : NS_IMETHOD Close(void) override { return _to Close(); } \
101 : NS_IMETHOD Available(uint64_t *_retval) override { return _to Available(_retval); } \
102 : NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) override { return _to Read(aBuf, aCount, _retval); } \
103 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) override { return _to ReadSegments(aWriter, aClosure, aCount, _retval); } \
104 : NS_IMETHOD IsNonBlocking(bool *_retval) override { return _to IsNonBlocking(_retval); }
105 :
106 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
107 : #define NS_FORWARD_SAFE_NSIINPUTSTREAM(_to) \
108 : NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
109 : NS_IMETHOD Available(uint64_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
110 : NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aBuf, aCount, _retval); } \
111 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadSegments(aWriter, aClosure, aCount, _retval); } \
112 : NS_IMETHOD IsNonBlocking(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNonBlocking(_retval); }
113 :
114 : #if 0
115 : /* Use the code below as a template for the implementation class for this interface. */
116 :
117 : /* Header file */
118 : class nsInputStream : public nsIInputStream
119 : {
120 : public:
121 : NS_DECL_ISUPPORTS
122 : NS_DECL_NSIINPUTSTREAM
123 :
124 : nsInputStream();
125 :
126 : private:
127 : ~nsInputStream();
128 :
129 : protected:
130 : /* additional members */
131 : };
132 :
133 : /* Implementation file */
134 : NS_IMPL_ISUPPORTS(nsInputStream, nsIInputStream)
135 :
136 : nsInputStream::nsInputStream()
137 : {
138 : /* member initializers and constructor code */
139 : }
140 :
141 : nsInputStream::~nsInputStream()
142 : {
143 : /* destructor code */
144 : }
145 :
146 : /* void close (); */
147 : NS_IMETHODIMP nsInputStream::Close()
148 : {
149 : return NS_ERROR_NOT_IMPLEMENTED;
150 : }
151 :
152 : /* unsigned long long available (); */
153 : NS_IMETHODIMP nsInputStream::Available(uint64_t *_retval)
154 : {
155 : return NS_ERROR_NOT_IMPLEMENTED;
156 : }
157 :
158 : /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
159 : NS_IMETHODIMP nsInputStream::Read(char *aBuf, uint32_t aCount, uint32_t *_retval)
160 : {
161 : return NS_ERROR_NOT_IMPLEMENTED;
162 : }
163 :
164 : /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
165 : NS_IMETHODIMP nsInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval)
166 : {
167 : return NS_ERROR_NOT_IMPLEMENTED;
168 : }
169 :
170 : /* boolean isNonBlocking (); */
171 : NS_IMETHODIMP nsInputStream::IsNonBlocking(bool *_retval)
172 : {
173 : return NS_ERROR_NOT_IMPLEMENTED;
174 : }
175 :
176 : /* End of implementation class template. */
177 : #endif
178 :
179 :
180 : #endif /* __gen_nsIInputStream_h__ */
|