MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / SetFile

Method SetFile

source/main.cpp:307–340  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

305}
306//---------------------------------------------------------------------------
307void __fastcall TMainForm::SetFile(String f)
308{
309 TWaitCursor wait;
310
311 in.Close();
312 fFile = f;
313 Clear();
314 // important OPEN_ALWAYS
315 in.Open(fFile, GENERIC_READ,
316 FILE_SHARE_READ | FILE_SHARE_WRITE,
317 OPEN_ALWAYS,
318 FILE_ATTRIBUTE_NORMAL);
319 if( !in )
320 return;
321
322 FileSize = in.GetSize64();
323 // Since the beginning of the file, look at the size limit
324 if( FileSize > (ULONGLONG)SizeToRead )
325 {
326 aMoreLines->Enabled = true;
327
328 in.Pointer64 = FileSize - SizeToRead;
329 // Positioning at the beginning of a new line in the file
330 GotoNewLine();
331 }
332 else
333 {
334 aMoreLines->Enabled = false;
335 }
336
337 Read(true); // limit lines count off: show all readed lines
338
339 UpdateDislpayInfo();
340}
341//---------------------------------------------------------------------------
342void __fastcall PreRotateFile(String FileName)
343{

Callers 1

PostRotateFileFunction · 0.45

Calls 3

GetSize64Method · 0.80
CloseMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected