Return the contents of a file as a string.
Source position: filutilh.inc line 293
function GetFileAsString( |
const aFileName: RawByteString |
):RawByteString; |
const aFileName: RawByteString; |
aEncoding: TEncoding |
):RawByteString; |
const aFileName: UnicodeString |
):UnicodeString; |
const aFileName: UnicodeString; |
aEncoding: TEncoding |
):UnicodeString; |
GetFileAsString returns the contents of aFileName or aHandle as a string. You can specify the string encoding in the aEncoding argument. If no encoding is specified TEncoding.SystemEncoding is used. The whole file is read in the case of aHandle: The file position is first set to offset zero.
If an invalid file handle or a file handle that does not support the seek operation, a EInOutError exception is raised.
|
Return the contents of a file as an array of bytes. |
|
|
System encoding. |
|
TEncoding.GetAnsiString |