git: 47586ffc8bde - main - libucl: Add a ucl::Ucl::forced_string_value method

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 04 Aug 2025 19:46:39 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=47586ffc8bde236bab65da05ad3c0a660709ba96

commit 47586ffc8bde236bab65da05ad3c0a660709ba96
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-08-04 19:38:06 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-08-04 19:38:06 +0000

    libucl: Add a ucl::Ucl::forced_string_value method
    
    This is a wrapper around ucl_object_tostring_forced.
    
    Sponsored by:   Chelsio Communications
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1794
---
 contrib/libucl/include/ucl++.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/libucl/include/ucl++.h b/contrib/libucl/include/ucl++.h
index fb63430d400d..1cd17eac0c75 100644
--- a/contrib/libucl/include/ucl++.h
+++ b/contrib/libucl/include/ucl++.h
@@ -396,6 +396,11 @@ public:
 		return default_val;
 	}
 
+	std::string forced_string_value () const
+	{
+		return ucl_object_tostring_forced(obj.get());
+	}
+
 	size_t size () const
 	{
 		if (type () == UCL_ARRAY) {