File: IOStreamGetLine.txt

package info (click to toggle)
boxbackup 0.13~~git20200326.g8e8b63c-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,984 kB
  • sloc: xml: 70,723; cpp: 55,437; ansic: 24,659; perl: 4,844; sh: 4,292; makefile: 629; python: 311
file content (29 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CLASS IOStreamGetLine

This class provides a convenient way to read text from a file, line by line. It also can preprocess the line to remove leading and trailing whitespace and comments. Comments are started by the character # and run to the end of the line.

Create an instance by passing a reference to a stream into the constructor.

Note the class does internal buffering, so you can only detach it later if the stream supports seeking backwards.


FUNCTION IOStreamGetLine::GetLine()

Returns true if a line could be retreieved without a read timing out.


FUNCTION IOStreamGetLine::IsEOF()

Whether the end of the stream has been reached. Do not call GetLine if this is true.


FUNCTION IOStreamGetLine::GetLineNumber()

Returns the line number.


FUNCTION IOStreamGetLine::DetachFile()

Detaches the stream from the GetLine class. Will seek backwards to "replace" data it's buffered back in the stream.