equal
deleted
inserted
replaced
42 using namespace std; |
42 using namespace std; |
43 using namespace relpipe; |
43 using namespace relpipe; |
44 using namespace relpipe::reader; |
44 using namespace relpipe::reader; |
45 using namespace relpipe::reader::handlers; |
45 using namespace relpipe::reader::handlers; |
46 |
46 |
47 class GrepHandler : public RelationalReaderStringHadler { |
47 class CutHandler : public RelationalReaderStringHadler { |
48 private: |
48 private: |
49 shared_ptr<writer::RelationalWriter> relationalWriter; |
49 shared_ptr<writer::RelationalWriter> relationalWriter; |
50 |
50 |
51 wregex relationNameRegEx; |
51 wregex relationNameRegEx; |
52 vector<wregex> attributeNameRegExes; |
52 vector<wregex> attributeNameRegExes; |
56 integer_t currentAttributeIndex = 0; |
56 integer_t currentAttributeIndex = 0; |
57 boolean_t filterCurrentRelation = false; |
57 boolean_t filterCurrentRelation = false; |
58 |
58 |
59 public: |
59 public: |
60 |
60 |
61 GrepHandler(ostream& output, const vector<string_t>& arguments) { |
61 CutHandler(ostream& output, const vector<string_t>& arguments) { |
62 relationalWriter.reset(writer::Factory::create(output)); |
62 relationalWriter.reset(writer::Factory::create(output)); |
63 |
63 |
64 if (arguments.size() >= 2) { |
64 if (arguments.size() >= 2) { |
65 relationNameRegEx = wregex(arguments[0]); |
65 relationNameRegEx = wregex(arguments[0]); |
66 for (int i = 1; i < arguments.size(); i++) attributeNameRegExes.push_back(wregex(arguments[i])); |
66 for (int i = 1; i < arguments.size(); i++) attributeNameRegExes.push_back(wregex(arguments[i])); |