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

Last change on this file since 5477 was 5476, checked in by cameron, 2 years ago

Command line interface - systematic support for legacy flags

File size: 1.6 KB
Line 
1/*
2 *  Copyright (c) 2017 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 GREP_ENGINE_H
7#define GREP_ENGINE_H
8#include <grep_interface.h>
9#include <grep_type.h>  // for GrepType, GrepType::Normal
10#include <string>       // for string
11#include <vector>
12#include <re/re_parser.h> 
13
14namespace re { class CC; }
15namespace re { class RE; }
16namespace llvm { namespace cl { class OptionCategory; } }
17class Driver;
18
19
20namespace grep {
21
22class GrepEngine {
23public:
24
25    GrepEngine();
26
27
28    ~GrepEngine();
29
30    void grepCodeGen(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16, GrepSource grepSource, GrepType grepType = GrepType::Normal);
31
32    void grepCodeGen_nvptx(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16);
33
34    void doGrep(const std::string & fileName) const;
35
36        uint64_t doGrep(const std::string & fileName, const uint32_t fileIdx) const;
37
38    uint64_t doGrep(const int32_t fileDescriptor, const uint32_t fileIdx) const;
39   
40    void doGrep(const char * buffer, const uint64_t length, const uint32_t fileIdx) const;
41
42    re::CC * grepCodepoints();
43
44    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
45   
46private:
47   
48    Driver * mGrepDriver;
49};
50
51
52re::CC * getParsedCodePointSet();
53void setParsedCodePointSet();
54
55void setParsedPropertyValues();
56
57void initFileResult(std::vector<std::string> filenames);
58void PrintResult(GrepModeType grepMode, std::vector<size_t> & total_CountOnly);
59}
60
61#endif
Note: See TracBrowser for help on using the repository browser.