Jive reference manual
|
#include <jem/io/LineNumberReader.h>
Public Member Functions | |
LineNumberReader (const Ref< Reader > &in, lint lineno=1L) | |
LineNumberReader (const Self &rhs) | |
virtual Ref< Reader > | dup () |
virtual void | close () |
Closes this input stream. More... | |
virtual idx_t | poll (const Time &timeout) |
virtual int | read () |
Extracts the next character from this input stream. More... | |
virtual idx_t | read (char *buf, idx_t n) |
virtual void | pushBack (int c) |
Pushes back a previously read character. More... | |
lint | getLineNumber () const |
void | setLineNumber (lint lineno) |
![]() | |
virtual void | lock () |
Locks this input stream. More... | |
virtual void | unlock () |
Unlocks this input stream. More... | |
virtual int | poll () |
Returns the number of characters that can read without blocking. More... | |
virtual int | read (char *buf, int n) |
Extracts multiple characters from this input stream. More... | |
virtual int | readUntil (char *buf, int n, int delim) |
Reads characters until a specified character. More... | |
virtual void | skipUntil (int delim) |
Skips characters until a specified character. More... | |
virtual void | skipWhite () |
Skips over white space. More... | |
virtual int | skip (int n) |
Skips over a specified number of characters. More... | |
String | readLine () |
Reads the next line from this input stream. More... | |
virtual byte | parseByte () |
Reads a byte from this input stream. More... | |
virtual bool | parseBool () |
Reads a boolean from this input stream. More... | |
virtual long | parseInt () |
Reads a long integer from this input stream. More... | |
virtual double | parseFloat () |
Reads a double from this input stream. More... | |
![]() | |
virtual Class * | getClass () const |
Returns the Class instance representing the runtime class of this object. More... | |
virtual String | toString () const |
Returns a short textual description of this object. More... | |
virtual long | hashValue () const |
Returns a hash value for this object. More... | |
virtual bool | equals (const Ref< Object > &obj) const |
Tests whether two objects are equal. More... | |
Ref< Object > | clone () const |
Returns a copy of this object. More... | |
Protected Member Functions | |
virtual | ~LineNumberReader () |
![]() | |
Collectable () | |
Creates an empty Collectable . More... | |
~Collectable () | |
Frees resources. More... | |
![]() | |
virtual | ~Interface () |
Empty destructor. More... | |
Protected Attributes | |
Ref< Reader > | input_ |
lint | lineno_ |
Additional Inherited Members | |
![]() | |
static Class * | getType () |
Returns the Class instance representing the Object class. More... | |
![]() | |
TextInput & | operator>> (TextInput &in, bool &b) |
Reads a boolean from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, byte &b) |
Reads a byte from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, char &c) |
Reads a character from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, short &i) |
Reads a short integer from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, int &i) |
Reads an integer from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, long &i) |
Reads a long integer from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, float &f) |
Reads a float from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, double &d) |
Reads a double from a text input stream. More... | |
TextInput & | operator>> (TextInput &in, TextInput &(*manip)(TextInput &)) |
Applies a manipulator function to a text input stream. More... | |
TextInput & | skipWhite (TextInput &in) |
Extracts white space from a text input stream. More... | |
jem::io::LineNumberReader::LineNumberReader | ( | const Self & | rhs | ) |
|
protectedvirtual |
|
virtual |
Closes this input stream. After calling this function, one should not attempt to read any more characters from this stream.
The default implementation provided by the Reader
class does nothing.
IOException | - if an I/O error occurs. |
Reimplemented from jem::io::Reader.
|
virtual |
|
virtual |
Returns the next character, cast to an int
, from this input stream. If the end of the stream has been reached, -1
is returned.
-1
.IOException | - if an I/O error occurs. |
Implements jem::io::TextInput.
|
virtual |
|
virtual |
Pushes back the character c, cast to an unsigned char
, into this input stream. This character must have been previously extracted from the input stream by calling one of the read()
member functions. The pushed back character will be the first character to be extracted from the input stream when one of the read()
member functions is called.
Characters must be pushed back in the same order as they have been read; one is not allowed to alter the contents of the input stream.
If the character c has a negative value, this function does nothing.
Example:
c | - the character to be pushed back. |
this->read() == c
.IOException | - if an I/O error occurs. |
Implements jem::io::TextInput.
lint jem::io::LineNumberReader::getLineNumber | ( | ) | const |
void jem::io::LineNumberReader::setLineNumber | ( | lint | lineno | ) |
|
protected |