Knyffen
b9645f15ff
The text and pattern are now streamed directly (skipping saving them to strings). Knowing exactly what string was matched has now been delegated to the Rabin_fingerprint_process.
27 lines
581 B
C++
27 lines
581 B
C++
#ifndef PROCESSES_H
|
|
#define PROCESSES_H
|
|
|
|
#include "Rabin_fingerprint.hpp"
|
|
#include "general_library.hpp"
|
|
|
|
#include <stdint.h>
|
|
#include <queue>
|
|
#include <string>
|
|
#include <sstream>
|
|
|
|
class Rabin_fingerprint_process {
|
|
public:
|
|
Rabin_fingerprint_process(uint32_t irr_poly, size_t window_size_in_bits);
|
|
void stream_char(char c);
|
|
void stream_bit(bool b);
|
|
uint32_t get_fingerprint();
|
|
std::string get_string_in_window();
|
|
|
|
private:
|
|
std::queue<bool> window;
|
|
size_t window_size_in_bits;
|
|
Rabin_fingerprint phi;
|
|
};
|
|
|
|
#endif
|