mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2026-01-04 01:49:42 -06:00
The main thing that's added is full RS support, but a lot of things were rejigged along the way. The tests are still a bit lacking, and will be augmented in future commits.
35 lines
901 B
C++
35 lines
901 B
C++
#include "Bincode.hpp"
|
|
#include "Common.hpp"
|
|
|
|
std::ostream& operator<<(std::ostream& out, const BincodeBytesRef& x) {
|
|
return goLangBytesFmt(out, x.data(), x.size());
|
|
/*
|
|
out << "b\"";
|
|
uint8_t len = x.size();
|
|
const uint8_t* data = (const uint8_t*)x.data();
|
|
for (int i = 0; i < len; i++) {
|
|
uint8_t ch = data[i];
|
|
if (isprint(ch)) {
|
|
out << ch;
|
|
} else if (ch == 0) {
|
|
out << "\\0";
|
|
} else {
|
|
const char cfill = out.fill();
|
|
out << std::hex << std::setfill('0');
|
|
out << "\\x" << std::setw(2) << (int)ch;
|
|
out << std::setfill(cfill) << std::dec;
|
|
}
|
|
}
|
|
out << "\"";
|
|
return out;
|
|
*/
|
|
}
|
|
|
|
std::ostream& operator<<(std::ostream& out, const BincodeBytes& x) {
|
|
return out << x.ref();
|
|
}
|
|
|
|
const char* BincodeException::what() const noexcept {
|
|
return _msg.c_str();
|
|
}
|