tree-sitter/spec/runtime/helpers/spy_reader.h

28 lines
577 B
C
Raw Normal View History

#ifndef HELPERS_SPY_READER_H_
#define HELPERS_SPY_READER_H_
#include <string>
#include <vector>
#include "tree_sitter/runtime.h"
class SpyReader {
2014-08-06 13:00:35 -07:00
public:
SpyReader(std::string content, size_t chunk_size);
~SpyReader();
void clear();
TSInput input();
bool insert(size_t position, std::string text);
bool erase(size_t position, size_t len);
2014-10-03 14:19:04 -07:00
const char * read(size_t *len);
int seek(size_t position);
char *buffer;
2014-08-06 13:00:35 -07:00
std::string content;
size_t position;
size_t chunk_size;
std::vector<std::string> strings_read;
};
#endif // HELPERS_SPY_READER_H_