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 #include
"nsIProperties.idl"
8 interface nsIInputStream
;
9 interface nsIOutputStream
;
10 interface nsISimpleEnumerator
;
13 #include
"mozilla/MemoryReporting.h"
16 [scriptable
, uuid(283EE646
-1AEF
-11D4
-98B3
-00C04fA0CE9A
)]
17 interface nsIPropertyElement
: nsISupports
{
18 attribute AUTF8String key
;
19 attribute AString value
;
22 [scriptable
, uuid(706867af
-0400-4faa
-beb1
-0dae87308784
)]
23 interface nsIPersistentProperties
: nsIProperties
26 * load a set of name/value pairs from the input stream
27 * names and values should be in UTF8
29 void load
(in nsIInputStream input
);
32 * output the values to the stream - results will be in UTF8
34 void save
(in nsIOutputStream output
, in AUTF8String header
);
37 * get an enumeration of nsIPropertyElement objects,
38 * which are read-only (i.e. setting properties on the element will
39 * not make changes back into the source nsIPersistentProperties
41 nsISimpleEnumerator enumerate
();
44 * shortcut to nsIProperty's get() which retrieves a string value
45 * directly (and thus faster)
47 AString getStringProperty
(in AUTF8String key
);
50 * shortcut to nsIProperty's set() which sets a string value
51 * directly (and thus faster). If the given property already exists,
52 * then the old value will be returned
54 AString setStringProperty
(in AUTF8String key
, in AString value
);
57 virtual size_t SizeOfIncludingThis
(mozilla
::MallocSizeOf aMallocSizeOf
) const = 0;