MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
|
#include <LineCountingByteSource.h>
Public Member Functions | |
LineCountingByteSource () | |
void | SetByteSource (ByteSource &bs) |
void | SetErrorByteSink (ByteSink &bs) |
void | SetLabel (const char *label) |
bool | Msg (Logger::Level type, const char *format,...) |
bool | VMsg (Logger::Level type, const char *format, va_list &ap) |
void | PrintPosition (ByteSink &b) const |
u32 | GetLineNum () const |
u32 | GetByteNum () const |
virtual int | ReadByte () |
![]() | |
ByteSource () | |
s32 | Read () |
void | Unread () |
s32 | Peek () |
virtual | ~ByteSource () |
u32 | GetBytesRead () |
bool | Scan (u64 &result) |
bool | Scan (s32 &result, Format::Type code=Format::DEC, u32 fieldWidth=U32_MAX) |
bool | Scan (u32 &result, Format::Type code=Format::DEC, u32 fieldWidth=U32_MAX) |
bool | Scan (ByteSerializable &byteSerializable, s32 argument=0) |
bool | ScanLexDigits (u32 &digits) |
bool | Scan (ByteSink &result, const u32 fieldWidth) |
s32 | ScanSet (ByteSink &result, const char *setSpec) |
s32 | SkipSet (const char *setSpec) |
s32 | ScanSetFormat (ByteSink &result, const char *&setSpec) |
bool | ScanIdentifier (ByteSink &result) |
bool | ScanHex (ByteSink &result) |
bool | ScanBinary (ByteSink &result) |
bool | ScanCamelIdentifier (ByteSink &result) |
s32 | SkipWhitespace () |
s32 | Scanf (const char *format,...) |
s32 | Vscanf (const char *format, va_list &ap) |
Additional Inherited Members | |
![]() | |
static const char * | WHITESPACE_CHARS = " \n\t\v" |
static const char * | WHITESPACE_SET = "[ \n\t\v]" |
static const char * | NON_WHITESPACE_SET = "[^ \n\t\v]" |
A ByteSource that tracks how many lines of text have been read, and what byte of the current line was most recently read. Useful for providing feedback to help pinpoint errors in ByteSources.
|
inline |
Construct a new LineCountingByteSource which is not attached to another ByteSource and is notready for use.
|
inline |
Gets the number of bytes which have been read from this LineCountingByteSource .
|
inline |
Gets the number of lines which have been read from this LineCountingByteSource .
|
inline |
Prints a formatted message to the error ByteSink held by this LineCountingByteSource using ... style formatting. This routes control to
VMsg()
directly.
type | The Logger Level which this formatted message will be printed at. |
format | The formatting string used with the argument list to generate a formatted message. |
true
if type
is less elevated than the Logger Message Level , else false
.
|
inline |
Prints a colon separated formatted message describing this LineCountingByteSink , in the format:
<label>:<linesRead>:<bytesRead>
b | The ByteSink to print this formatted message to. |
|
inlinevirtual |
Gets the next 32-bit character from this ByteSource , regardless of whether or not Unread()
has been called.
Implements MFM::ByteSource.
|
inline |
Sets the ByteSource which will be monitored through this LineCountingByteSource .
The | new ByteSource which will be monitored. |
|
inline |
Sets the ByteSink that this LineCountingByteSource will use to report any errors encountered during its operation.
The | new ByteSink used by this LineCountingByteSource for error reporting. |
|
inline |
Sets the label of this LineCountingByteSink, which is used during printing for identification.
label | The new string label of this LineCountingByteSink |
|
inline |
Prints a formatted message to the error ByteSink held by this LineCountingByteSource using a va_list
style formatting. First, the position is printed, then the kind of message is printed, then the formatted message is printed.
type | The Logger Level which this formatted message will be printed at. |
format | The formatting string used with the argument list to generate a formatted message. |
ap | The argument list used with the formatting string to generate a formatted message . |
true
if type
is less elevated than the Logger Message Level , else false
.