summaryrefslogtreecommitdiffstats
path: root/tools/localize/SourcePos.h
blob: 5027129f8149530d11b7c0514b90901fcd54897b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SOURCEPOS_H
#define SOURCEPOS_H

#include <string>

using namespace std;

class SourcePos
{
public:
    string file;
    int line;

    SourcePos(const string& f, int l);
    SourcePos(const SourcePos& that);
    SourcePos();
    ~SourcePos();

    string ToString() const;
    int Error(const char* fmt, ...) const;

    static bool HasErrors();
    static void PrintErrors(FILE* to);
};

extern const SourcePos GENERATED_POS;

#endif // SOURCEPOS_H