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

Method setbuf

fhstream.cpp:114–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114std::streambuf* ofhbuf::setbuf (char* s, std::streamsize n)
115{
116 if (s == 0 && n == 0) {
117 // Switch to unbuffered
118 // This won't take effect until the next overflow or sync
119 // (We defer it taking effect so that write errors can be properly reported)
120 // To cause it to take effect as soon as possible, we artificially reduce the
121 // size of the buffer so it has no space left. This will trigger an overflow
122 // on the next put.
123 std::streambuf::setp(pbase(), pptr());
124 std::streambuf::pbump(pptr() - pbase());
125 buffer_size = 1;
126 }
127 return this;
128}
129
130
131

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected