34 std::ostringstream ss;
36 ss <<
"Attempted to " << (add ?
"put" :
"get") <<
" value with size: "
37 << valueSize <<
" in ByteBuffer (pos: " << pos <<
" size: " << size
45 std::ostringstream ss;
47 ss <<
"Attempted to put a "
48 << (valueSize > 0 ?
"NULL-pointer" :
"zero-sized value")
49 <<
" in ByteBuffer (pos: " << pos <<
" size: " << size <<
")";
61 value = read<float>();
62 if (!std::isfinite(value))
69 value = read<double>();
70 if (!std::isfinite(value))
80 char c = read<char>();
85 if (requireValidUtf8 && !utf8::is_valid(value.begin(), value.end()))
96 size_t const newSize =
_wpos + cnt;
101 else if (newSize < 750)
103 else if (newSize < 6000)
118 ASSERT(src,
"Attempted to put a NULL-pointer in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", pos,
size());
119 ASSERT(cnt,
"Attempted to put a zero-sized value in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", pos,
size());
121 std::memcpy(&
_storage[pos], src, cnt);
129 std::ostringstream o;
130 o <<
"STORAGE_SIZE: " <<
size();
132 o << read<uint8>(i) <<
" - ";
143 std::ostringstream o;
144 o <<
"STORAGE_SIZE: " <<
size();
148 snprintf(buf, 2,
"%c", read<uint8>(i));
162 std::ostringstream o;
163 o <<
"STORAGE_SIZE: " <<
size();
168 snprintf(buf, 4,
"%2X ", read<uint8>(i));
169 if ((i == (j * 8)) && ((i != (k * 16))))
174 else if (i == (k * 16))
#define TC_LOG_TRACE(filterType__,...)
std::string & message() noexcept
ByteBufferInvalidValueException(char const *type, char const *value)
ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize)
ByteBufferSourceException(size_t pos, size_t size, size_t valueSize)
std::vector< uint8 > _storage
void print_storage() const
std::string ReadCString(bool requireValidUtf8=true)
void put(std::size_t pos, T value)
ByteBuffer & operator>>(bool &value)
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default TC string format function.