Backed out changeset 5f819082a015 (bug 1936189) for causing reftest failures @ native...
[gecko.git] / xpcom / ds / nsIINIParser.idl
blob434490bf4202f3860e5163c886764236731f2028
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 interface nsIUTF8StringEnumerator;
8 interface nsIFile;
10 [scriptable, uuid(7eb955f6-3e78-4d39-b72f-c1bf12a94bce)]
11 interface nsIINIParser : nsISupports
13 /**
14 * Initializes an INI file from string data
16 void initFromString(in AUTF8String aData);
18 /**
19 * Enumerates the [section]s available in the INI file.
21 nsIUTF8StringEnumerator getSections();
23 /**
24 * Enumerates the keys available within a section.
26 nsIUTF8StringEnumerator getKeys(in AUTF8String aSection);
28 /**
29 * Get the value of a string for a particular section and key.
31 AUTF8String getString(in AUTF8String aSection, in AUTF8String aKey);
34 [scriptable, uuid(b67bb24b-31a3-4a6a-a5d9-0485c9af5a04)]
35 interface nsIINIParserWriter : nsISupports
38 /**
39 * Set the value of a string for a particular section and key.
41 void setString(in AUTF8String aSection, in AUTF8String aKey, in AUTF8String aValue);
43 /**
44 * Write to the INI file.
46 void writeFile(in nsIFile aINIFile);
48 /**
49 * Return the formatted INI file contents
51 AUTF8String writeToString();
54 [scriptable, uuid(ccae7ea5-1218-4b51-aecb-c2d8ecd46af9)]
55 interface nsIINIParserFactory : nsISupports
57 /**
58 * Create an iniparser instance from a local file.
60 nsIINIParser createINIParser([optional] in nsIFile aINIFile);