blob: 671bf64f74fa610f3791108fe9157d61e5882012 [file] [log] [blame]
Shinichiro Hamaji776ca302015-06-06 03:52:48 +09001#ifndef FILE_H_
2#define FILE_H_
3
4#include <stdint.h>
5
6#include <string>
7#include <vector>
8
9#include "string_pool.h"
10
11using namespace std;
12
13class AST;
14
15class Makefile {
16 public:
17 explicit Makefile(const string& filename);
18 ~Makefile();
19
20 const char* buf() const { return buf_; }
21 size_t len() const { return len_; }
22 const string& filename() const { return filename_; }
23
24 StringPool* mutable_pool() { return &pool_; }
25 const vector<AST*>& asts() const { return asts_; }
26 vector<AST*>* mutable_asts() { return &asts_; }
27
Shinichiro Hamaji6e6de8d2015-06-18 11:12:58 +090028 bool Exists() const { return buf_; }
29
Shinichiro Hamaji776ca302015-06-06 03:52:48 +090030 private:
31 char* buf_;
32 size_t len_;
33 uint64_t mtime_;
34 string filename_;
35 StringPool pool_;
36 vector<AST*> asts_;
37};
38
39#endif // FILE_H_