| 148 | } |
| 149 | |
| 150 | ExitCodes main_(int, const char**) override |
| 151 | { |
| 152 | |
| 153 | //------------------------------------------------------------- |
| 154 | // parameter handling |
| 155 | //------------------------------------------------------------- |
| 156 | // file list |
| 157 | StringList file_list = getStringList_("in"); |
| 158 | |
| 159 | // file type |
| 160 | FileHandler file_handler; |
| 161 | FileTypes::Type force_type; |
| 162 | if (!getStringOption_("in_type").empty()) |
| 163 | { |
| 164 | force_type = FileTypes::nameToType(getStringOption_("in_type")); |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | force_type = file_handler.getType(file_list[0]); |
| 169 | } |
| 170 | |
| 171 | // output file names and types |
| 172 | String out_file = getStringOption_("out"); |
| 173 | |
| 174 | // append method |
| 175 | bool append_rows = false; |
| 176 | bool append_cols = false; |
| 177 | String append_method = getStringOption_("append_method"); |
| 178 | append_method == "append_rows" ? append_rows = true : append_cols = true; |
| 179 | |
| 180 | bool annotate_file_origin = getFlag_("annotate_file_origin"); |
| 181 | rt_gap_ = getDoubleOption_("rt_concat:gap"); |
| 182 | vector<String> trafo_out = getStringList_("rt_concat:trafo_out"); |
| 183 | if (trafo_out.empty()) |
| 184 | { |
| 185 | // resize now so we don't have to worry about indexing out of bounds: |
| 186 | trafo_out.resize(file_list.size()); |
| 187 | } |
| 188 | else if (trafo_out.size() != file_list.size()) |
| 189 | { |
| 190 | writeLogError_("Error: Number of transformation output files must equal the number of input files (parameters 'rt_concat:trafo_out'/'in')!"); |
| 191 | return ILLEGAL_PARAMETERS; |
| 192 | } |
| 193 | |
| 194 | //------------------------------------------------------------- |
| 195 | // calculations |
| 196 | //------------------------------------------------------------- |
| 197 | |
| 198 | if (force_type == FileTypes::FEATUREXML) |
| 199 | { |
| 200 | FeatureMap out; |
| 201 | FeatureXMLFile fh; |
| 202 | for (Size i = 0; i < file_list.size(); ++i) |
| 203 | { |
| 204 | FeatureMap map; |
| 205 | fh.load(file_list[i], map); |
| 206 | |
| 207 | if (annotate_file_origin) |
nothing calls this directly
no test coverage detected