nsSerializationHelper.h (846B)
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 15 class nsISerializable; 16 17 /** 18 * Serialize an object to an ASCII string. 19 */ 20 nsresult NS_SerializeToString(nsISerializable* obj, nsACString& str); 21 22 /** 23 * Deserialize an object. 24 */ 25 nsresult NS_DeserializeObject(const nsACString& str, nsISupports** obj); 26 27 class nsSerializationHelper final : public nsISerializationHelper { 28 ~nsSerializationHelper() = default; 29 30 NS_DECL_ISUPPORTS 31 NS_DECL_NSISERIALIZATIONHELPER 32 }; 33 34 #endif