Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CodeChunk Class Reference

The CodeChunk class represents a tiny piece of C++ code. More...

#include <codechunk.h>

Collaboration diagram for CodeChunk:

Public Member Functions

 CodeChunk ()
void append (const QString &lexeme)
 Appends lexeme to the current string contents, inserting a space if appropriate.
void appendHotspot ()
bool isEmpty () const
void clear ()
QString toString () const
QString left () const
QString right () const

Detailed Description

The CodeChunk class represents a tiny piece of C++ code.

The class provides conversion between a list of lexemes and a string. It adds spaces in the right places for consistent style. The tiny pieces of code it represents are data types, enum values, and default parameter values.

Apart from the piece of code itself, the chunk also records a hotspot, which is the place the variable name should be inserted in the case of a variable or parameter declaration. The hotspot of

char * []

is between '*' and '[]'.

Definition at line 13 of file codechunk.h.

Constructor & Destructor Documentation

◆ CodeChunk()

CodeChunk::CodeChunk ( )
inline

Definition at line 16 of file codechunk.h.

Member Function Documentation

◆ append()

void CodeChunk::append ( const QString & lexeme)

Appends lexeme to the current string contents, inserting a space if appropriate.

Definition at line 80 of file codechunk.cpp.

◆ appendHotspot()

void CodeChunk::appendHotspot ( )
inline

Definition at line 19 of file codechunk.h.

◆ clear()

void CodeChunk::clear ( )
inline

Definition at line 26 of file codechunk.h.

◆ isEmpty()

bool CodeChunk::isEmpty ( ) const
inlinenodiscard

Definition at line 25 of file codechunk.h.

◆ left()

QString CodeChunk::left ( ) const
inlinenodiscard

Definition at line 28 of file codechunk.h.

◆ right()

QString CodeChunk::right ( ) const
inlinenodiscard

Definition at line 32 of file codechunk.h.

◆ toString()

QString CodeChunk::toString ( ) const
inlinenodiscard

Definition at line 27 of file codechunk.h.


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