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

Method ReadString

sourcecommon/File.cpp:259–282  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

257}
258//---------------------------------------------------------------------------
259bool __fastcall TFile::ReadString(char * data, DWORD size)
260{
261 if( ! handle ) return false;
262 LONG pos = GetPointer();
263
264 DWORD i;
265 //bool found=false;
266 int eol = 0;
267 DWORD bytes;
268 Error = ! ReadFile(handle, data, size-1, &bytes, NULL);
269 if( !bytes ) { Error = true; goto End; }
270
271 // ���� ���� �������-�� ���� �����-�� ������������ ������
272 for(i=0; (i<size-1) && (i<bytes); i++)
273 {
274 if( data[i]=='\r' || data[i]=='\n' ) { if( ++eol>2 ) break; }
275 else { if( eol>0 ) break; }
276 }
277 data[i]=0;
278 SetPointer(pos + i);
279End:;
280 if( Exceptions && Error ) throw 0;
281 return ! Error;
282}
283//---------------------------------------------------------------------------
284bool __fastcall TFile::ReadString(AnsiString & data, DWORD maxsize)
285{

Callers 4

LoadMethod · 0.45
LoadPositionFunction · 0.45
AddToLastOpenDocsFunction · 0.45
AddLastOpenDocsToMenuFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected