MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / LoadHistory

Method LoadHistory

neo/framework/Console.cpp:545–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545void idConsoleLocal::LoadHistory() {
546 idFile *f = fileSystem->OpenFileRead( "consolehistory.dat" );
547 if ( f == NULL ) // file doesn't exist
548 return;
549
550 historyLine = 0;
551 idStr tmp;
552 for ( int i=0; i < COMMAND_HISTORY; ++i ) {
553 if ( f->Tell() >= f->Length() ) {
554 break; // EOF is reached
555 }
556 f->ReadString(tmp);
557 historyEditLines[i].SetBuffer(tmp.c_str());
558 ++historyLine;
559 }
560 nextHistoryLine = historyLine;
561 fileSystem->CloseFile(f);
562}
563
564/*
565================

Callers 1

Common.cppFile · 0.80

Calls 7

OpenFileReadMethod · 0.80
SetBufferMethod · 0.80
CloseFileMethod · 0.80
TellMethod · 0.45
LengthMethod · 0.45
ReadStringMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected