LoadTextFile

 

Description

Get the contents of a text file.

Syntax

int LoadTextFile( string & strText, LPCSTR lpcszFile, uint iNumLines = 0, uint iFirstLine = 0, uint iSkipLines = 0 )

Parameters

strText
[output] the contents of a text file on success and "" on failure.
lpcszFile
[input] full path and file name to read
iNumLines
[input] number of lines to read not counting skipped lines, default 0 reads all lines (after iFirstLine)
iFirstLine
[input] first line to read, default 0 reads first line
iSkipLines
[input] number of lines to skip for every one line read, default 0 skips no lines

Return

Returns zero for success or non-zero to indicate error.

Examples

EX1

int LoadTextFile_ex1()
{
    string strText;
    int iError = LoadTextFile(strText, "C:\\Origin80\\Origin.ini");
    return 0;
}

Remark

See Also

header to Include

origin.h

Reference