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"
32 Converter(std::string const & f, std::string const & t, std::string const & c,
33 std::string const & l);
49 /// The converter is latex or its derivatives
51 /// Do we need to run the converter in the original directory?
53 /// This converter needs the .aux files
55 /// If the converter put the result in a directory, then result_dir
56 /// is the name of the directory
57 std::string result_dir;
58 /// If the converter put the result in a directory, then result_file
59 /// is the name of the main file in that directory
60 std::string result_file;
61 /// Command to convert the program output to a LaTeX log file format
70 typedef std::vector<int> EdgePath; // to be removed SOON
72 typedef std::vector<Converter> ConverterList;
74 typedef ConverterList::const_iterator const_iterator;
76 Converter const & get(int i) const {
77 return converterlist_[i];
80 Converter const * getConverter(std::string const & from,
81 std::string const & to) const;
83 int getNumber(std::string const & from, std::string const & to) const;
85 void add(std::string const & from, std::string const & to,
86 std::string const & command, std::string const & flags);
88 void erase(std::string const & from, std::string const & to);
92 std::vector<Format const *> const
93 getReachableTo(std::string const & target, bool clear_visited);
95 std::vector<Format const *> const
96 getReachable(std::string const & from, bool only_viewable,
99 bool isReachable(std::string const & from, std::string const & to);
101 Graph::EdgePath const getPath(std::string const & from, std::string const & to);
103 OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
105 bool convert(Buffer const * buffer,
106 std::string const & from_file, std::string const & to_file_base,
107 std::string const & from_format, std::string const & to_format,
108 std::string & to_file);
110 bool convert(Buffer const * buffer,
111 std::string const & from_file, std::string const & to_file_base,
112 std::string const & from_format, std::string const & to_format);
114 void update(Formats const & formats);
116 void updateLast(Formats const & formats);
118 bool formatIsUsed(std::string const & format);
120 const_iterator begin() const {
121 return converterlist_.begin();
123 const_iterator end() const {
124 return converterlist_.end();
130 std::vector<Format const *> const
131 intToFormat(std::vector<int> const & input);
133 bool scanLog(Buffer const & buffer, std::string const & command,
134 std::string const & filename);
136 bool runLaTeX(Buffer const & buffer, std::string const & command,
137 OutputParams const &);
139 ConverterList converterlist_;
141 std::string latex_command_;
143 bool move(std::string const & from, std::string const & to, bool copy);
148 extern Converters converters;
150 extern Converters system_converters;