]> git.tdb.fi Git - builder.git/blob - source/filetarget.h
Replace per-file copyright notices with a single file
[builder.git] / source / filetarget.h
1 #ifndef FILETARGET_H_
2 #define FILETARGET_H_
3
4 #include <msp/fs/path.h>
5 #include "target.h"
6
7 /**
8 An intermediate base class for targets that represent files.  Almost all target
9 classes are derived from this.
10 */
11 class FileTarget: public Target
12 {
13 protected:
14         Msp::FS::Path path;
15         Msp::Time::TimeStamp mtime;
16         unsigned size;
17
18         FileTarget(Builder &, const Package *, const Msp::FS::Path &);
19 public:
20         const Msp::FS::Path &get_path() const { return path; }
21         const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
22         unsigned get_size() const { return size; }
23
24         /**
25         Changes the mtime of the target to the current time.
26         */
27         void touch();
28
29 protected:
30         virtual void check_rebuild();
31 };
32
33 #endif