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.
31 lines
890 B
31 lines
890 B
#include "CompletionString.h" |
|
|
|
clang::CompletionString:: |
|
CompletionString(const CXCompletionString &str) { |
|
str_ = str; |
|
} |
|
|
|
int clang::CompletionString:: |
|
get_num_chunks() { |
|
if (clang_getCompletionAvailability(str_) == CXAvailability_Available) |
|
return clang_getNumCompletionChunks(str_); |
|
else |
|
return 0; |
|
} |
|
|
|
std::vector<clang::CompletionChunk> clang::CompletionString:: |
|
get_chunks() { |
|
std::vector<clang::CompletionChunk> res; |
|
if (clang_getCompletionAvailability(str_) == CXAvailability_Available) { |
|
for (auto i = 0; i < get_num_chunks(); i++) { |
|
res.emplace_back(clang_getCString(clang_getCompletionChunkText(str_, i)), |
|
static_cast<CompletionChunkKind> |
|
(clang_getCompletionChunkKind(str_, i))); |
|
} |
|
} |
|
return res; |
|
} |
|
|
|
clang::CompletionChunk:: |
|
CompletionChunk(std::string chunk, clang::CompletionChunkKind kind) : |
|
chunk_(chunk), kind_(kind) { }
|
|
|