MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / FileIO

Function FileIO

src/Notepad2.c:5388–5411  ·  view source on GitHub ↗

============================================================================= FileIO()

Source from the content-addressed store, hash-verified

5386//
5387//
5388BOOL FileIO ( BOOL fLoad, LPCWSTR psz, BOOL bNoEncDetect, int *ienc, int *ieol,
5389 BOOL *pbUnicodeErr, BOOL *pbFileTooBig,
5390 BOOL *pbCancelDataLoss, BOOL bSaveCopy )
5391{
5392 WCHAR tch[MAX_PATH + 40];
5393 BOOL fSuccess;
5394 DWORD dwFileAttributes;
5395 BeginWaitCursor();
5396 FormatString ( tch, COUNTOF ( tch ), ( fLoad ) ? IDS_LOADFILE : IDS_SAVEFILE, PathFindFileName ( psz ) );
5397 StatusSetText ( hwndStatus, STATUS_HELP, tch );
5398 StatusSetSimple ( hwndStatus, TRUE );
5399 InvalidateRect ( hwndStatus, NULL, TRUE );
5400 UpdateWindow ( hwndStatus );
5401 if ( fLoad ) {
5402 fSuccess = EditLoadFile ( hwndEdit, psz, bNoEncDetect, ienc, ieol, pbUnicodeErr, pbFileTooBig );
5403 } else {
5404 fSuccess = EditSaveFile ( hwndEdit, psz, *ienc, pbCancelDataLoss, bSaveCopy );
5405 }
5406 dwFileAttributes = GetFileAttributes ( psz );
5407 bReadOnly = ( dwFileAttributes != INVALID_FILE_ATTRIBUTES && dwFileAttributes & FILE_ATTRIBUTE_READONLY );
5408 StatusSetSimple ( hwndStatus, FALSE );
5409 EndWaitCursor();
5410 return ( fSuccess );
5411}
5412//=============================================================================
5413//
5414// FileLoad()

Callers 2

_FileLoadFunction · 0.85
FileSaveFunction · 0.85

Calls 6

BeginWaitCursorFunction · 0.85
FormatStringFunction · 0.85
StatusSetTextFunction · 0.85
EditLoadFileFunction · 0.85
EditSaveFileFunction · 0.85
EndWaitCursorFunction · 0.85

Tested by

no test coverage detected