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 native MallocSizeOf
(mozilla
::MallocSizeOf
);
18 [scriptable
, uuid(283EE646
-1AEF
-11D4
-98B3
-00C04fA0CE9A
)]
19 interface nsIPropertyElement
: nsISupports
{
20 attribute AUTF8String key
;
21 attribute AString value
;
24 [scriptable
, builtinclass
, uuid(706867af
-0400-4faa
-beb1
-0dae87308784
)]
25 interface nsIPersistentProperties
: nsIProperties
28 * load a set of name/value pairs from the input stream
29 * names and values should be in UTF8
31 void load
(in nsIInputStream input
);
34 * output the values to the stream - results will be in UTF8
36 void save
(in nsIOutputStream output
, in AUTF8String header
);
39 * get an enumeration of nsIPropertyElement objects,
40 * which are read-only (i.e. setting properties on the element will
41 * not make changes back into the source nsIPersistentProperties
43 nsISimpleEnumerator enumerate
();
46 * shortcut to nsIProperty's get() which retrieves a string value
47 * directly (and thus faster)
49 AString getStringProperty
(in AUTF8String key
);
52 * shortcut to nsIProperty's set() which sets a string value
53 * directly (and thus faster). If the given property already exists,
54 * then the old value will be returned
56 AString setStringProperty
(in AUTF8String key
, in AString value
);
58 [notxpcom
, nostdcall
] size_t sizeOfIncludingThis
(in MallocSizeOf aMallocSizeOf
);