mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 11:18:36 +12:00
Moved the input stream, together with line/column info, into its own class, which allowed some other stuff just to pass the stream, and not have to be a member of Scanner.
This commit is contained in:
parent
0d5a97bffe
commit
ff99f85a6d
13 changed files with 162 additions and 142 deletions
26
stream.h
Normal file
26
stream.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <ios>
|
||||
#include <string>
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
struct Stream
|
||||
{
|
||||
Stream(std::istream& input_): input(input_), line(0), column(0) {}
|
||||
|
||||
char peek() { return input.peek(); }
|
||||
int pos() const { return input.tellg(); }
|
||||
operator std::istream& () { return input; }
|
||||
operator bool() { return input.good(); }
|
||||
bool operator !() { return !input; }
|
||||
|
||||
char GetChar();
|
||||
std::string GetChar(int n);
|
||||
void Eat(int n = 1);
|
||||
void EatLineBreak();
|
||||
|
||||
std::istream& input;
|
||||
int line, column;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue