4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
16 #include "outputparams.h"
36 Converter(std::string const & f, std::string const & t, std::string const & c,
37 std::string const & l);
53 /// The converter is latex or its derivatives
55 /// The converter is xml
57 /// Do we need to run the converter in the original directory?
59 /// This converter needs the .aux files
61 /// If the converter put the result in a directory, then result_dir
62 /// is the name of the directory
63 std::string result_dir;
64 /// If the converter put the result in a directory, then result_file
65 /// is the name of the main file in that directory
66 std::string result_file;
67 /// Command to convert the program output to a LaTeX log file format
76 typedef std::vector<int> EdgePath; // to be removed SOON
78 typedef std::vector<Converter> ConverterList;
80 typedef ConverterList::const_iterator const_iterator;
82 Converter const & get(int i) const {
83 return converterlist_[i];
86 Converter const * getConverter(std::string const & from,
87 std::string const & to) const;
89 int getNumber(std::string const & from, std::string const & to) const;
91 void add(std::string const & from, std::string const & to,
92 std::string const & command, std::string const & flags);
94 void erase(std::string const & from, std::string const & to);
98 std::vector<Format const *> const
99 getReachableTo(std::string const & target, bool clear_visited);
101 std::vector<Format const *> const
102 getReachable(std::string const & from, bool only_viewable,
104 /// Does a conversion path from format \p from to format \p to exist?
105 bool isReachable(std::string const & from, std::string const & to);
107 Graph::EdgePath const getPath(std::string const & from, std::string const & to);
109 OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
111 bool convert(Buffer const * buffer,
112 std::string const & from_file, std::string const & to_file_base,
113 std::string const & from_format, std::string const & to_format,
114 std::string & to_file, ErrorList & errorList,
115 bool try_default = false);
117 bool convert(Buffer const * buffer,
118 std::string const & from_file, std::string const & to_file_base,
119 std::string const & from_format, std::string const & to_format,
120 ErrorList & errorList, bool try_default = false);
122 void update(Formats const & formats);
124 void updateLast(Formats const & formats);
126 bool formatIsUsed(std::string const & format);
128 const_iterator begin() const {
129 return converterlist_.begin();
131 const_iterator end() const {
132 return converterlist_.end();
138 std::vector<Format const *> const
139 intToFormat(std::vector<int> const & input);
141 bool scanLog(Buffer const & buffer, std::string const & command,
142 std::string const & filename, ErrorList & errorList);
144 bool runLaTeX(Buffer const & buffer, std::string const & command,
145 OutputParams const &, ErrorList & errorList);
147 ConverterList converterlist_;
149 std::string latex_command_;
150 /// If \p from = /path/file.ext and \p to = /path2/file2.ext2 then
151 /// this method moves each /path/file*.ext file to /path2/file2*.ext2
152 bool move(std::string const & fmt,
153 std::string const & from, std::string const & to,
159 extern Converters converters;
161 extern Converters system_converters;