- Formats::Add(from);
- Formats::Add(to);
- Command Com(Formats::GetFormat(from), Formats::GetFormat(to), command);
- vector<Command>::iterator it = find_if(commands.begin(),
- commands.end(),
- compare_Command(Com));
-
- if (command.empty() || command == "none") {
- if (it != commands.end())
- commands.erase(it);
- return;
- }
-
-
- // Read the flags
- string flag_list(flags);
- while (!flag_list.empty()) {
- string flag_name, flag_value;
- flag_list = split(flag_list, flag_value, ',');
- flag_value = split(flag_value, flag_name, '=');
- if (flag_name == "*") {
- if (it != commands.end()) {
- Com = *it;
- Com.command = command;
- }
- }
- else if (flag_name == "latex")
- Com.latex = true;
- else if (flag_name == "originaldir")
- Com.original_dir = true;
- else if (flag_name == "needaux")
- Com.need_aux = true;
- else if (flag_name == "resultdir")
- Com.result_dir = (flag_value.empty())
- ? "$$BaseName" : flag_value;
- else if (flag_name == "resultfile")
- Com.result_file = flag_value;
- else if (flag_name == "parselog")
- Com.parselog = flag_value;
- else if (flag_name == "disable") {
- while (!flag_value.empty()) {
- string tmp;
- flag_value = split(flag_value, tmp, '&');
- Com.disable.push_back(tmp);
- }
- }
+ formats.add(from);
+ formats.add(to);
+ ConverterList::iterator it = find_if(converterlist_.begin(),
+ converterlist_.end(),
+ compare_Converter(from, to));
+
+ Converter converter(from, to, command, flags);
+ if (it != converterlist_.end() && !flags.empty() && flags[0] == '*') {
+ converter = *it;
+ converter.command = command;
+ converter.flags = flags;