blob: a0530736289703f725e517c5331c219e4505a3f2 [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
28 private:
29 char* buf_;
30 size_t len_;
31 uint64_t mtime_;
32 string filename_;
33 StringPool pool_;
34 vector<AST*> asts_;
35};
36
37#endif // FILE_H_