本文整理汇总了C++中CodeCompletionString类的典型用法代码示例。如果您正苦于以下问题:C++ CodeCompletionString类的具体用法?C++ CodeCompletionString怎么用?C++ CodeCompletionString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CodeCompletionString类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clang_getCompletionBriefComment
CXString
clang_getCompletionBriefComment(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr)
return createCXString((const char *) NULL);
return createCXString(CCStr->getBriefComment(), /*DupString=*/false);
}
示例2: clang_getCompletionBriefComment
CXString
clang_getCompletionBriefComment(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr)
return cxstring::createNull();
return cxstring::createRef(CCStr->getBriefComment());
}
示例3: clang_getCompletionChunkKind
enum CXCompletionChunkKind
clang_getCompletionChunkKind(CXCompletionString completion_string,
unsigned chunk_number) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr || chunk_number >= CCStr->size())
return CXCompletionChunk_Text;
switch ((*CCStr)[chunk_number].Kind) {
case CodeCompletionString::CK_TypedText:
return CXCompletionChunk_TypedText;
case CodeCompletionString::CK_Text:
return CXCompletionChunk_Text;
case CodeCompletionString::CK_Optional:
return CXCompletionChunk_Optional;
case CodeCompletionString::CK_Placeholder:
return CXCompletionChunk_Placeholder;
case CodeCompletionString::CK_Informative:
return CXCompletionChunk_Informative;
case CodeCompletionString::CK_ResultType:
return CXCompletionChunk_ResultType;
case CodeCompletionString::CK_CurrentParameter:
return CXCompletionChunk_CurrentParameter;
case CodeCompletionString::CK_LeftParen:
return CXCompletionChunk_LeftParen;
case CodeCompletionString::CK_RightParen:
return CXCompletionChunk_RightParen;
case CodeCompletionString::CK_LeftBracket:
return CXCompletionChunk_LeftBracket;
case CodeCompletionString::CK_RightBracket:
return CXCompletionChunk_RightBracket;
case CodeCompletionString::CK_LeftBrace:
return CXCompletionChunk_LeftBrace;
case CodeCompletionString::CK_RightBrace:
return CXCompletionChunk_RightBrace;
case CodeCompletionString::CK_LeftAngle:
return CXCompletionChunk_LeftAngle;
case CodeCompletionString::CK_RightAngle:
return CXCompletionChunk_RightAngle;
case CodeCompletionString::CK_Comma:
return CXCompletionChunk_Comma;
case CodeCompletionString::CK_Colon:
return CXCompletionChunk_Colon;
case CodeCompletionString::CK_SemiColon:
return CXCompletionChunk_SemiColon;
case CodeCompletionString::CK_Equal:
return CXCompletionChunk_Equal;
case CodeCompletionString::CK_HorizontalSpace:
return CXCompletionChunk_HorizontalSpace;
case CodeCompletionString::CK_VerticalSpace:
return CXCompletionChunk_VerticalSpace;
}
llvm_unreachable("Invalid CompletionKind!");
}
示例4: clang_getCompletionParent
CXString
clang_getCompletionParent(CXCompletionString completion_string,
CXCursorKind *kind) {
if (kind)
*kind = CXCursor_NotImplemented;
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr)
return cxstring::createNull();
return cxstring::createRef(CCStr->getParentContextName());
}
示例5: clang_getCompletionParent
CXString
clang_getCompletionParent(CXCompletionString completion_string,
CXCursorKind *kind) {
if (kind)
*kind = CXCursor_NotImplemented;
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr)
return createCXString((const char *)0);
return createCXString(CCStr->getParentContextName(), /*DupString=*/false);
}
示例6: clang_getCompletionChunkCompletionString
CXCompletionString
clang_getCompletionChunkCompletionString(CXCompletionString completion_string,
unsigned chunk_number) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
if (!CCStr || chunk_number >= CCStr->size())
return nullptr;
switch ((*CCStr)[chunk_number].Kind) {
case CodeCompletionString::CK_TypedText:
case CodeCompletionString::CK_Text:
case CodeCompletionString::CK_Placeholder:
case CodeCompletionString::CK_CurrentParameter:
case CodeCompletionString::CK_Informative:
case CodeCompletionString::CK_LeftParen:
case CodeCompletionString::CK_RightParen:
case CodeCompletionString::CK_LeftBracket:
case CodeCompletionString::CK_RightBracket:
case CodeCompletionString::CK_LeftBrace:
case CodeCompletionString::CK_RightBrace:
case CodeCompletionString::CK_LeftAngle:
case CodeCompletionString::CK_RightAngle:
case CodeCompletionString::CK_Comma:
case CodeCompletionString::CK_ResultType:
case CodeCompletionString::CK_Colon:
case CodeCompletionString::CK_SemiColon:
case CodeCompletionString::CK_Equal:
case CodeCompletionString::CK_HorizontalSpace:
case CodeCompletionString::CK_VerticalSpace:
return nullptr;
case CodeCompletionString::CK_Optional:
// Note: treated as an empty text block.
return (*CCStr)[chunk_number].Optional;
}
llvm_unreachable("Invalid CompletionKind!");
}
示例7: clang_getCompletionAnnotation
CXString clang_getCompletionAnnotation(CXCompletionString completion_string,
unsigned annotation_number) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr ? cxstring::createRef(CCStr->getAnnotation(annotation_number))
: cxstring::createNull();
}
示例8: clang_getCompletionNumAnnotations
unsigned clang_getCompletionNumAnnotations(CXCompletionString completion_string)
{
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr ? CCStr->getAnnotationCount() : 0;
}
示例9: clang_getCompletionAvailability
enum CXAvailabilityKind
clang_getCompletionAvailability(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr? static_cast<CXAvailabilityKind>(CCStr->getAvailability())
: CXAvailability_Available;
}
示例10: clang_getCompletionPriority
unsigned clang_getCompletionPriority(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr? CCStr->getPriority() : unsigned(CCP_Unlikely);
}
示例11: clang_getNumCompletionChunks
unsigned clang_getNumCompletionChunks(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr? CCStr->size() : 0;
}
示例12: clang_getCompletionAnnotation
CXString clang_getCompletionAnnotation(CXCompletionString completion_string,
unsigned annotation_number) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr ? createCXString(CCStr->getAnnotation(annotation_number))
: createCXString((const char *) 0);
}