stream.h 435 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#pragma once

#include <ios>
#include <string>

namespace YAML
{
	struct Stream
	{
		Stream(std::istream& input_): input(input_), line(0), column(0) {}

12
13
14
		int pos() const;
		operator bool();
		bool operator !() { return !(*this); }
15

16
17
		std::istream& stream() const { return input; }
		char peek();
18
19
20
		char get();
		std::string get(int n);
		void eat(int n = 1);
21
22
23
24
25

		std::istream& input;
		int line, column;
	};
}