source: icGREP/icgrep-devel/icgrep/grep_engine.h @ 5464

Last change on this file since 5464 was 5464, checked in by nmedfort, 2 years ago

Restructuring work for the Driver classes. Start of work to eliminate the memory leaks with the ExecutionEngine?. Replaced custom AlignedMalloc? with backend call to std::aligned_malloc. Salvaged some work on DistributionPass? for reevaluation.

File size: 1.4 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6#ifndef DO_GREP_H
7#define DO_GREP_H
8#include <grep_type.h>  // for GrepType, GrepType::Normal
9#include <string>       // for string
10#include <vector>
11
12namespace re { class CC; }
13namespace re { class RE; }
14
15class GrepEngine {
16public:
17
18    GrepEngine();
19
20    void grepCodeGen(std::vector<re::RE *> REs, bool CountOnly, bool UTF_16, GrepSource grepSource, GrepType grepType = GrepType::Normal);
21
22    void grepCodeGen_nvptx(std::vector<re::RE *> REs, bool CountOnly, bool UTF_16);
23
24    void doGrep(const std::string & fileName) const;
25
26        uint64_t doGrep(const std::string & fileName, const uint32_t fileIdx) const;
27
28    uint64_t doGrep(const int32_t fileDescriptor, const uint32_t fileIdx) const;
29   
30    void doGrep(const char * buffer, const uint64_t length, const uint32_t fileIdx) const;
31
32    re::CC * grepCodepoints();
33
34    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
35   
36private:
37   
38    void * mGrepFunction;
39};
40
41
42re::CC * getParsedCodePointSet();
43void setParsedCodePointSet();
44
45void setParsedPropertyValues();
46
47void initFileResult(std::vector<std::string> filenames);
48void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
49
50#endif
Note: See TracBrowser for help on using the repository browser.