diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c04f72..0bd1c7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14) project( SimpleIni - VERSION 4.24 + VERSION 4.25 DESCRIPTION "Cross-platform C++ library providing a simple API to read and write INI-style configuration files" LANGUAGES CXX C ) diff --git a/README.md b/README.md index ea60335..b703373 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -simpleini -========= +# simpleini  - + A cross-platform library that provides a simple API to read and write INI-style configuration files. It supports data files in ASCII, MBCS and Unicode. It is designed explicitly to be portable to any platform and has been tested on Windows, WinCE and Linux. Released as open-source and free using the MIT licence. [Full documentation](https://brofield.github.io/simpleini/) @@ -14,8 +13,8 @@ A cross-platform library that provides a simple API to read and write INI-style - loading and saving of INI-style configuration files - configuration files can have any newline format on all platforms - liberal acceptance of file format - * key/values with no section, keys with no value - * removal of whitespace around sections, keys and values + - key/values with no section, keys with no value + - removal of whitespace around sections, keys and values - support for multi-line values (values with embedded newline characters) - optional support for multiple keys with the same name - optional case-insensitive sections and keys (for ASCII characters only) @@ -46,35 +45,24 @@ Simply include `SimpleIni.h` in your source files: That's it! The library is ready to use. -# Building and Testing +# Build and Test While the library itself doesn't require building, you can build and run the test suite using CMake. -## Building with CMake - ```bash # Configure the project cmake -S . -B build # Build the tests (optional) cmake --build build -``` -## Running Tests - -After building, run the tests with: +# To build without tests +cmake -S . -B build -DBUILD_TESTING=OFF +cmake --build build -```bash # Run all tests cd build -ctest - -# Or run with verbose output ctest --verbose - -# Or run tests directly -cd tests -./simpleini-tests ``` ## CMake Integration @@ -104,6 +92,10 @@ find_package(SimpleIni REQUIRED) target_link_libraries(your_target PRIVATE SimpleIni::SimpleIni) ``` +Note that the ConvertUTF.\* files are required ONLY if you use SI_CONVERT_GENERIC. +This is not the default. If you do use this mode, you will need to manually copy +or include the files from the SimpleIni source directory. + # Examples These snippets are included with the distribution in the automatic tests as ts-snippets.cpp. @@ -171,7 +163,7 @@ These snippets are included with the distribution in the automatic tests as ts-s pv = ini.GetValue("section1", "key1"); ASSERT_STREQ(pv, "value1"); - // get the value of a key which may have multiple + // get the value of a key which may have multiple // values. If hasMultiple is true, then there are // multiple values and just one value has been returned bool hasMulti; @@ -201,10 +193,10 @@ These snippets are included with the distribution in the automatic tests as ts-s ### MODIFYING DATA ```c++ - // add a new section + // add a new section rc = ini.SetValue("section1", nullptr, nullptr); if (rc < 0) { /* handle error */ }; - ASSERT_EQ(rc, SI_INSERTED); + ASSERT_EQ(rc, SI_INSERTED); // not an error to add one that already exists rc = ini.SetValue("section1", nullptr, nullptr); diff --git a/SimpleIni.h b/SimpleIni.h index 82fd8fa..34d179e 100644 --- a/SimpleIni.h +++ b/SimpleIni.h @@ -5,7 +5,7 @@