Line data Source code
1 : /* This Source Code Form is subject to the terms of the Mozilla Public
2 : * License, v. 2.0. If a copy of the MPL was not distributed with this
3 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 :
5 : /** @file
6 : * Helper functions for (de)serializing objects to/from ASCII strings.
7 : */
8 :
9 : #ifndef NSSERIALIZATIONHELPER_H_
10 : #define NSSERIALIZATIONHELPER_H_
11 :
12 : #include "nsStringFwd.h"
13 : #include "nsISerializationHelper.h"
14 : #include "mozilla/Attributes.h"
15 :
16 : class nsISerializable;
17 :
18 : /**
19 : * Serialize an object to an ASCII string.
20 : */
21 : nsresult NS_SerializeToString(nsISerializable* obj,
22 : nsACString& str);
23 :
24 : /**
25 : * Deserialize an object.
26 : */
27 : nsresult NS_DeserializeObject(const nsACString& str,
28 : nsISupports** obj);
29 :
30 2 : class nsSerializationHelper final : public nsISerializationHelper
31 : {
32 0 : ~nsSerializationHelper() {}
33 :
34 : NS_DECL_ISUPPORTS
35 : NS_DECL_NSISERIALIZATIONHELPER
36 : };
37 :
38 : #endif
|