2012-05-21 15:12:37 +04: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/. */
|
2005-10-04 21:19:14 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIUTF8StringEnumerator;
|
2012-06-06 06:08:30 +04:00
|
|
|
interface nsIFile;
|
2005-10-04 21:19:14 +04:00
|
|
|
|
|
|
|
[scriptable, uuid(7eb955f6-3e78-4d39-b72f-c1bf12a94bce)]
|
|
|
|
interface nsIINIParser : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Enumerates the [section]s available in the INI file.
|
|
|
|
*/
|
|
|
|
nsIUTF8StringEnumerator getSections();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates the keys available within a section.
|
|
|
|
*/
|
|
|
|
nsIUTF8StringEnumerator getKeys(in AUTF8String aSection);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the value of a string for a particular section and key.
|
|
|
|
*/
|
|
|
|
AUTF8String getString(in AUTF8String aSection, in AUTF8String aKey);
|
|
|
|
};
|
|
|
|
|
2012-05-23 21:09:10 +04:00
|
|
|
[scriptable, uuid(b67bb24b-31a3-4a6a-a5d9-0485c9af5a04)]
|
2010-02-10 04:05:31 +03:00
|
|
|
interface nsIINIParserWriter : nsISupports
|
|
|
|
{
|
2012-05-23 21:09:10 +04:00
|
|
|
/**
|
|
|
|
* Windows and the NSIS installer code sometimes expect INI files to be in
|
|
|
|
* UTF-16 encoding. On Windows only, this flag to writeFile can be used to
|
|
|
|
* change the encoding from its default UTF-8.
|
|
|
|
*/
|
|
|
|
const unsigned long WRITE_UTF16 = 0x1;
|
|
|
|
|
2010-02-10 04:05:31 +03:00
|
|
|
/**
|
|
|
|
* Set the value of a string for a particular section and key.
|
|
|
|
*/
|
|
|
|
void setString(in AUTF8String aSection, in AUTF8String aKey, in AUTF8String aValue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write to the INI file.
|
|
|
|
*/
|
2012-06-06 06:08:30 +04:00
|
|
|
void writeFile([optional] in nsIFile aINIFile,
|
2012-05-23 21:09:10 +04:00
|
|
|
[optional] in unsigned long aFlags);
|
2010-02-10 04:05:31 +03:00
|
|
|
};
|
|
|
|
|
2005-10-04 21:19:14 +04:00
|
|
|
[scriptable, uuid(ccae7ea5-1218-4b51-aecb-c2d8ecd46af9)]
|
|
|
|
interface nsIINIParserFactory : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Create an iniparser instance from a local file.
|
|
|
|
*/
|
2012-06-06 06:08:30 +04:00
|
|
|
nsIINIParser createINIParser(in nsIFile aINIFile);
|
2005-10-04 21:19:14 +04:00
|
|
|
};
|