OpenMIDIProject

Home | News | Forums | Documentations | FAQ | Links | Contributors | Author

Japanese | English | Chinese


Ini File creating and editing library "IniDataLibrary" (DLL)

IniDataLibrary is free, open source library for creating and editing ini file. This library developed to support high speed input / output to *.ini files, correctly set and get of spece-terminated strings, support UTF-16LE(with BOM) and UTF-8, and suport 64bit, as an alternative of GetPrivateProfileString / GetPrivateProfileInt / WritePrivateProfileString functions. and has ability to load all at once with IniData_Load and save all at once with IniData_Save.

This library is written in C language, and supports ini files with an unlimited number of sections and items. For simplicity, loading and saving comments is omitted. Please note that ini files without BOM are treated as UTF-8 instead of ANSI.

#include <stdio.h>
#include <tchar.h>
#include <IniData.h>
int _tmain () {
	IniData* pIniData = IniData_Load (_T("d:\\Test.ini"), 0);
	if (pIniData == NULL) {
		pIniData = IniData_Create (0);  /* 空のIniDataオブジェクトを作成 */
		if (pIniData == NULL) {
			_tprintf (_T("IniDataオブジェクトの生成に失敗しました。\n"));
			return 0;
		}
	}
	IniData_SetString (pIniData, _T("Section01"), _T("ABC"), _T("DEF"));
	IniData_SetIntPtr (pIniData, _T("Section02"), _T("XYZ"), 999);
	TCHAR szBuf[1024];
	IniData_GetString (pIniData, _T("Section01"),_T("ABC"), _T("Default"), szBuf, 1024); 
	INT_PTR nXYZ = IniData_GetIntPtr (pIniData, _T("Section02"), _T("XYZ"), 111);
	IniData_Save (_T("d:\\Test.ini", 0));
	IniData_Delete (pIniData); /* IniDataオブジェクトをメモリ上から削除 */
	pIniData = NULL;
	return 1;
}
Name OS FileName Release day Size
Windows 7 / 8.1 / 10 / 11 IniDataLib8.1.zip 2024/03/24 1.27MB


(C)2000-2024 kuzu All rights reserved.