michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** @file michael@0: * Helper functions for (de)serializing objects to/from ASCII strings. michael@0: */ michael@0: michael@0: #ifndef NSSERIALIZATIONHELPER_H_ michael@0: #define NSSERIALIZATIONHELPER_H_ michael@0: michael@0: #include "nsStringFwd.h" michael@0: #include "nsISerializationHelper.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsISerializable; michael@0: michael@0: /** michael@0: * Serialize an object to an ASCII string. michael@0: */ michael@0: nsresult NS_SerializeToString(nsISerializable* obj, michael@0: nsCSubstring& str); michael@0: michael@0: /** michael@0: * Deserialize an object. michael@0: */ michael@0: nsresult NS_DeserializeObject(const nsCSubstring& str, michael@0: nsISupports** obj); michael@0: michael@0: class nsSerializationHelper MOZ_FINAL : public nsISerializationHelper michael@0: { michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISERIALIZATIONHELPER michael@0: }; michael@0: michael@0: #endif