#include <InputFile.h>
Collaboration diagram for InputFile:

Public Methods | |
| InputFile (const std::string &filename_, int bufsize_=RS_INPUTFILE_BUFSIZE) | |
| open a file for reading. More... | |
| InputFile (int bufsize_=RS_INPUTFILE_BUFSIZE) | |
| open STDIN for reading. More... | |
| virtual | ~InputFile () |
| close the InputFile. More... | |
| void | autoLinebreak (int max_line_length, const std::string &toBreak, int toBreakAtPos) |
| defines a substring where lines may be broken automatically. More... | |
| bool | getLine (std::string &result) |
| read next line from file. More... | |
| unsigned long | getLineNumber () const |
| get number of last line read by getLine. More... | |
| void | ignoreEmptyLines (bool ignore) |
| what to do with empty lines. More... | |
| void | throw_Error (const std::string &message) const |
| raise an Error referencing the current linenumber. More... | |
Private Methods | |
| void | fillBuffer () |
Private Attributes | |
| std::string | filename |
| unsigned long | current_line |
| FILE * | in |
| size_t | bufsize |
| size_t | offset |
| size_t | filled |
| char * | buffer |
| bool | end_of_file_seen |
| bool | ignore_empty |
| int | do_auto_break |
| std::string | breakAt |
| int | breakAtPos |
Definition at line 43 of file InputFile.h.
|
||||||||||||
|
open a file for reading.
Definition at line 32 of file InputFile.cpp. |
|
|
open STDIN for reading.
Definition at line 55 of file InputFile.cpp. |
|
|
close the InputFile.
Definition at line 79 of file InputFile.h. |
|
|
Definition at line 58 of file InputFile.h. Referenced by InputFile::getLine(), and InputFile::InputFile(). |
|
||||||||||||||||
|
defines a substring where lines may be broken automatically.
InputFile html("index.html"); html.autoLinebreak(80, "><", 1); InputFile text("example.txt"); text.autoLinebreak(80, " ", 1);
Definition at line 75 of file InputFile.cpp. |
|
|
read next line from file.
Definition at line 85 of file InputFile.cpp. Referenced by FileFilter::getLine(). |
|
|
get number of last line read by getLine.
Definition at line 111 of file InputFile.h. |
|
|
what to do with empty lines.
Definition at line 116 of file InputFile.h. |
|
|
raise an Error referencing the current linenumber. The raised Error contains sth like 'Error in filename (#linenumber): message'
Definition at line 126 of file InputFile.h. |
|
|
Definition at line 45 of file InputFile.h. |
|
|
Definition at line 46 of file InputFile.h. Referenced by InputFile::getLine(). |
|
|
Definition at line 47 of file InputFile.h. Referenced by InputFile::InputFile(). |
|
|
Definition at line 48 of file InputFile.h. Referenced by InputFile::InputFile(). |
|
|
Definition at line 49 of file InputFile.h. Referenced by InputFile::getLine(). |
|
|
Definition at line 50 of file InputFile.h. Referenced by InputFile::getLine(). |
|
|
Definition at line 51 of file InputFile.h. Referenced by InputFile::getLine(), and InputFile::InputFile(). |
|
|
Definition at line 52 of file InputFile.h. |
|
|
Definition at line 53 of file InputFile.h. Referenced by InputFile::getLine(). |
|
|
Definition at line 54 of file InputFile.h. Referenced by InputFile::autoLinebreak(), and InputFile::getLine(). |
|
|
Definition at line 55 of file InputFile.h. Referenced by InputFile::autoLinebreak(), and InputFile::getLine(). |
|
|
Definition at line 56 of file InputFile.h. Referenced by InputFile::autoLinebreak(), and InputFile::getLine(). |
|
Contact me in case of errors or questions. This documentation is powered by |
(C) 2000-2002 |