24 #ifndef STATICLIB_IO_ARRAY_SOURCE_HPP
25 #define STATICLIB_IO_ARRAY_SOURCE_HPP
31 #include "staticlib/config.hpp"
66 src_buf_len(src_buf_len) { }
74 src_buf(src_buf.data()),
75 src_buf_len(src_buf.size()) { }
83 src_buf(src_buf.data()),
84 src_buf_len(src_buf.size()) { }
92 src_buf(other.src_buf),
93 src_buf_len(other.src_buf_len),
103 src_buf = other.src_buf;
104 src_buf_len = other.src_buf_len;
115 src_buf(other.src_buf),
116 src_buf_len(other.src_buf_len),
118 other.src_buf =
nullptr;
119 other.src_buf_len = 0;
130 src_buf = other.src_buf;
131 other.src_buf =
nullptr;
132 src_buf_len = other.src_buf_len;
133 other.src_buf_len = 0;
146 size_t ulen = span.
size();
147 size_t avail = src_buf_len - idx;
149 size_t len = ulen <= avail ? ulen : avail;
150 std::memcpy(span.
data(), src_buf + idx, len);
152 return static_cast<std::streamsize
>(len);
153 }
else return std::char_traits<char>::eof();