Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIObjectInputStream.idl
3 : */
4 :
5 : #ifndef __gen_nsIObjectInputStream_h__
6 : #define __gen_nsIObjectInputStream_h__
7 :
8 :
9 : #ifndef __gen_nsIBinaryInputStream_h__
10 : #include "nsIBinaryInputStream.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 :
18 : /* starting interface: nsIObjectInputStream */
19 : #define NS_IOBJECTINPUTSTREAM_IID_STR "6c248606-4eae-46fa-9df0-ba58502368eb"
20 :
21 : #define NS_IOBJECTINPUTSTREAM_IID \
22 : {0x6c248606, 0x4eae, 0x46fa, \
23 : { 0x9d, 0xf0, 0xba, 0x58, 0x50, 0x23, 0x68, 0xeb }}
24 :
25 76 : class NS_NO_VTABLE nsIObjectInputStream : public nsIBinaryInputStream {
26 : public:
27 :
28 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBJECTINPUTSTREAM_IID)
29 :
30 : /* nsISupports readObject (in boolean aIsStrongRef); */
31 : NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports * *_retval) = 0;
32 :
33 : /* [notxpcom] nsresult readID (out nsID aID); */
34 : NS_IMETHOD_(nsresult) ReadID(nsID *aID) = 0;
35 :
36 : /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */
37 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) = 0;
38 :
39 : /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */
40 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) = 0;
41 :
42 : };
43 :
44 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIObjectInputStream, NS_IOBJECTINPUTSTREAM_IID)
45 :
46 : /* Use this macro when declaring classes that implement this interface. */
47 : #define NS_DECL_NSIOBJECTINPUTSTREAM \
48 : NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports * *_retval) override; \
49 : NS_IMETHOD_(nsresult) ReadID(nsID *aID) override; \
50 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
51 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override;
52 :
53 : /* Use this macro when declaring the members of this interface when the
54 : class doesn't implement the interface. This is useful for forwarding. */
55 : #define NS_DECL_NON_VIRTUAL_NSIOBJECTINPUTSTREAM \
56 : nsresult ReadObject(bool aIsStrongRef, nsISupports * *_retval); \
57 : nsresult_(nsresult) ReadID(nsID *aID); \
58 : nsresult_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask); \
59 : nsresult_(void) PutBuffer(char *aBuffer, uint32_t aLength);
60 :
61 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
62 : #define NS_FORWARD_NSIOBJECTINPUTSTREAM(_to) \
63 : NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports * *_retval) override { return _to ReadObject(aIsStrongRef, _retval); } \
64 : NS_IMETHOD_(nsresult) ReadID(nsID *aID) override { return _to ReadID(aID); } \
65 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override { return _to GetBuffer(aLength, aAlignMask); } \
66 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override { return _to PutBuffer(aBuffer, aLength); }
67 :
68 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
69 : #define NS_FORWARD_SAFE_NSIOBJECTINPUTSTREAM(_to) \
70 : NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadObject(aIsStrongRef, _retval); } \
71 : NS_IMETHOD_(nsresult) ReadID(nsID *aID) override; \
72 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
73 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override;
74 :
75 : #if 0
76 : /* Use the code below as a template for the implementation class for this interface. */
77 :
78 : /* Header file */
79 : class nsObjectInputStream : public nsIObjectInputStream
80 : {
81 : public:
82 : NS_DECL_ISUPPORTS
83 : NS_DECL_NSIOBJECTINPUTSTREAM
84 :
85 : nsObjectInputStream();
86 :
87 : private:
88 : ~nsObjectInputStream();
89 :
90 : protected:
91 : /* additional members */
92 : };
93 :
94 : /* Implementation file */
95 : NS_IMPL_ISUPPORTS(nsObjectInputStream, nsIObjectInputStream)
96 :
97 : nsObjectInputStream::nsObjectInputStream()
98 : {
99 : /* member initializers and constructor code */
100 : }
101 :
102 : nsObjectInputStream::~nsObjectInputStream()
103 : {
104 : /* destructor code */
105 : }
106 :
107 : /* nsISupports readObject (in boolean aIsStrongRef); */
108 : NS_IMETHODIMP nsObjectInputStream::ReadObject(bool aIsStrongRef, nsISupports * *_retval)
109 : {
110 : return NS_ERROR_NOT_IMPLEMENTED;
111 : }
112 :
113 : /* [notxpcom] nsresult readID (out nsID aID); */
114 : NS_IMETHODIMP_(nsresult) nsObjectInputStream::ReadID(nsID *aID)
115 : {
116 : return NS_ERROR_NOT_IMPLEMENTED;
117 : }
118 :
119 : /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */
120 : NS_IMETHODIMP_(char *) nsObjectInputStream::GetBuffer(uint32_t aLength, uint32_t aAlignMask)
121 : {
122 : return NS_ERROR_NOT_IMPLEMENTED;
123 : }
124 :
125 : /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */
126 : NS_IMETHODIMP_(void) nsObjectInputStream::PutBuffer(char *aBuffer, uint32_t aLength)
127 : {
128 : return NS_ERROR_NOT_IMPLEMENTED;
129 : }
130 :
131 : /* End of implementation class template. */
132 : #endif
133 :
134 :
135 : inline nsresult
136 3 : NS_ReadOptionalObject(nsIObjectInputStream* aStream, bool aIsStrongRef,
137 : nsISupports* *aResult)
138 : {
139 : bool nonnull;
140 3 : nsresult rv = aStream->ReadBoolean(&nonnull);
141 3 : if (NS_SUCCEEDED(rv)) {
142 3 : if (nonnull)
143 1 : rv = aStream->ReadObject(aIsStrongRef, aResult);
144 : else
145 2 : *aResult = nullptr;
146 : }
147 3 : return rv;
148 : }
149 :
150 : #endif /* __gen_nsIObjectInputStream_h__ */
|