2008-09-04 02:20:39 +04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <ios>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace YAML
|
|
|
|
|
{
|
2009-02-01 23:48:43 +03:00
|
|
|
class Stream
|
2008-09-04 02:20:39 +04:00
|
|
|
{
|
2009-02-01 23:48:43 +03:00
|
|
|
public:
|
|
|
|
|
Stream(std::istream& input);
|
|
|
|
|
~Stream();
|
2008-09-04 02:20:39 +04:00
|
|
|
|
2009-02-01 23:48:43 +03:00
|
|
|
operator bool() const;
|
|
|
|
|
bool operator !() const { return !static_cast <bool>(*this); }
|
2008-09-04 02:20:39 +04:00
|
|
|
|
2009-02-01 23:48:43 +03:00
|
|
|
const char *current() const { return buffer + pos; }
|
2008-09-04 02:20:39 +04:00
|
|
|
char peek();
|
|
|
|
|
char get();
|
|
|
|
|
std::string get(int n);
|
|
|
|
|
void eat(int n = 1);
|
|
|
|
|
|
2009-02-01 23:48:43 +03:00
|
|
|
int pos, line, column, size;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
char *buffer;
|
2008-09-04 02:20:39 +04:00
|
|
|
};
|
|
|
|
|
}
|