blob: 13cfb9d592a9e3bd54bf4d02e7f06da8dd049866 [file] [log] [blame]
Adam Lesinski282e1812014-01-23 18:17:42 -08001#ifndef SOURCEPOS_H
2#define SOURCEPOS_H
3
4#include <utils/String8.h>
5#include <stdio.h>
6
7using namespace android;
8
9class SourcePos
10{
11public:
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 Lesinskia01a9372014-03-20 18:04:57 -070020 void error(const char* fmt, ...) const;
21 void warning(const char* fmt, ...) const;
22 void printf(const char* fmt, ...) const;
Adam Lesinski282e1812014-01-23 18:17:42 -080023
Adam Lesinskide7de472014-11-03 12:03:08 -080024 bool operator<(const SourcePos& rhs) const;
25
Adam Lesinski282e1812014-01-23 18:17:42 -080026 static bool hasErrors();
27 static void printErrors(FILE* to);
28};
29
30
31#endif // SOURCEPOS_H