From cb4b5f37691ebce03665893fb1d7e005406845e2 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 16 Jan 2026 17:11:50 -0500 Subject: [PATCH] xo-expression2: + DUniqueString.pretty() --- include/xo/expression2/DUniqueString.hpp | 7 +++++++ src/expression2/DUniqueString.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/include/xo/expression2/DUniqueString.hpp b/include/xo/expression2/DUniqueString.hpp index 4d7dc0fd..46fdfa1e 100644 --- a/include/xo/expression2/DUniqueString.hpp +++ b/include/xo/expression2/DUniqueString.hpp @@ -28,6 +28,7 @@ namespace xo { using AAllocator = xo::mm::AAllocator; using ACollector = xo::mm::ACollector; using size_type = DString::size_type; + using ppindentinfo = xo::print::ppindentinfo; /* Memory model for a DUniqueString allocated via xo allocator * @@ -74,6 +75,12 @@ namespace xo { std::size_t hash() const noexcept { return _text()->hash(); } operator std::string_view() const noexcept { return std::string_view(*_text()); } + ///@} + /** @defgroup duniquestring-printable-methods printable facet methods **/ + ///@{ + + bool pretty(const ppindentinfo & ppii) const; + ///@} /** @defgroup duniquestring-gcobject-methods gcobject facet methods **/ ///@{ diff --git a/src/expression2/DUniqueString.cpp b/src/expression2/DUniqueString.cpp index 3e534b9c..d0a4b0a0 100644 --- a/src/expression2/DUniqueString.cpp +++ b/src/expression2/DUniqueString.cpp @@ -33,6 +33,12 @@ namespace xo { return (const DString *)(((std::byte *)this) + offset); } + bool + DUniqueString::pretty(const ppindentinfo & ppii) const + { + return _text()->pretty(ppii); + } + DUniqueString * DUniqueString::from_view(obj mm, std::string_view sv)