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 /// The converter is xml
53 /// Do we need to run the converter in the original directory?
55 /// This converter needs the .aux files
57 /// If the converter put the result in a directory, then result_dir
58 /// is the name of the directory
59 std::string result_dir;
60 /// If the converter put the result in a directory, then result_file
61 /// is the name of the main file in that directory
62 std::string result_file;
63 /// Command to convert the program output to a LaTeX log file format
72 typedef std::vector<int> EdgePath; // to be removed SOON
74 typedef std::vector<Converter> ConverterList;
76 typedef ConverterList::const_iterator const_iterator;
78 Converter const & get(int i) const {
79 return converterlist_[i];
82 Converter const * getConverter(std::string const & from,
83 std::string const & to) const;
85 int getNumber(std::string const & from, std::string const & to) const;
87 void add(std::string const & from, std::string const & to,
88 std::string const & command, std::string const & flags);
90 void erase(std::string const & from, std::string const & to);
94 std::vector<Format const *> const
95 getReachableTo(std::string const & target, bool clear_visited);
97 std::vector<Format const *> const
98 getReachable(std::string const & from, bool only_viewable,
100 /// Does a conversion path from format \p from to format \p to exist?
101 bool isReachable(std::string const & from, std::string const & to);
103 Graph::EdgePath const getPath(std::string const & from, std::string const & to);
105 OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
107 bool convert(Buffer const * buffer,
108 std::string const & from_file, std::string const & to_file_base,
109 std::string const & from_format, std::string const & to_format,
110 std::string & to_file, bool try_default = false);
112 bool convert(Buffer const * buffer,
113 std::string const & from_file, std::string const & to_file_base,
114 std::string const & from_format, std::string const & to_format,
115 bool try_default = false);
117 void update(Formats const & formats);
119 void updateLast(Formats const & formats);
121 bool formatIsUsed(std::string const & format);
123 const_iterator begin() const {
124 return converterlist_.begin();
126 const_iterator end() const {
127 return converterlist_.end();
133 std::vector<Format const *> const
134 intToFormat(std::vector<int> const & input);
136 bool scanLog(Buffer const & buffer, std::string const & command,
137 std::string const & filename);
139 bool runLaTeX(Buffer const & buffer, std::string const & command,
140 OutputParams const &);
142 ConverterList converterlist_;
144 std::string latex_command_;
145 /// If \p from = /path/file.ext and \p to = /path2/file2.ext2 then
146 /// this method moves each /path/file*.ext file to /path2/file2*.ext2
147 bool move(std::string const & fmt,
148 std::string const & from, std::string const & to,
154 extern Converters converters;
156 extern Converters system_converters;