Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 1 | #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 | |
| 11 | using namespace std; |
| 12 | |
| 13 | class AST; |
| 14 | |
| 15 | class 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_ |