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.
29 lines
1.1 KiB
29 lines
1.1 KiB
|
8 years ago
|
#include "completion_string.h"
|
||
|
|
#include "utility.h"
|
||
|
11 years ago
|
|
||
|
8 years ago
|
clangmm::CompletionChunk::CompletionChunk(std::string text, CompletionChunkKind kind)
|
||
|
|
: text(std::move(text)), kind(kind) {}
|
||
|
11 years ago
|
|
||
|
8 years ago
|
clangmm::CompletionString::CompletionString(const CXCompletionString &cx_completion_sting)
|
||
|
|
: cx_completion_sting(cx_completion_sting) {}
|
||
|
|
|
||
|
|
bool clangmm::CompletionString::available() const {
|
||
|
11 years ago
|
return clang_getCompletionAvailability(cx_completion_sting) == CXAvailability_Available;
|
||
|
11 years ago
|
}
|
||
|
|
|
||
|
8 years ago
|
unsigned clangmm::CompletionString::get_num_chunks() const {
|
||
|
|
return clang_getNumCompletionChunks(cx_completion_sting);
|
||
|
11 years ago
|
}
|
||
|
|
|
||
|
8 years ago
|
std::vector<clangmm::CompletionChunk> clangmm::CompletionString::get_chunks() const {
|
||
|
|
std::vector<CompletionChunk> chunks;
|
||
|
|
for(unsigned i = 0; i < get_num_chunks(); ++i)
|
||
|
|
chunks.emplace_back(to_string(clang_getCompletionChunkText(cx_completion_sting, i)),
|
||
|
|
static_cast<CompletionChunkKind>(clang_getCompletionChunkKind(cx_completion_sting, i)));
|
||
|
|
return chunks;
|
||
|
11 years ago
|
}
|
||
|
|
|
||
|
8 years ago
|
std::string clangmm::CompletionString::get_brief_comment() const {
|
||
|
10 years ago
|
return to_string(clang_getCompletionBriefComment(cx_completion_sting));
|
||
|
11 years ago
|
}
|