xpcom/ds/nsISerializable.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/ds/nsISerializable.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,32 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIObjectInputStream;
    1.12 +interface nsIObjectOutputStream;
    1.13 +
    1.14 +[scriptable, uuid(91cca981-c26d-44a8-bebe-d9ed4891503a)]
    1.15 +interface nsISerializable : nsISupports
    1.16 +{
    1.17 +    /**
    1.18 +     * Initialize the object implementing nsISerializable, which must have
    1.19 +     * been freshly constructed via CreateInstance.  All data members that
    1.20 +     * can't be set to default values must have been serialized by write,
    1.21 +     * and should be read from aInputStream in the same order by this method.
    1.22 +     */
    1.23 +    void read(in nsIObjectInputStream aInputStream);
    1.24 +
    1.25 +    /**
    1.26 +     * Serialize the object implementing nsISerializable to aOutputStream, by
    1.27 +     * writing each data member that must be recovered later to reconstitute
    1.28 +     * a working replica of this object, in a canonical member and byte order,
    1.29 +     * to aOutputStream.
    1.30 +     *
    1.31 +     * NB: a class that implements nsISerializable *must* also implement
    1.32 +     * nsIClassInfo, in particular nsIClassInfo::GetClassID.
    1.33 +     */
    1.34 +    void write(in nsIObjectOutputStream aOutputStream);
    1.35 +};

mercurial