Skip to content
Snippets Groups Projects
Commit 4a2f4cca authored by rswindell's avatar rswindell
Browse files

iniGetKeys() section argument is optional (returns root section).

Updated descriptions for all .ini-related methods.
parent 630a01db
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -1567,36 +1567,41 @@ static jsSyncMethodSpec js_file_functions[] = { ...@@ -1567,36 +1567,41 @@ static jsSyncMethodSpec js_file_functions[] = {
"optionally, only those section names that begin with the specified <i>prefix</i>") "optionally, only those section names that begin with the specified <i>prefix</i>")
,311 ,311
}, },
{"iniGetKeys", js_iniGetKeys, 0, JSTYPE_ARRAY, JSDOCSTR("section") {"iniGetKeys", js_iniGetKeys, 1, JSTYPE_ARRAY, JSDOCSTR("[section]")
,JSDOCSTR("parse all key names from the specified <i>section</i> in a <tt>.ini</tt> file " ,JSDOCSTR("parse all key names from the specified <i>section</i> in a <tt>.ini</tt> file "
"and return the key names as an <i>array of strings</i>") "and return the key names as an <i>array of strings</i>. "
"if <i>section</i> is undefined, returns key names from the <i>root</i> section")
,311 ,311
}, },
{"iniGetValue", js_iniGetValue, 3, JSTYPE_STRING, JSDOCSTR("section, key [,default]") {"iniGetValue", js_iniGetValue, 3, JSTYPE_STRING, JSDOCSTR("section, key [,default]")
,JSDOCSTR("parse a key from a <tt>.ini</tt> file and return its value (format = '<tt>key = value</tt>'). " ,JSDOCSTR("parse a key from a <tt>.ini</tt> file and return its value (format = '<tt>key = value</tt>'). "
"returns the specified <i>default</i> value if the key or value is missing or invalid. " "returns the specified <i>default</i> value if the key or value is missing or invalid. "
"to parse a key from the <i>root</i> section, pass <i>null</i> for <i>section</i>. "
"will return a <i>bool</i>, <i>number</i>, <i>string</i>, or an <i>array of strings</i> " "will return a <i>bool</i>, <i>number</i>, <i>string</i>, or an <i>array of strings</i> "
"determined by the type of <i>default</i> value specified") "determined by the type of <i>default</i> value specified")
,311 ,311
}, },
{"iniSetValue", js_iniSetValue, 3, JSTYPE_BOOLEAN, JSDOCSTR("section, key, value") {"iniSetValue", js_iniSetValue, 3, JSTYPE_BOOLEAN, JSDOCSTR("section, key, value")
,JSDOCSTR("set the specified <i>key</i> to the specified <i>value</i> in the specified <i>section</i> " ,JSDOCSTR("set the specified <i>key</i> to the specified <i>value</i> in the specified <i>section</i> "
"of a <tt>.ini</tt> file") "of a <tt>.ini</tt> file. "
"to set a key in the <i>root</i> section, pass <i>null</i> for <i>section</i>. ")
,311 ,311
}, },
{"iniGetObject", js_iniGetObject, 1, JSTYPE_OBJECT, JSDOCSTR("section") {"iniGetObject", js_iniGetObject, 1, JSTYPE_OBJECT, JSDOCSTR("[section]")
,JSDOCSTR("parse an entire section from a .ini file " ,JSDOCSTR("parse an entire section from a .ini file "
"and return all of its keys and values as properties of an object") "and return all of its keys and values as properties of an object. "
"if <i>section</i> is undefined, returns key and values from the <i>root</i> section")
,311 ,311
}, },
{"iniSetObject", js_iniSetObject, 2, JSTYPE_BOOLEAN, JSDOCSTR("section, object") {"iniSetObject", js_iniSetObject, 2, JSTYPE_BOOLEAN, JSDOCSTR("section, object")
,JSDOCSTR("write all the properties of the specified <i>object</i> as separate <tt>key=value</tt> pairs " ,JSDOCSTR("write all the properties of the specified <i>object</i> as separate <tt>key=value</tt> pairs "
"in the specified <i>section</i> of a <tt>.ini</tt> file") "in the specified <i>section</i> of a <tt>.ini</tt> file. "
"to write an object in the <i>root</i> section, pass <i>null</i> for <i>section</i>. ")
,311 ,311
}, },
{"iniGetAllObjects",js_iniGetAllObjects,1, JSTYPE_ARRAY, JSDOCSTR("[name_property] [,prefix]") {"iniGetAllObjects",js_iniGetAllObjects,1, JSTYPE_ARRAY, JSDOCSTR("[name_property] [,prefix]")
,JSDOCSTR("parse all sections from a .ini file and return all sections and keys " ,JSDOCSTR("parse all sections from a .ini file and return all (non-<i>root</i>) sections "
"an array of objects with each section's keys as properties of each section object, " "in an array of objects with each section's keys as properties of each object. "
"<i>name_property</i> is the name of the property to create to contain the section's name " "<i>name_property</i> is the name of the property to create to contain the section's name "
"(default is <tt>\"name\"</tt>), " "(default is <tt>\"name\"</tt>), "
"the optional <i>prefix</i> has the same use as in the <tt>iniGetSections</tt> method, " "the optional <i>prefix</i> has the same use as in the <tt>iniGetSections</tt> method, "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment