2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsPersistentProperties_h___
|
|
|
|
#define nsPersistentProperties_h___
|
|
|
|
|
|
|
|
#include "nsIPersistentProperties2.h"
|
|
|
|
#include "pldhash.h"
|
|
|
|
#include "plarena.h"
|
2013-09-23 10:25:00 -07:00
|
|
|
#include "nsString.h"
|
2008-08-07 14:05:19 -07:00
|
|
|
#include "nsCOMPtr.h"
|
2012-06-05 16:51:58 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-09-19 12:31:21 -07:00
|
|
|
class nsIUnicharInputStream;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-05 16:51:58 -07:00
|
|
|
class nsPersistentProperties MOZ_FINAL : public nsIPersistentProperties
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsPersistentProperties();
|
|
|
|
|
2013-07-18 19:31:26 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIPROPERTIES
|
|
|
|
NS_DECL_NSIPERSISTENTPROPERTIES
|
|
|
|
|
2014-07-09 08:15:21 -07:00
|
|
|
static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
~nsPersistentProperties();
|
|
|
|
|
|
|
|
protected:
|
2008-08-07 14:05:19 -07:00
|
|
|
nsCOMPtr<nsIUnicharInputStream> mIn;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIPersistentProperties* mSubclass;
|
|
|
|
struct PLDHashTable mTable;
|
|
|
|
PLArenaPool mArena;
|
|
|
|
};
|
|
|
|
|
2012-06-05 16:51:58 -07:00
|
|
|
class nsPropertyElement MOZ_FINAL : public nsIPropertyElement
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsPropertyElement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsPropertyElement(const nsACString& aKey, const nsAString& aValue)
|
2014-07-09 08:15:21 -07:00
|
|
|
: mKey(aKey)
|
|
|
|
, mValue(aValue)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPROPERTYELEMENT
|
|
|
|
|
2014-07-09 08:15:21 -07:00
|
|
|
static NS_METHOD Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
~nsPropertyElement() {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCString mKey;
|
|
|
|
nsString mValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPersistentProperties_h___ */
|