Ignore:
Timestamp:
Oct 18, 2017, 3:12:32 PM (2 years ago)
Author:
cameron
Message:

Fix missing filename as line output prefix

File:
1 edited

Legend:

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

    r5695 r5696  
    2727void *DoGrepThreadFunction(void *args);
    2828   
     29
     30class NonNormalizingReportMatch : public MatchAccumulator {
     31public:
     32    NonNormalizingReportMatch(std::string linePrefix) : mLinePrefix(linePrefix), mLineCount(0), mPrevious_line_end(nullptr) {}
     33    void accumulate_match(const size_t lineNum, char * line_start, char * line_end) override;
     34    void finalize_match(char * buffer_end) override;
     35    std::string mLinePrefix;
     36    size_t mLineCount;
     37    char * mPrevious_line_end;
     38    std::stringstream mResultStr;
    2939   
    30    
    31     class NonNormalizingReportMatch : public MatchAccumulator {
    32     public:
    33         NonNormalizingReportMatch(std::string linePrefix) : mLineCount(0), mPrevious_line_end(nullptr) {}
    34         void accumulate_match(const size_t lineNum, char * line_start, char * line_end) override;
    35         void finalize_match(char * buffer_end) override;
    36         std::string mLinePrefix;
    37         size_t mLineCount;
    38         char * mPrevious_line_end;
    39         std::stringstream mResultStr;
    40        
    41     };
    42    
    43    
    44    
     40};
     41
     42
    4543class GrepEngine {
    4644public:
     
    6664    bool grepMatchFound;
    6765
    68     std::vector<NonNormalizingReportMatch *> resultAccums;
     66    std::vector<std::unique_ptr<NonNormalizingReportMatch>> resultAccums;
    6967    std::vector<std::string> inputFiles;
    7068   
Note: See TracChangeset for help on using the changeset viewer.