refactor(xml, png): give the xml and png helpers their own internal packages - #792
Merged
Conversation
…ackages `util/xml_util` moves into the existing `xml` package, next to `XmlFile`, and `util/png_util` becomes a package of its own. The namespaces follow: `util::xml` -> `xml`, `util::png` -> `png`. `util` is for helpers that belong to no engine. Neither of these does: every xml-reading and xml-writing engine goes through the parse and the escaping, and the png writer is the encoder pdf image extraction and svm bitmaps hand their pixels to. The xml half also lands where `xml::` already resolved for `open_strategy`, `svg_file` and `odf_flat_file`. Contents are unchanged apart from the namespace. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MjtSRoykPTFpvHzaJmVLJk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
util/xml_utilmoves into the existingxmlpackage, next toXmlFile, andutil/png_utilbecomes a package of its own. The namespaces follow:util::xml→xml,util::png→png.utilis for helpers that belong to no engine, and neither of these does. Every xml-reading and xml-writing engine goes through the parse and the escaping; the png writer is the encoder pdf image extraction and svm bitmaps hand their pixels to. The xml half also lands wherexml::already resolved foropen_strategy,svg_fileandodf_flat_file— those files were spelling the namespace before the helpers arrived in it.src/odr/internal/util/xml_util.{hpp,cpp}src/odr/internal/xml/xml_util.{hpp,cpp}src/odr/internal/util/png_util.{hpp,cpp}src/odr/internal/png/png_util.{hpp,cpp}test/src/internal/util/xml_util_test.cpptest/src/internal/xml/xml_util_test.cpptest/src/internal/util/png_util_test.cpptest/src/internal/png/png_util_test.cppContents are unchanged apart from the namespace; the rest of the diff is call sites (
xml::parse,xml::escape_attribute,png::write), the two CMake source lists, and re-sorted includes.Docs: the root
AGENTS.mddirectory map (theutil/row, a newpng/row, thexml/row, and the pugixml-layout note that citesxml_util.cpp),xml/AGENTS.md— which gains a short section saying the package is now shared plumbing and a format —svg/AGENTS.md, which cited autil::xml::escapethat had not gone by that name for a while, anddocs/design/editing.md.No
CHANGELOG.mdentry: refactoring is in the generated per-PR list already.Testing
odrandodr_testbuild clean. 63 tests across the xml, png, svg, ooxml, odf and pdf-image suites pass. The data-driven suites did not run —test/datais not fetched in this checkout — so CI is the first place the full suite sees this.