MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / RollbackFilePointer

Method RollbackFilePointer

source/TextIO.h:140–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 virtual __int64 _Length() const = 0;
139
140 void RollbackFilePointer()
141 {
142 if (mPos) // Buffered reading was used.
143 {
144 // Discard the buffer and rollback the file pointer.
145 ptrdiff_t offset = (mPos - mBuffer) - mLength; // should be a value <= 0
146 _Seek(offset, SEEK_CUR);
147 // Callers expect the buffer to be cleared (e.g. to be reused for buffered writing), so if
148 // _Seek fails, the data is simply discarded. This can probably only happen for non-seeking
149 // devices such as pipes or the console, which won't typically be both read from and written to:
150 mPos = NULL;
151 mLength = 0;
152 }
153 }
154
155 void FlushWriteBuffer()
156 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected