Build a pipeline from filters specified as command-line arguments. */
| 168 | Build a pipeline from filters specified as command-line arguments. |
| 169 | */ |
| 170 | void TranslateKernel::makeArgPipeline() |
| 171 | { |
| 172 | std::string readerType(m_readerType); |
| 173 | if (!readerType.empty() && !Utils::startsWith(readerType, "readers.")) |
| 174 | readerType.insert(0, "readers."); |
| 175 | Stage& reader = m_manager.makeReader(m_inputFile, readerType); |
| 176 | Stage* stage = &reader; |
| 177 | |
| 178 | // add each filter provided on the command-line, |
| 179 | // updating the stage pointer |
| 180 | for (auto const& f : m_filterType) |
| 181 | { |
| 182 | std::string filter_name(f); |
| 183 | |
| 184 | if (!Utils::startsWith(f, "filters.")) |
| 185 | filter_name.insert(0, "filters."); |
| 186 | |
| 187 | Stage& filter = m_manager.makeFilter(filter_name, *stage); |
| 188 | stage = &filter; |
| 189 | } |
| 190 | std::string writerType(m_writerType); |
| 191 | if (!writerType.empty() && !Utils::startsWith(writerType, "writers.")) |
| 192 | writerType.insert(0, "writers."); |
| 193 | m_manager.makeWriter(m_outputFile, writerType, *stage); |
| 194 | } |
| 195 | |
| 196 | |
| 197 | int TranslateKernel::execute() |
nothing calls this directly
no test coverage detected