/src/mozilla-central/xpcom/ds/nsPersistentProperties.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef nsPersistentProperties_h___ |
8 | | #define nsPersistentProperties_h___ |
9 | | |
10 | | #include "nsIPersistentProperties2.h" |
11 | | #include "PLDHashTable.h" |
12 | | #include "nsString.h" |
13 | | #include "nsCOMPtr.h" |
14 | | #include "mozilla/ArenaAllocator.h" |
15 | | #include "mozilla/Attributes.h" |
16 | | |
17 | | class nsIUnicharInputStream; |
18 | | |
19 | | class nsPersistentProperties final : public nsIPersistentProperties |
20 | | { |
21 | | public: |
22 | | nsPersistentProperties(); |
23 | | |
24 | | NS_DECL_THREADSAFE_ISUPPORTS |
25 | | NS_DECL_NSIPROPERTIES |
26 | | NS_DECL_NSIPERSISTENTPROPERTIES |
27 | | |
28 | | size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override; |
29 | | |
30 | | private: |
31 | | ~nsPersistentProperties(); |
32 | | |
33 | | protected: |
34 | | nsCOMPtr<nsIUnicharInputStream> mIn; |
35 | | |
36 | | PLDHashTable mTable; |
37 | | mozilla::ArenaAllocator<2048,4> mArena; |
38 | | }; |
39 | | |
40 | | class nsPropertyElement final : public nsIPropertyElement |
41 | | { |
42 | | public: |
43 | | nsPropertyElement() |
44 | 0 | { |
45 | 0 | } |
46 | | |
47 | | nsPropertyElement(const nsACString& aKey, const nsAString& aValue) |
48 | | : mKey(aKey) |
49 | | , mValue(aValue) |
50 | 0 | { |
51 | 0 | } |
52 | | |
53 | | NS_DECL_ISUPPORTS |
54 | | NS_DECL_NSIPROPERTYELEMENT |
55 | | |
56 | | static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); |
57 | | |
58 | | private: |
59 | 0 | ~nsPropertyElement() {} |
60 | | |
61 | | protected: |
62 | | nsCString mKey; |
63 | | nsString mValue; |
64 | | }; |
65 | | |
66 | | #endif /* nsPersistentProperties_h___ */ |