From 9bda00793d2ed25e9e55766e12753299a825a951 Mon Sep 17 00:00:00 2001 From: TennesseeTrash Date: Fri, 26 Sep 2025 01:54:28 +0200 Subject: [PATCH] Add the ability to print a nested item --- LibCBOR/Include/CBOR/Printer.hpp | 3 +++ LibCBOR/Source/Printer.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/LibCBOR/Include/CBOR/Printer.hpp b/LibCBOR/Include/CBOR/Printer.hpp index 8efe7df..a944b58 100644 --- a/LibCBOR/Include/CBOR/Printer.hpp +++ b/LibCBOR/Include/CBOR/Printer.hpp @@ -1,12 +1,15 @@ #ifndef LIBCBOR_PRINTER_HPP #define LIBCBOR_PRINTER_HPP +#include "Decoder.hpp" + #include #include namespace CBOR { void Print(std::ostream &out, std::span buffer); + void Print(std::ostream &out, CBOR::Item item); } #endif // LIBCBOR_PRINTER_HPP diff --git a/LibCBOR/Source/Printer.cpp b/LibCBOR/Source/Printer.cpp index 89716c3..f537da6 100644 --- a/LibCBOR/Source/Printer.cpp +++ b/LibCBOR/Source/Printer.cpp @@ -143,4 +143,9 @@ namespace CBOR Print(out, 0, dec.AsItem()); out << '\n'; } + + void Print(std::ostream &out, CBOR::Item item) + { + Print(out, 0, std::move(item)); + } }