Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
38 changes: 15 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
simpleini
=========
# simpleini

![Latest Test Results](https://github.com/brofield/simpleini/actions/workflows/build-and-test.yml/badge.svg)

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/)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion SimpleIni.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<tr><th>File <td>SimpleIni.h
<tr><th>Author <td>Brodie Thiesfield
<tr><th>Source <td>https://github.com/brofield/simpleini
<tr><th>Version <td>4.24
<tr><th>Version <td>4.25
</table>

Jump to the @link CSimpleIniTempl CSimpleIni @endlink interface documentation.
Expand Down
2 changes: 1 addition & 1 deletion release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Making a release:
* update version number in SimpleIni.h
* update version number in CMakeLists.txt
* check-in all files
* make a release "v4.24" etc creating a matching tag
* make a release "v4.25" etc creating a matching tag