michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: #ifndef nsPersistentProperties_h___ michael@0: #define nsPersistentProperties_h___ michael@0: michael@0: #include "nsIPersistentProperties2.h" michael@0: #include "pldhash.h" michael@0: #include "plarena.h" michael@0: #include "nsString.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsIUnicharInputStream; michael@0: michael@0: class nsPersistentProperties MOZ_FINAL : public nsIPersistentProperties michael@0: { michael@0: public: michael@0: nsPersistentProperties(); michael@0: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIPROPERTIES michael@0: NS_DECL_NSIPERSISTENTPROPERTIES michael@0: michael@0: static nsresult michael@0: Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); michael@0: michael@0: private: michael@0: ~nsPersistentProperties(); michael@0: michael@0: protected: michael@0: nsCOMPtr mIn; michael@0: michael@0: nsIPersistentProperties* mSubclass; michael@0: struct PLDHashTable mTable; michael@0: PLArenaPool mArena; michael@0: }; michael@0: michael@0: class nsPropertyElement MOZ_FINAL : public nsIPropertyElement michael@0: { michael@0: public: michael@0: nsPropertyElement() michael@0: { michael@0: } michael@0: michael@0: nsPropertyElement(const nsACString& aKey, const nsAString& aValue) michael@0: : mKey(aKey), mValue(aValue) michael@0: { michael@0: } michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIPROPERTYELEMENT michael@0: michael@0: static NS_METHOD michael@0: Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); michael@0: michael@0: private: michael@0: ~nsPropertyElement() {} michael@0: michael@0: protected: michael@0: nsCString mKey; michael@0: nsString mValue; michael@0: }; michael@0: michael@0: #endif /* nsPersistentProperties_h___ */