xo-expression2: + DUniqueString.pretty()

This commit is contained in:
Roland Conybeare 2026-01-16 17:11:50 -05:00
commit 079c96ffe4
2 changed files with 13 additions and 0 deletions

View file

@ -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 **/
///@{

View file

@ -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<AAllocator> mm,
std::string_view sv)