1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/ds/nsPersistentProperties.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,67 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsPersistentProperties_h___ 1.10 +#define nsPersistentProperties_h___ 1.11 + 1.12 +#include "nsIPersistentProperties2.h" 1.13 +#include "pldhash.h" 1.14 +#include "plarena.h" 1.15 +#include "nsString.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "mozilla/Attributes.h" 1.18 + 1.19 +class nsIUnicharInputStream; 1.20 + 1.21 +class nsPersistentProperties MOZ_FINAL : public nsIPersistentProperties 1.22 +{ 1.23 +public: 1.24 + nsPersistentProperties(); 1.25 + 1.26 + NS_DECL_THREADSAFE_ISUPPORTS 1.27 + NS_DECL_NSIPROPERTIES 1.28 + NS_DECL_NSIPERSISTENTPROPERTIES 1.29 + 1.30 + static nsresult 1.31 + Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); 1.32 + 1.33 +private: 1.34 + ~nsPersistentProperties(); 1.35 + 1.36 +protected: 1.37 + nsCOMPtr<nsIUnicharInputStream> mIn; 1.38 + 1.39 + nsIPersistentProperties* mSubclass; 1.40 + struct PLDHashTable mTable; 1.41 + PLArenaPool mArena; 1.42 +}; 1.43 + 1.44 +class nsPropertyElement MOZ_FINAL : public nsIPropertyElement 1.45 +{ 1.46 +public: 1.47 + nsPropertyElement() 1.48 + { 1.49 + } 1.50 + 1.51 + nsPropertyElement(const nsACString& aKey, const nsAString& aValue) 1.52 + : mKey(aKey), mValue(aValue) 1.53 + { 1.54 + } 1.55 + 1.56 + NS_DECL_ISUPPORTS 1.57 + NS_DECL_NSIPROPERTYELEMENT 1.58 + 1.59 + static NS_METHOD 1.60 + Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); 1.61 + 1.62 +private: 1.63 + ~nsPropertyElement() {} 1.64 + 1.65 +protected: 1.66 + nsCString mKey; 1.67 + nsString mValue; 1.68 +}; 1.69 + 1.70 +#endif /* nsPersistentProperties_h___ */