---------------------------------------------------------------------------
| 257 | } |
| 258 | //--------------------------------------------------------------------------- |
| 259 | bool __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); |
| 279 | End:; |
| 280 | if( Exceptions && Error ) throw 0; |
| 281 | return ! Error; |
| 282 | } |
| 283 | //--------------------------------------------------------------------------- |
| 284 | bool __fastcall TFile::ReadString(AnsiString & data, DWORD maxsize) |
| 285 | { |
no outgoing calls
no test coverage detected