netwerk/base/src/nsSerializationHelper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/src/nsSerializationHelper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +/** @file
     1.9 + * Helper functions for (de)serializing objects to/from ASCII strings.
    1.10 + */
    1.11 +
    1.12 +#ifndef NSSERIALIZATIONHELPER_H_
    1.13 +#define NSSERIALIZATIONHELPER_H_
    1.14 +
    1.15 +#include "nsStringFwd.h"
    1.16 +#include "nsISerializationHelper.h"
    1.17 +#include "mozilla/Attributes.h"
    1.18 +
    1.19 +class nsISerializable;
    1.20 +
    1.21 +/**
    1.22 + * Serialize an object to an ASCII string.
    1.23 + */
    1.24 +nsresult NS_SerializeToString(nsISerializable* obj,
    1.25 +                              nsCSubstring& str);
    1.26 +
    1.27 +/**
    1.28 + * Deserialize an object.
    1.29 + */
    1.30 +nsresult NS_DeserializeObject(const nsCSubstring& str,
    1.31 +                              nsISupports** obj);
    1.32 +
    1.33 +class nsSerializationHelper MOZ_FINAL : public nsISerializationHelper
    1.34 +{
    1.35 +  NS_DECL_ISUPPORTS
    1.36 +  NS_DECL_NSISERIALIZATIONHELPER
    1.37 +};
    1.38 +
    1.39 +#endif

mercurial