33 size_t size,
size_t valueSize)
35 std::ostringstream ss;
37 ss <<
"Attempted to " << (add ?
"put" :
"get") <<
" value with size: "
38 << valueSize <<
" in ByteBuffer (pos: " << pos <<
" size: " << size
47 std::ostringstream ss;
49 ss <<
"Attempted to put a "
50 << (valueSize > 0 ?
"NULL-pointer" :
"zero-sized value")
51 <<
" in ByteBuffer (pos: " << pos <<
" size: " << size <<
")";
63 value = read<float>();
64 if (!std::isfinite(value))
71 value = read<double>();
72 if (!std::isfinite(value))
82 char c = read<char>();
87 if (requireValidUtf8 && !utf8::is_valid(value.begin(), value.end()))
98 size_t const newSize =
_wpos + cnt;
103 else if (newSize < 750)
105 else if (newSize < 6000)
120 ASSERT(src,
"Attempted to put a NULL-pointer in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", pos,
size());
121 ASSERT(cnt,
"Attempted to put a zero-sized value in ByteBuffer (pos: " SZFMTD " size: " SZFMTD ")", pos,
size());
123 std::memcpy(&
_storage[pos], src, cnt);
131 std::ostringstream o;
132 o <<
"STORAGE_SIZE: " <<
size();
134 o << read<uint8>(i) <<
" - ";
145 std::ostringstream o;
146 o <<
"STORAGE_SIZE: " <<
size();
150 snprintf(buf, 2,
"%c", read<uint8>(i));
164 std::ostringstream o;
165 o <<
"STORAGE_SIZE: " <<
size();
170 snprintf(buf, 4,
"%2X ", read<uint8>(i));
171 if ((i == (j * 8)) && ((i != (k * 16))))
176 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.