source: icGREP/icgrep-devel/icgrep/do_grep.h @ 4941

Last change on this file since 4941 was 4939, checked in by lindanl, 4 years ago

new version using the kernels.

File size: 806 bytes
Line 
1#ifndef DO_GREP_H
2#define DO_GREP_H
3/*
4 *  Copyright (c) 2015 International Characters.
5 *  This software is licensed to the public under the Open Software License 3.0.
6 *  icgrep is a trademark of International Characters.
7 */
8
9#include <string>
10#include <stdint.h>
11#include <re/re_cc.h>
12
13
14typedef void (*main_fcn_T)(char * byte_data, int filesize, const char* filename, uint64_t finalLineUnterminated);
15
16namespace llvm { class raw_ostream; }
17
18class GrepExecutor {
19public:
20
21    GrepExecutor(void * main_fnptr)
22    : mMainFcn(reinterpret_cast<main_fcn_T>(main_fnptr)) {
23       
24    }
25 
26    void doGrep(const std::string & fileName);
27private:
28   
29    bool finalLineIsUnterminated() const;
30
31    main_fcn_T mMainFcn;
32   
33    std::string mFileName;
34    size_t mFileSize;
35    char * mFileBuffer;
36};
37
38
39#endif
Note: See TracBrowser for help on using the repository browser.