Click here to Skip to main content
15,884,176 members
Articles / Desktop Programming / MFC

Cross-platform INI Configuration Files (Win32/Un*x, MBCS/Unicode)

Rate me:
Please Sign up or sign in to vote.
4.45/5 (31 votes)
27 Feb 2012MIT4 min read 158.8K   1.2K   97  
Simple reading, accessing and writing of INI configuration files on Windows/Linux/Unix using a cross-platform and fully Unicode/MBCS/UTF-8 aware library
@echo off

Debug\testsi.exe -u -m -l test1-input.ini > test1-blah.ini
fc test1-expected.ini test1-output.ini
if errorlevel 1 goto error

"Debug Unicode\testsi.exe" -u -m -l test1-input.ini > test1-blah.ini
fc test1-expected.ini test1-output.ini
if errorlevel 1 goto error

Release\testsi.exe -u -m -l test1-input.ini > test1-blah.ini
fc test1-expected.ini test1-output.ini
if errorlevel 1 goto error

"Release Unicode\testsi.exe" -u -m -l test1-input.ini > test1-blah.ini
fc test1-expected.ini test1-output.ini
if errorlevel 1 goto error

exit /b 0

:error
echo Failed during test run. Output file doesn't match expected file.
pause
exit /b 1

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
Australia Australia
Must eat, enjoy travel, thus programming since 1995. Donations of canned food gladly accepted.

Comments and Discussions