4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
16 #include "support/FileName.h"
32 /** copy file \p sourceFile to \p destFile. If \p force is false, the user
33 * will be asked before existing files are overwritten.
35 * - SUCCESS if this file got copied
36 * - FORCE if subsequent calls should not ask for confirmation before
37 * overwriting files anymore.
38 * - CANCEL if the export should be cancelled
40 CopyStatus copyFile(std::string const & format,
41 support::FileName const & sourceFile, support::FileName const & destFile,
42 std::string const & latexFile, bool force);
47 ExportedFile(support::FileName const &, std::string const &);
48 /// absolute name of the source file
49 support::FileName sourceName;
50 /// final name that the exported file should get (absolute name or
51 /// relative to the directory of the master document)
52 std::string exportName;
56 bool operator==(ExportedFile const &, ExportedFile const &);
61 /** add a referenced file for one format.
62 * No inset should ever write any file outside the tempdir.
63 * Instead, files that need to be exported have to be registered
65 * Then the exporter mechanism copies them to the right place, asks
66 * for confirmation before overwriting existing files etc.
67 * \param format format that references the given file
68 * \param sourceName source file name. Needs to be absolute
69 * \param exportName resulting file name. Can be either absolute
70 * or relative to the exported document.
72 void addExternalFile(std::string const & format,
73 support::FileName const & sourceName,
74 std::string const & exportName);
75 /** add a referenced file for one format.
76 * The final name is the source file name without path.
77 * \param format format that references the given file
78 * \param sourceName source file name. Needs to be absolute
80 void addExternalFile(std::string const & format,
81 support::FileName const & sourceName);
82 /// get referenced files for \p format
83 std::vector<ExportedFile> const
84 externalFiles(std::string const & format) const;
86 typedef std::map<std::string, std::vector<ExportedFile> > FileMap;
87 /** Files that are referenced by the export result in the
90 FileMap externalfiles_;