Lines Matching defs:buf
24 StreamBuffer::StreamBuffer(const StreamBuffer &buf)
26 Clone(buf);
66 bool StreamBuffer::Read(std::string &buf)
73 buf = ReadBuf();
74 rPos_ += static_cast<int32_t>(buf.length()) + 1;
75 return (buf.length() > 0);
78 bool StreamBuffer::Write(const std::string &buf)
80 return Write(buf.c_str(), buf.length()+1);
83 bool StreamBuffer::Read(StreamBuffer &buf)
85 return buf.Write(Data(), Size());
88 bool StreamBuffer::Write(const StreamBuffer &buf)
90 return Write(buf.Data(), buf.Size());
93 bool StreamBuffer::Read(char *buf, size_t size)
98 if (buf == nullptr) {
99 MMI_HILOGE("Invalid input parameter buf=nullptr errCode:%{public}d", ERROR_NULL_POINTER);
113 errno_t ret = memcpy_sp(buf, size, ReadBuf(), size);
124 bool StreamBuffer::Write(const char *buf, size_t size)
129 if (buf == nullptr) {
130 MMI_HILOGE("Invalid input parameter buf=nullptr errCode:%{public}d", ERROR_NULL_POINTER);
145 errno_t ret = memcpy_sp(&szBuff_[wPos_], GetAvailableBufSize(), buf, size);
212 bool StreamBuffer::Clone(const StreamBuffer &buf)
215 return Write(buf.Data(), buf.Size());