MCPcopy Create free account
hub / github.com/davisking/dlib / pbackfail

Method pbackfail

dlib/sockstreambuf/sockstreambuf_unbuffered.cpp:110–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108// ----------------------------------------------------------------------------------------
109
110 sockstreambuf_unbuffered::int_type sockstreambuf_unbuffered::
111 pbackfail(
112 int_type c
113 )
114 {
115 // if they are trying to push back a character that they didn't read last
116 // that is an error
117 if (c != EOF && c != lastread)
118 return EOF;
119
120 // if they are trying to push back a second character then thats an error
121 if (lastread_next)
122 return EOF;
123
124 lastread_next = true;
125 return 1;
126 }
127
128// ----------------------------------------------------------------------------------------
129

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected