no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / xpcom / io / nsIObjectInputStream.idl
blobc00b93a99ac3b04e96ddc5eb5cd945dff5e2705d
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/. */
6 #include "nsIBinaryInputStream.idl"
8 /**
9 * @see nsIObjectOutputStream
10 * @see nsIBinaryInputStream
13 [scriptable, builtinclass, uuid(6c248606-4eae-46fa-9df0-ba58502368eb)]
14 interface nsIObjectInputStream : nsIBinaryInputStream
16 /**
17 * Read an object from this stream to satisfy a strong or weak reference
18 * to one of its interfaces. If the interface was not along the primary
19 * inheritance chain ending in the "root" or XPCOM-identity nsISupports,
20 * readObject will QueryInterface from the deserialized object root to the
21 * correct interface, which was specified when the object was serialized.
23 * @see nsIObjectOutputStream
25 nsISupports readObject(in boolean aIsStrongRef);
27 [notxpcom] nsresult readID(out nsID aID);
29 /**
30 * Optimized deserialization support -- see nsIStreamBufferAccess.idl.
32 [notxpcom] charPtr getBuffer(in uint32_t aLength, in uint32_t aAlignMask);
33 [notxpcom] void putBuffer(in charPtr aBuffer, in uint32_t aLength);
36 %{C++
38 already_AddRefed<nsIObjectInputStream>
39 NS_NewObjectInputStream(nsIInputStream* aOutputStream);
41 inline nsresult
42 NS_ReadOptionalObject(nsIObjectInputStream* aStream, bool aIsStrongRef,
43 nsISupports* *aResult)
45 bool nonnull;
46 nsresult rv = aStream->ReadBoolean(&nonnull);
47 if (NS_SUCCEEDED(rv)) {
48 if (nonnull)
49 rv = aStream->ReadObject(aIsStrongRef, aResult);
50 else
51 *aResult = nullptr;
53 return rv;