From 4536fa500087e06209700b20809e486054e2240f Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 20 Jan 2026 12:40:26 -0500 Subject: [PATCH] xo-reader2: + pretty-printing for ParserResult + use in utest --- include/xo/object2/DString.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/xo/object2/DString.hpp b/include/xo/object2/DString.hpp index f35fe44..eea8ea5 100644 --- a/include/xo/object2/DString.hpp +++ b/include/xo/object2/DString.hpp @@ -279,6 +279,15 @@ namespace xo { ///@} }; + inline std::ostream & operator<<(std::ostream & os, const DString * x) { + if (x) { + os << std::string_view(*x); + } else { + os << "nullptr"; + } + return os; + } + inline bool operator==(const DString & lhs, const DString & rhs) { return DString::compare(lhs, rhs) == 0; }