xpcom/ds/nsPersistentProperties.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
    19 {
    20 public:
    21   nsPersistentProperties();
    23   NS_DECL_THREADSAFE_ISUPPORTS
    24   NS_DECL_NSIPROPERTIES
    25   NS_DECL_NSIPERSISTENTPROPERTIES
    27   static nsresult
    28   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
    30 private:
    31   ~nsPersistentProperties();
    33 protected:
    34   nsCOMPtr<nsIUnicharInputStream> mIn;
    36   nsIPersistentProperties* mSubclass;
    37   struct PLDHashTable mTable;
    38   PLArenaPool mArena;
    39 };
    41 class nsPropertyElement MOZ_FINAL : public nsIPropertyElement
    42 {
    43 public:
    44   nsPropertyElement()
    45   {
    46   }
    48   nsPropertyElement(const nsACString& aKey, const nsAString& aValue)
    49     : mKey(aKey), mValue(aValue)
    50   {
    51   }
    53   NS_DECL_ISUPPORTS
    54   NS_DECL_NSIPROPERTYELEMENT
    56   static NS_METHOD
    57   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
    59 private:
    60   ~nsPropertyElement() {}
    62 protected:
    63   nsCString mKey;
    64   nsString mValue;
    65 };
    67 #endif /* nsPersistentProperties_h___ */

mercurial