Qore Programming Language Reference Manual  0.8.12.2
 All Classes Namespaces Functions Variables Groups Pages
QC_FileLineIterator.dox.h
1 namespace Qore {
4 
32 
33 public:
35 
44  constructor(string path, *string encoding, *string eol, bool trim = True);
45 
46 public:
48 
56  copy();
57 
58 public:
60 
70 string getEncoding();
71 
72 public:
74 
84 string getFileName();
85 
86 public:
88 
105 string getLine();
106 
107 public:
109 
123 int getPos();
124 
125 public:
127 
144 string getValue();
145 
146 public:
148 
161 hash hstat();
162 
163 public:
165 
177 int index();
178 
179 public:
181 
191 bool isTty();
192 
193 public:
195 
209 bool next();
210 
211 public:
213 
222  reset();
223 
224 public:
226 
239 list stat();
240 
241 public:
243 
254 bool valid();
255 };
256 };
int getPos()
Returns the current file position as an integer giving the offset in bytes from the beginning of the ...
bool valid()
returns True if the iterator is currently pointing at a valid element, False if not ...
list stat()
returns Stat List of stat() of the underlying file
string trim(string str, *string chars)
Removes byte characters from the start and end of a string and returns the new string (also see the t...
const True
logical True
Definition: qc_qore.dox.h:94
constructor(string path, *string encoding, *string eol, bool trim=True)
opens the given file for reading with the given options and creates the FileLineIterator object ...
string getFileName()
returns the file path/name used to open the file
bool next()
Moves the current position to the next line in the file; returns False if there are no more lines to ...
list list(...)
Returns a list of the arguments passed at the top level.
string getValue()
returns the current line in the file or throws an INVALID-ITERATOR exception if the iterator is inval...
reset()
Reset the iterator instance to its initial state.
int index()
returns the current iterator line number in the file (the first line is line 1) or 0 if not pointing ...
bool isTty()
returns True if the FileLineIterator is connected to a terminal device, False if not ...
This class defines a line iterator for text files.
Definition: QC_FileLineIterator.dox.h:31
copy()
Creates a new FileLineIterator object, based on the same object being iterated in the original object...
string getEncoding()
Returns the character encoding for the FileLineIterator.
hash hstat()
returns Stat Hash of hstat() of the underlying file
string getLine()
returns the current line in the file or throws an INVALID-ITERATOR exception if the iterator is inval...
hash hash(object obj)
Returns a hash of an object's members.
This class defines an abstract interface for iterators.
Definition: QC_AbstractIterator.dox.h:10