2014-03-10 13:25:31 -07:00
|
|
|
#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);
|
2014-09-26 16:12:52 -07:00
|
|
|
~SpyReader();
|
2014-03-10 13:25:31 -07:00
|
|
|
|
2014-09-03 07:09:15 -07:00
|
|
|
void clear();
|
2014-09-30 14:57:57 -07:00
|
|
|
TSInput input();
|
2014-10-02 11:43:22 -07:00
|
|
|
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);
|
2014-09-03 07:09:15 -07:00
|
|
|
|
2014-09-26 16:12:52 -07:00
|
|
|
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;
|
2014-03-10 13:25:31 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // HELPERS_SPY_READER_H_
|