]> git.lyx.org Git - lyx.git/blob - src/support/filename.h
zlib stuff
[lyx.git] / src / support / filename.h
1 // -*- C++-*-
2 /**
3  * \file filename.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef FILENAME_H
13 #define FILENAME_H
14
15 #include "LString.h"
16
17
18 namespace lyx {
19 namespace support {
20
21
22 class FileName {
23 public:
24         FileName();
25
26         /** \param filename the file in question. May have either a relative
27             or an absolute path.
28             \param buffer_path if \c filename has a relative path, generate
29             the absolute path using this.
30          */
31         void set(string const & filename, string const & buffer_path);
32
33         void erase();
34         bool empty() const { return name_.empty(); }
35
36         bool saveAbsPath() const { return save_abs_path_; }
37         string const absFilename() const { return name_; }
38         string const relFilename(string const & buffer_path) const;
39         string const outputFilename(string const & buffer_path) const;
40
41 private:
42         string name_;
43         bool save_abs_path_;
44 };
45
46
47 bool operator==(FileName const &, FileName const &);
48 bool operator!=(FileName const &, FileName const &);
49
50
51 } // namespace support
52 } // namespace lyx
53
54 #endif