Skip to content

Conversation

@deepx
Copy link

@deepx deepx commented Jan 2, 2026

Hey

I prepared a cmake project for Win/Linux/Mac (with a github-action) to use TAML in c++ environments.
Let me know if you have questions or suggestions to it.

i tried to make it fast, threadsafe and felxible for the future. More in the README.md

greets
DeepX

deepx added 21 commits January 2, 2026 16:05
Introduce Taml::Document, a flexible class for representing and manipulating TAML documents using std::unordered_map and std::any. Implements key features including type-safe value access, nested sections, flattening, and synchronous/asynchronous file I/O. Adds comprehensive tests for all major API functions. Parse and Serialize methods are stubbed for future implementation.
Introduced Taml::Serializer class with static methods to serialize C++ objects (via std::any) to TAML format. Supports serialization to strings, streams, and memory streams, with helpers for primitives, dictionaries, and collections. Complex object serialization is stubbed for future implementation. Updated Taml.h to include the new serializer.
Implemented Document::ToString() for string output via Serializer.
Replaced Document::Serialize placeholder with actual serialization.
Updated Serializer internals and added comprehensive tests for
ToString() and Serializer functionality in test_main.cpp.
Introduce Taml::Exception class to replace std::runtime_error for TAML parsing and serialization errors. This new exception supports optional line number and line text fields, and multiple constructors for different error scenarios. Updated Document.cpp and Serializer.cpp to throw Taml::Exception instead of std::runtime_error. Added tests in test_main.cpp to verify exception features and usage.
Add initial serialization logic to Serializer::SerializeObject, handling primitives, dictionaries, and collections. Replace exceptions with placeholder output for complex objects. Update Document::Parse to return an empty Document instead of throwing.
Introduced a new Taml::Validator component with detailed error reporting for TAML document structure and formatting. Added Validator.h/cpp, including ValidationError, ValidationResult, and LineInfo structs. Implemented validation logic to detect indentation issues, mixed tabs/spaces, and tab separator errors. Updated Taml.h and test_main.cpp to integrate and test the validator with both valid and invalid TAML examples.
Improves the macOS build job by checking if cmake is already installed before attempting installation. If cmake is present, its path and version are displayed; if not, Homebrew is updated and cmake is installed. This avoids redundant installations and speeds up the workflow.
Introduce Taml::Converter with static methods to convert JSON, XML, and YAML strings to TAML format. Add new Converter.h and Converter.cpp files with placeholder implementations. Update Taml.h to include the new header. Comment out Validator tests in test_main.cpp and add tests for the new Converter methods, which currently return placeholder output. This establishes the foundation for future format conversion support in the Taml library.
Refactor Validator to use size_t and std::string::npos for safer string handling. Update tab-in-value check to avoid out-of-bounds access. Uncomment and run Validator tests in test_main.cpp for both valid and invalid TAML input.
Renamed the GitHub Actions workflow from "TAML-Cpp" to "C++ Tests" for improved clarity and consistency.
Introduce Boost.Describe and Boost.MP11 as optional third-party dependencies to enable basic reflection-like serialization of C++ structs. Update CMake to support automatic fetching and population of these dependencies in a ThirdParty/ directory, and ensure their headers are available to both the main library and tests. Implement proof-of-concept serialization for described structs (e.g., TestPerson) in Serializer.cpp using Boost.Describe. Add tests to verify integration and update .gitignore to exclude fetched sources. This lays the foundation for generic, reflection-based serialization in TAML.
Updated cpp.yml to consistently install and verify third-party dependencies (e.g., Boost.Describe) on Linux, macOS, and Windows. Added explicit git installation, enabled -DTAML_POPULATE_THIRD_PARTY=ON in CMake, and introduced steps to build and verify the "populate-thirdparty" target before building and testing. This ensures reliable dependency management and build reproducibility across all supported platforms.
Update CMakeLists.txt to create build directories for Boost.MP11
and Boost.Describe during configuration, preventing issues with
missing directories for header-only dependencies. Include
Boost.Describe and Boost.MP11 headers directly in Taml.h, and
remove redundant include from test_main.cpp.
Switch from ExternalProject_Add to FetchContent for fetching
Boost.MP11 and Boost.Describe. This ensures header-only
dependencies are available at configure time and avoids
build-time directory issues. The populate-thirdparty target
is now a no-op for backward compatibility. Update status
messages accordingly.
Updated include statements for Boost libraries in Taml.h
to use the correct lowercase paths ("boost/describe.hpp"
and "boost/mp11.hpp") instead of the incorrect capitalized
versions. No other changes were made.
Introduces a basic TAML deserializer for C++ supporting primitive types, maps, and vectors, enabling round-trip serialization and deserialization. Updates Document::Parse to use the new deserializer. Enhances the test suite with colorized, structured output and better error reporting. Updates CI to run test binaries explicitly after ctest. Lays groundwork for future object mapping via Boost.Describe.
Updated the GitHub Actions workflow to use `find -perm +111` on macOS
for locating executable test binaries, ensuring compatibility across
different operating systems. Other platforms continue to use
`find -executable`. This change ensures reliable test execution
regardless of runner OS.
Updated README.md to clarify that tests do not use third-party frameworks and require Boost headers for certain features. Added instructions for obtaining Boost and a new section detailing third-party licenses for Boost.Describe and Boost.MP11, including guidance on vendoring and license compliance.
@deepx deepx marked this pull request as ready for review January 3, 2026 09:57
@deepx
Copy link
Author

deepx commented Jan 3, 2026

Good news @csharpfritz 👍The TAML library is now functional. Everything is exactly the same as in the .NET version. The build instructions and further information can be found in the file /cpp/readme.md. The GitHub action runs without errors. Draft-Mode is removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant