Backed out changeset 4c2bc5ae8f95 (bug 945562) for device image bustage.
[gecko.git] / xpcom / ds / nsPersistentProperties.h
bloba8d5674bb40aceaba384f95cf9fb4218b0e0f7c4
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsPersistentProperties_h___
7 #define nsPersistentProperties_h___
9 #include "nsIPersistentProperties2.h"
10 #include "pldhash.h"
11 #include "plarena.h"
12 #include "nsString.h"
13 #include "nsCOMPtr.h"
14 #include "mozilla/Attributes.h"
16 class nsIUnicharInputStream;
18 class nsPersistentProperties MOZ_FINAL : public nsIPersistentProperties
20 public:
21 nsPersistentProperties();
22 nsresult Init();
24 NS_DECL_THREADSAFE_ISUPPORTS
25 NS_DECL_NSIPROPERTIES
26 NS_DECL_NSIPERSISTENTPROPERTIES
28 static nsresult
29 Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
31 private:
32 ~nsPersistentProperties();
34 protected:
35 nsCOMPtr<nsIUnicharInputStream> mIn;
37 nsIPersistentProperties* mSubclass;
38 struct PLDHashTable mTable;
39 PLArenaPool mArena;
42 class nsPropertyElement MOZ_FINAL : public nsIPropertyElement
44 public:
45 nsPropertyElement()
49 nsPropertyElement(const nsACString& aKey, const nsAString& aValue)
50 : mKey(aKey), mValue(aValue)
54 NS_DECL_ISUPPORTS
55 NS_DECL_NSIPROPERTYELEMENT
57 static NS_METHOD
58 Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
60 private:
61 ~nsPropertyElement() {}
63 protected:
64 nsCString mKey;
65 nsString mValue;
68 #endif /* nsPersistentProperties_h___ */