mirror of https://gitlab.com/cppit/libclangmm
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.
56 lines
2.0 KiB
56 lines
2.0 KiB
|
11 years ago
|
#ifndef TRANSLATIONUNIT_H_
|
||
|
|
#define TRANSLATIONUNIT_H_
|
||
|
|
#include <clang-c/Index.h>
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
#include <map>
|
||
|
|
#include <memory>
|
||
|
8 years ago
|
#include "index.h"
|
||
|
|
#include "diagnostic.h"
|
||
|
|
#include "tokens.h"
|
||
|
|
#include "code_complete_results.h"
|
||
|
|
#include "cursor.h"
|
||
|
11 years ago
|
|
||
|
9 years ago
|
namespace clangmm {
|
||
|
11 years ago
|
class TranslationUnit {
|
||
|
|
public:
|
||
|
9 years ago
|
TranslationUnit(Index &index, const std::string &file_path,
|
||
|
10 years ago
|
const std::vector<std::string> &command_line_args,
|
||
|
|
const std::string &buffer,
|
||
|
8 years ago
|
int flags=DefaultFlags());
|
||
|
9 years ago
|
TranslationUnit(Index &index, const std::string &file_path,
|
||
|
11 years ago
|
const std::vector<std::string> &command_line_args,
|
||
|
8 years ago
|
int flags=DefaultFlags());
|
||
|
11 years ago
|
~TranslationUnit();
|
||
|
10 years ago
|
|
||
|
8 years ago
|
int reparse(const std::string &buffer, int flags=DefaultFlags());
|
||
|
10 years ago
|
|
||
|
8 years ago
|
static int DefaultFlags();
|
||
|
11 years ago
|
|
||
|
11 years ago
|
void parse(Index &index,
|
||
|
10 years ago
|
const std::string &file_path,
|
||
|
11 years ago
|
const std::vector<std::string> &command_line_args,
|
||
|
|
const std::map<std::string, std::string> &buffers,
|
||
|
8 years ago
|
int flags=DefaultFlags());
|
||
|
10 years ago
|
|
||
|
9 years ago
|
CodeCompleteResults get_code_completions(const std::string &buffer,
|
||
|
|
unsigned line_number, unsigned column);
|
||
|
10 years ago
|
|
||
|
9 years ago
|
std::vector<Diagnostic> get_diagnostics();
|
||
|
10 years ago
|
|
||
|
8 years ago
|
std::unique_ptr<Tokens> get_tokens();
|
||
|
|
std::unique_ptr<Tokens> get_tokens(const std::string &path, unsigned start_offset, unsigned end_offset);
|
||
|
10 years ago
|
std::unique_ptr<Tokens> get_tokens(unsigned start_offset, unsigned end_offset);
|
||
|
10 years ago
|
std::unique_ptr<Tokens> get_tokens(unsigned start_line, unsigned start_column,
|
||
|
|
unsigned end_line, unsigned end_column);
|
||
|
|
|
||
|
9 years ago
|
Cursor get_cursor(const std::string &path, unsigned offset);
|
||
|
|
Cursor get_cursor(const std::string &path, unsigned line, unsigned column);
|
||
|
|
Cursor get_cursor(const SourceLocation &location);
|
||
|
11 years ago
|
|
||
|
10 years ago
|
CXTranslationUnit cx_tu;
|
||
|
11 years ago
|
};
|
||
|
9 years ago
|
} // namespace clangmm
|
||
|
11 years ago
|
#endif // TRANSLATIONUNIT_H_
|
||
|
|
|