void ReSplit::handle(Input& input, Output& output) { RecordPtr rec = input.pop(); for (; !rec->eof(); output.push(rec), rec = input.pop()) { std::vector<std::size_t>::iterator iter = _columns.begin(); for (; iter != _columns.end(); ++iter) { const std::string& col = static_cast<const std::string&> ((*rec)[*iter]); boost::smatch parts; if (_option == Search) { boost::regex_search(col, parts, _regex); } else { boost::regex_match(col, parts, _regex); } boost::smatch::iterator iter = parts.begin(); for (; iter != parts.end(); ++iter) { if (!iter->matched) { continue; } rec->insert(rec->end(), std::string( iter->first, iter->second)); } } } }
RecordPtr RecordHelper::pythonListToRecord(python::object obj) { ssize_t listSize = python::len(obj); ssize_t i = 0; RecordPtr ptr = new Record(); ptr->reserve(listSize); for (; i < listSize; ++i) { ptr->insert(ptr->end(), *pythonObjectToAny(obj[i])); } return ptr; }