CFLib.org – Common Function Library Project

getProfile(iniFile)

Last updated October 23, 2005

author

Giampaolo Bellavite

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Returns a struct of structs. Each initialization file section name is the key of the first struct. Each entry is a name-value pair struct in its own section.

Return Values:
Returns a structure.

Example:

<cfdump var="#getProfile('C:\WINDOWS\win.ini')#">

Parameters:

Name Description Required
iniFile Full path to ini file to read. Yes

Full UDF Source:

/**
 * Gets all initialization file entries.
 * 
 * @param iniFile 	 Full path to ini file to read. (Required)
 * @return Returns a structure. 
 * @author Giampaolo Bellavite (giampaolo@bellavite.com) 
 * @version 1, October 23, 2005 
 */
function getProfile(iniFile) {
	var sections = getProfileSections(iniFile);
	var sectionName = "";
	var retProfile = structNew();
	var i = "";
	var entry = "";
	
	for (sectionName in sections) {
		retProfile[sectionName] = structNew();
		for (i=1;i LTE listLen(sections[sectionName]);i=i+1) {
			entry = listGetAt(sections[sectionName],i);
			retProfile[sectionName][entry]=getProfileString(iniFile,sectionName,entry);
		}
	}
	return retProfile;		
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson