Add the ability to print a nested item
This commit is contained in:
parent
f383ea9f66
commit
9bda00793d
2 changed files with 8 additions and 0 deletions
|
@ -1,12 +1,15 @@
|
||||||
#ifndef LIBCBOR_PRINTER_HPP
|
#ifndef LIBCBOR_PRINTER_HPP
|
||||||
#define LIBCBOR_PRINTER_HPP
|
#define LIBCBOR_PRINTER_HPP
|
||||||
|
|
||||||
|
#include "Decoder.hpp"
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
namespace CBOR
|
namespace CBOR
|
||||||
{
|
{
|
||||||
void Print(std::ostream &out, std::span<const std::uint8_t> buffer);
|
void Print(std::ostream &out, std::span<const std::uint8_t> buffer);
|
||||||
|
void Print(std::ostream &out, CBOR::Item item);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LIBCBOR_PRINTER_HPP
|
#endif // LIBCBOR_PRINTER_HPP
|
||||||
|
|
|
@ -143,4 +143,9 @@ namespace CBOR
|
||||||
Print(out, 0, dec.AsItem());
|
Print(out, 0, dec.AsItem());
|
||||||
out << '\n';
|
out << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Print(std::ostream &out, CBOR::Item item)
|
||||||
|
{
|
||||||
|
Print(out, 0, std::move(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue