15 #ifndef RAPIDJSON_MEMORYSTREAM_H_
16 #define RAPIDJSON_MEMORYSTREAM_H_
22 RAPIDJSON_DIAG_OFF(unreachable-code)
23 RAPIDJSON_DIAG_OFF(missing-noreturn)
26 RAPIDJSON_NAMESPACE_BEGIN
43 MemoryStream(
const Ch *src,
size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {}
47 size_t Tell()
const {
return static_cast<size_t>(src_ - begin_); }
55 const Ch* Peek4()
const {
56 return Tell() + 4 <= size_ ? src_ : 0;
65 RAPIDJSON_NAMESPACE_END
71 #endif // RAPIDJSON_MEMORYBUFFER_H_