本文整理汇总了C++中CodeCompletionString::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeCompletionString::size方法的具体用法?C++ CodeCompletionString::size怎么用?C++ CodeCompletionString::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeCompletionString
的用法示例。
在下文中一共展示了CodeCompletionString::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
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!");
}
示例2: clang_getNumCompletionChunks
unsigned clang_getNumCompletionChunks(CXCompletionString completion_string) {
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
return CCStr? CCStr->size() : 0;
}