Skip to content

fkYAML version 0.4.1

Latest
Compare
Choose a tag to compare
@fktn-k fktn-k released this 11 Jan 01:56
· 1 commit to develop since this release

What's Changed

✨ New Features

  • Add get_value_inplace API to basic_node (#443, @fktn-k)
    • The new API get_value_inplace() converts a node value into a given type and writes the result into a given output parameter.
    • The target type doesn't have to be default-constructible since the API doesn't construct an instance during the conversion.
    • See the dedicated API reference page for more details.
  • Mapping key/value access in range based for loops (#458, @fktn-k)
    • Proposed by @sndth in the discussion #400
    • The new API map_items() allows accessing mapping keys/values in range-based for loops.
    • Structured binding support is added to fkyaml::basic_node::iterator and fkyaml::basic_node::const_iterator.
      fkyaml::node mapping = {{"a", 123}, {"b", 3.14}};
      for (auto& [key, val] : mapping.map_items()) {
          // `key` and `val` are both of type `fkyaml::node::reference`.
          std::cout << "key: " << key << ", value: " << val << std::endl;
      }
      // output:
      // key: a, value: 123
      // key: b, value: 3.14
    • See the dedicated API reference page for more details.
  • support std::forward_list in from_node (#444, @fktn-k)

⚡ Improvements

🐛 Bug Fixes

  • Emit an error if ":" is missing after a mapping key (#450, @fktn-k)
  • Fix bad indentation detection for block collection entries (#451, @fktn-k)
  • Fix serialization of empty collections
    • fix: Fixed a bug where serialize didn't write out empty vectors and mappings (#456, @johan-gson)
    • Add test cases for serializing empty collection nodes (#457, @fktn-k)
    • Fix: made sure that empty documents just serialize to [] or {} (#460, @johan-gson)
    • Add test cases for serializing root empty collections (#461, @fktn-k)

🤖 CI

  • Update workflow jobs for release artifacts (#447, @fktn-k)
    • Adds new release artifacts (fkYAML_min.zip, fkYAML_min.tgz) which contain minimum required files for CMake. (roughly the top CMakeLists.txt & include|single_include directories)
    • They reduces the cost of downloading unnecessary files for a client app by using the CMake FetchContent module.
      FetchContent_Declare(
          fkYAML
          URL https://github.com/fktn-k/fkYAML/releases/download/v0.4.1/fkYAML_min.zip
      )
      FetchContent_MakeAvailable(fkYAML)

📝 Documentation

  • Revise the contents of API References (#445, @fktn-k)
  • Update copyright year and directory structure (#452, @fktn-k)
  • Fix invalid paths for documentation & other tools (#453, @fktn-k)

Full Changelog

v0.4.0...v0.4.1