MCPcopy Create free account
hub / github.com/AGWA/git-crypt / underflow

Method underflow

fhstream.cpp:150–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150ifhbuf::int_type ifhbuf::underflow ()
151{
152 if (gptr() >= egptr()) { // A true underflow (no bytes in buffer left to read)
153
154 // Move the putback_size most-recently-read characters into the putback area
155 size_t nputback = std::min<size_t>(gptr() - eback(), putback_size);
156 std::memmove(buffer + (putback_size - nputback), gptr() - nputback, nputback);
157
158 // Now read new characters from the file descriptor
159 const size_t nread = read_fun(handle, buffer + putback_size, buffer_size);
160 if (nread == 0) {
161 // EOF
162 return traits_type::eof();
163 }
164
165 // Reset the buffer
166 reset_buffer(nputback, nread);
167 }
168
169 // Return the next character
170 return traits_type::to_int_type(*gptr());
171}
172
173std::streamsize ifhbuf::xsgetn (char* s, std::streamsize n)
174{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected