mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Switched to reading the entire file into a buffer at the start.\nThis speeds it up a TON (like 100x).
This commit is contained in:
19
src/stream.h
19
src/stream.h
@@ -5,21 +5,24 @@
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
struct Stream
|
||||
class Stream
|
||||
{
|
||||
Stream(std::istream& input_): input(input_), line(0), column(0) {}
|
||||
public:
|
||||
Stream(std::istream& input);
|
||||
~Stream();
|
||||
|
||||
int pos() const;
|
||||
operator bool();
|
||||
bool operator !() { return !(*this); }
|
||||
operator bool() const;
|
||||
bool operator !() const { return !static_cast <bool>(*this); }
|
||||
|
||||
std::istream& stream() const { return input; }
|
||||
const char *current() const { return buffer + pos; }
|
||||
char peek();
|
||||
char get();
|
||||
std::string get(int n);
|
||||
void eat(int n = 1);
|
||||
|
||||
std::istream& input;
|
||||
int line, column;
|
||||
int pos, line, column, size;
|
||||
|
||||
private:
|
||||
char *buffer;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user