stream.h 503 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <ios>
#include <string>

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

		int pos() const { return input.tellg(); }
		operator std::istream& () { return input; }
		operator bool() { return input.good(); }
		bool operator !() { return !input; }

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

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