Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 1 | #ifndef SOURCEPOS_H |
| 2 | #define SOURCEPOS_H |
| 3 | |
| 4 | #include <utils/String8.h> |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | using namespace android; |
| 8 | |
| 9 | class SourcePos |
| 10 | { |
| 11 | public: |
| 12 | String8 file; |
| 13 | int line; |
| 14 | |
| 15 | SourcePos(const String8& f, int l); |
| 16 | SourcePos(const SourcePos& that); |
| 17 | SourcePos(); |
| 18 | ~SourcePos(); |
| 19 | |
Adam Lesinski | a01a937 | 2014-03-20 18:04:57 -0700 | [diff] [blame] | 20 | void error(const char* fmt, ...) const; |
| 21 | void warning(const char* fmt, ...) const; |
| 22 | void printf(const char* fmt, ...) const; |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 23 | |
Adam Lesinski | de7de47 | 2014-11-03 12:03:08 -0800 | [diff] [blame] | 24 | bool operator<(const SourcePos& rhs) const; |
| 25 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 26 | static bool hasErrors(); |
| 27 | static void printErrors(FILE* to); |
| 28 | }; |
| 29 | |
| 30 | |
| 31 | #endif // SOURCEPOS_H |