JSONLineReader::JSONLineReader (SeekIStream* input, const Lookup& lookup, const Config& config) : LineReader (input, 1024 * 10), lookup (lookup), row (lookup.count ()) { string member (config.get ("member", "")); string root (config.get ("root", "row")); for (auto i = root.begin (); i != root.end (); ++i) this->lookup.next (*i); this->member = member.length () > 0 ? member[0] : '.'; }
RegexLineReader::RegexLineReader (SeekIStream* input, Lookup const& lookup, Config const&) : LineReader (input), regex ("FIXME"), row (lookup.count ()) { Int32u group; for (auto& key: lookup) { if (key.length () > 0 && key[0] == '_' && Convert::toInt32u (&index, key.data () + 1, key.length () - 1)) this->lookup[group] = i->second; buffer.clear (); } }