clang  13.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::CodeCompletionString::Chunk Struct Reference

One piece of the code completion string. More...

#include "clang/Sema/CodeCompleteConsumer.h"

Collaboration diagram for clang::CodeCompletionString::Chunk:
Collaboration graph
[legend]

Public Member Functions

 Chunk ()
 
 Chunk (ChunkKind Kind, const char *Text="")
 

Static Public Member Functions

static Chunk CreateText (const char *Text)
 Create a new text chunk. More...
 
static Chunk CreateOptional (CodeCompletionString *Optional)
 Create a new optional chunk. More...
 
static Chunk CreatePlaceholder (const char *Placeholder)
 Create a new placeholder chunk. More...
 
static Chunk CreateInformative (const char *Informative)
 Create a new informative chunk. More...
 
static Chunk CreateResultType (const char *ResultType)
 Create a new result type chunk. More...
 
static Chunk CreateCurrentParameter (const char *CurrentParameter)
 Create a new current-parameter chunk. More...
 

Public Attributes

ChunkKind Kind = CK_Text
 The kind of data stored in this piece of the code completion string. More...
 
union {
   const char *   Text
 The text string associated with a CK_Text, CK_Placeholder, CK_Informative, or CK_Comma chunk. More...
 
   CodeCompletionString *   Optional
 The code completion string associated with a CK_Optional chunk. More...
 
}; 
 

Detailed Description

One piece of the code completion string.

Definition at line 519 of file CodeCompleteConsumer.h.

Constructor & Destructor Documentation

◆ Chunk() [1/2]

clang::CodeCompletionString::Chunk::Chunk ( )
inline

Definition at line 537 of file CodeCompleteConsumer.h.

◆ Chunk() [2/2]

CodeCompletionString::Chunk::Chunk ( ChunkKind  Kind,
const char *  Text = "" 
)
explicit

Member Function Documentation

◆ CreateCurrentParameter()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateCurrentParameter ( const char *  CurrentParameter)
static

Create a new current-parameter chunk.

Definition at line 275 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_CurrentParameter.

Referenced by clang::CodeCompletionBuilder::AddCurrentParameterChunk().

◆ CreateInformative()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateInformative ( const char *  Informative)
static

Create a new informative chunk.

Definition at line 266 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_Informative.

Referenced by clang::CodeCompletionBuilder::AddInformativeChunk().

◆ CreateOptional()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateOptional ( CodeCompletionString Optional)
static

Create a new optional chunk.

Definition at line 253 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_Optional.

Referenced by clang::CodeCompletionBuilder::AddOptionalChunk().

◆ CreatePlaceholder()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreatePlaceholder ( const char *  Placeholder)
static

Create a new placeholder chunk.

Definition at line 261 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_Placeholder.

Referenced by clang::CodeCompletionBuilder::AddPlaceholderChunk().

◆ CreateResultType()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateResultType ( const char *  ResultType)
static

Create a new result type chunk.

Definition at line 271 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_ResultType.

Referenced by clang::CodeCompletionBuilder::AddResultTypeChunk().

◆ CreateText()

CodeCompletionString::Chunk CodeCompletionString::Chunk::CreateText ( const char *  Text)
static

Create a new text chunk.

Definition at line 248 of file CodeCompleteConsumer.cpp.

References clang::CodeCompletionString::CK_Text, and Text.

Referenced by clang::CodeCompletionBuilder::AddTextChunk().

Member Data Documentation

◆ @196

union { ... }

◆ Kind

ChunkKind clang::CodeCompletionString::Chunk::Kind = CK_Text

The kind of data stored in this piece of the code completion string.

Definition at line 522 of file CodeCompleteConsumer.h.

Referenced by Chunk().

◆ Optional

CodeCompletionString* clang::CodeCompletionString::Chunk::Optional

The code completion string associated with a CK_Optional chunk.

The optional code completion string is owned by the chunk, and will be deallocated (with delete) when the chunk is destroyed.

Definition at line 534 of file CodeCompleteConsumer.h.

◆ Text

const char* clang::CodeCompletionString::Chunk::Text

The text string associated with a CK_Text, CK_Placeholder, CK_Informative, or CK_Comma chunk.

The string is owned by the chunk and will be deallocated (with delete[]) when the chunk is destroyed.

Definition at line 529 of file CodeCompleteConsumer.h.

Referenced by Chunk().


The documentation for this struct was generated from the following files: