Ignore:
Timestamp:
Mar 8, 2018, 1:56:35 PM (16 months ago)
Author:
cameron
Message:

Line break controls for Unicode/LF/Null - initial check in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.h

    r5892 r5894  
    2121
    2222namespace grep {
    23     class MatchAccumulator {
    24     public:
    25         MatchAccumulator() {}
    26         virtual void accumulate_match(const size_t lineNum, char * line_start, char * line_end) = 0;
    27         virtual void finalize_match(char * buffer_end) {}  // default: no op
    28     };
    2923   
    30     void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end);
    31    
    32     void finalize_match_wrapper(intptr_t accum_addr, char * buffer_end);
    33    
    34     void grepBuffer(re::RE * pattern, const char * buffer, size_t bufferLength, MatchAccumulator * accum);
     24enum class GrepRecordBreakKind {Null, LF, Unicode};
     25
     26class MatchAccumulator {
     27public:
     28    MatchAccumulator() {}
     29    virtual void accumulate_match(const size_t lineNum, char * line_start, char * line_end) = 0;
     30    virtual void finalize_match(char * buffer_end) {}  // default: no op
     31};
     32
     33void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end);
     34
     35void finalize_match_wrapper(intptr_t accum_addr, char * buffer_end);
     36
     37void grepBuffer(re::RE * pattern, const char * buffer, size_t bufferLength, MatchAccumulator * accum);
    3538
    3639class GrepEngine {
     
    4144    virtual ~GrepEngine();
    4245   
     46    void setRecordBreak(GrepRecordBreakKind b);
    4347    void initFileResult(std::vector<std::string> & filenames);
    4448    virtual void grepCodeGen(std::vector<re::RE *> REs);
     
    6165    std::vector<FileStatus> mFileStatus;
    6266    bool grepMatchFound;
     67    GrepRecordBreakKind mGrepRecordBreak;
    6368
    6469    std::unique_ptr<cc::MultiplexedAlphabet> mpx;
Note: See TracChangeset for help on using the changeset viewer.