4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
25 /** \param abs_filename the file in question. Must have an absolute path.
26 * \param save_abs_path how is the file to be output to file?
28 FileName(std::string const & abs_filename, bool save_abs_path = true);
30 /** \param filename the file in question. May have either a relative
31 * or an absolute path.
32 * \param buffer_path if \c filename has a relative path, generate
33 * the absolute path using this.
35 void set(std::string const & filename, std::string const & buffer_path);
38 bool empty() const { return name_.empty(); }
40 bool saveAbsPath() const { return save_abs_path_; }
41 std::string const absFilename() const { return name_; }
42 /// \param buffer_path if empty, uses `pwd`
43 std::string const relFilename(std::string const & buffer_path = std::string()) const;
44 /// \param buf_path if empty, uses `pwd`
45 std::string const outputFilename(std::string const & buf_path = std::string()) const;
46 /** \return a mangled version of the absolute file name,
47 * suitable for use in the temp dir when, for example, converting
48 * an image file to another format.
49 * It is guaranteed that
50 * - two different filenames have different mangled names
51 * - two FileName instances with the same filename have identical
54 std::string const mangledFilename() const;
56 /// \return true if the file is compressed.
57 bool isZipped() const;
58 /// \return the absolute file name without its .gz, .z, .Z extension
59 std::string const unzippedFilename() const;
67 bool operator==(FileName const &, FileName const &);
68 bool operator!=(FileName const &, FileName const &);
71 } // namespace support