]> git.tdb.fi Git - builder.git/blob - source/lib/installedfile.h
Add visibility decorations to the library and plugins
[builder.git] / source / lib / installedfile.h
1 #ifndef INSTALLEDFILE_H_
2 #define INSTALLEDFILE_H_
3
4 #include "filetarget.h"
5 #include "libbuilder_api.h"
6 #include "sourcepackage.h"
7
8 /**
9 Represents the installation of a file.
10 */
11 class LIBBUILDER_API InstalledFile: public FileTarget
12 {
13 private:
14         FileTarget &source;
15         Msp::FS::Path link;
16
17 public:
18         InstalledFile(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string());
19 private:
20         static Msp::FS::Path generate_target_path(const Msp::FS::Path &, const FileTarget &i, const std::string &);
21
22 public:
23         const char *get_type() const override { return "InstalledFile"; }
24         FileTarget &get_source() const { return source; }
25
26         /** Sets a symlink for the file.  A relative path will be rooted at the
27         directory the file resides in. */
28         void set_symlink(const Msp::FS::Path &);
29
30         const Msp::FS::Path &get_symlink() const { return link; }
31
32         Target *get_real_target() override;
33 private:
34         void check_rebuild() override;
35
36 public:
37         void clean() override;
38 };
39
40 #endif