You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

11 years ago
#ifndef SOURCELOCATION_H_
#define SOURCELOCATION_H_
#include <clang-c/Index.h>
11 years ago
#include "Token.h"
#include "Cursor.h"
#include <string>
11 years ago
namespace clang {
class Token;
class SourceRange;
class Cursor;
11 years ago
class SourceLocation {
public:
SourceLocation(CXTranslationUnit &tu,
11 years ago
const std::string &filename,
int line_number,
int column);
SourceLocation(CXTranslationUnit &tu,
11 years ago
Token *token);
SourceLocation(SourceRange *range, bool start);
SourceLocation(CXTranslationUnit &tu,
11 years ago
const std::string &filepath,
int offset);
SourceLocation(CXSourceLocation location) {location_=location;}
11 years ago
explicit SourceLocation(Cursor *cursor);
void get_location_info(std::string* path,
unsigned *line,
unsigned *column,
unsigned *offset);
CXSourceLocation location_;
};
} // namespace clang
#endif // SOURCELOCATION_H_