Extending Qt Creator Manual | Document

Extending Qt Creator Manual 4.5.2

# Document Class

(CPlusPlus::Document)

- List of all members, including inherited members

## Public Types

class | Block
class | DiagnosticMessage
class | Include
class | MacroUse
class | UndefinedMacroUse
enum | CheckMode { Unchecked, FullCheck, FastCheck }
enum | ParseMode { ParseTranlationUnit, ParseDeclaration, ParseExpression, ParseDeclarator, ParseStatement }
typedef | Ptr

## Public Functions

| ~Document()
void | addDiagnosticMessage(const DiagnosticMessage &d)
void | addIncludeFile(const Include &include)
void | addMacroUse(const Macro &macro, unsigned bytesOffset, unsigned bytesLength, unsigned utf16charsOffset, unsigned utf16charLength, unsigned beginLine, const QVector<MacroArgumentReference> &range)
void | addUndefinedMacroUse(const QByteArray &name, unsigned bytesOffset, unsigned utf16charsOffset)
void | appendMacro(const Macro &macro)
void | check(CheckMode mode = FullCheck)
CheckMode | checkMode() const
void | clearDiagnosticMessages()
Control * | control() const
QList<Macro> | definedMacros() const
QList<DiagnosticMessage> | diagnosticMessages() const
unsigned | editorRevision() const
QString | fileName() const
const Macro * | findMacroDefinitionAt(unsigned line) const
const MacroUse * | findMacroUseAt(unsigned utf16charsOffset) const
const UndefinedMacroUse * | findUndefinedMacroUseAt(unsigned utf16charsOffset) const
QByteArray | fingerprint() const
QString | functionAt(int line, int column, int *lineOpeningDeclaratorParenthesis = 0, int *lineClosingBrace = 0) const
Namespace * | globalNamespace() const
Symbol * | globalSymbolAt(unsigned index) const
unsigned | globalSymbolCount() const
QByteArray | includeGuardMacroName() const
QStringList | includedFiles() const
bool | isParsed() const
bool | isTokenized() const
void | keepSourceAndAST()
LanguageFeatures | languageFeatures() const
QDateTime | lastModified() const
Symbol * | lastVisibleSymbolAt(unsigned line, unsigned column = 0) const
QList<MacroUse> | macroUses() const
bool | parse(ParseMode mode = ParseTranlationUnit)
void | releaseSourceAndAST()
QList<Include> | resolvedIncludes() const
unsigned | revision() const
Scope * | scopeAt(unsigned line, unsigned column = 0)
void | setEditorRevision(unsigned editorRevision)
void | setFingerprint(const QByteArray &fingerprint)
void | setGlobalNamespace(Namespace *globalNamespace)
void | setIncludeGuardMacroName(const QByteArray &includeGuardMacroName)
void | setLanguageFeatures(LanguageFeatures features)
void | setLastModified(const QDateTime &lastModified)
void | setRevision(unsigned revision)
void | setSkipFunctionBody(bool skipFunctionBody)
void | setUtf8Source(const QByteArray &utf8Source)
bool | skipFunctionBody() const
QList<Block> | skippedBlocks() const
void | startSkippingBlocks(unsigned utf16charsOffset)
void | stopSkippingBlocks(unsigned utf16charsOffset)
Control * | swapControl(Control *newControl)
void | tokenize()
TranslationUnit * | translationUnit() const
QList<UndefinedMacroUse> | undefinedMacroUses() const
QList<Include> | unresolvedIncludes() const
QByteArray | utf8Source() const

## Static Public Members

Ptr | create(const QString &fileName)

## Member Type Documentation

### enum Document::CheckMode

### enum Document::ParseMode

### typedef Document::Ptr

## Member Function Documentation

### Document::~Document()

Destroys the instance of Document.

### void Document::addDiagnosticMessage(const DiagnosticMessage &d)

### void Document::addIncludeFile(const Include &include)

### void Document::addMacroUse(const Macro &macro, unsigned bytesOffset, unsigned bytesLength, unsigned utf16charsOffset, unsigned utf16charLength, unsigned beginLine, const QVector<MacroArgumentReference> &range)

### void Document::addUndefinedMacroUse(const QByteArray &name, unsigned bytesOffset, unsigned utf16charsOffset)

### void Document::appendMacro(const Macro &macro)

### void Document::check(CheckMode mode = FullCheck)

### CheckMode Document::checkMode() const

### void Document::clearDiagnosticMessages()

### Control *Document::control() const

### `[static]` Ptr Document::create(const QString &fileName)

### QList<Macro> Document::definedMacros() const

Returns the list of macros defined.

See also Document::macroUses() and Document::undefinedMacroUses().

### QList<DiagnosticMessage> Document::diagnosticMessages() const

### unsigned Document::editorRevision() const

See also setEditorRevision().

### QString Document::fileName() const

### const Macro *Document::findMacroDefinitionAt(unsigned line) const

### const MacroUse *Document::findMacroUseAt(unsigned utf16charsOffset) const

### const UndefinedMacroUse *Document::findUndefinedMacroUseAt(unsigned utf16charsOffset) const

### QByteArray Document::fingerprint() const

See also setFingerprint().

### QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorParenthesis = 0, int *lineClosingBrace = 0) const

* Extract the function name including scope at the given position. * * Note that a function (scope) starts at the name of that function, not at the return type. The * implication is that this function will return an empty string when the line/column is on the * return type. * * line the line number, starting with line 1 * column the column number, starting with column 1 * lineOpeningDeclaratorParenthesis optional output parameter, the line of the opening parenthesis of the declarator starting with 1 * lineClosingBrace optional output parameter, the line of the closing brace starting with 1

### Namespace *Document::globalNamespace() const

See also setGlobalNamespace().

### Symbol *Document::globalSymbolAt(unsigned index) const

### unsigned Document::globalSymbolCount() const

### QByteArray Document::includeGuardMacroName() const

See also setIncludeGuardMacroName().

### QStringList Document::includedFiles() const

### bool Document::isParsed() const

### bool Document::isTokenized() const

### void Document::keepSourceAndAST()

### LanguageFeatures Document::languageFeatures() const

See also setLanguageFeatures().

### QDateTime Document::lastModified() const

See also setLastModified().

### Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column = 0) const

### QList<MacroUse> Document::macroUses() const

Returns a list of macros used.

See also Document::undefinedMacroUses(), Document::definedMacros(), and Macro.

### bool Document::parse(ParseMode mode = ParseTranlationUnit)

### void Document::releaseSourceAndAST()

### QList<Include> Document::resolvedIncludes() const

### unsigned Document::revision() const

See also setRevision().

### Scope *Document::scopeAt(unsigned line, unsigned column = 0)

### void Document::setEditorRevision(unsigned editorRevision)

See also editorRevision().

### void Document::setFingerprint(const QByteArray &fingerprint)

See also fingerprint().

### void Document::setGlobalNamespace(Namespace *globalNamespace)

See also globalNamespace().

### void Document::setIncludeGuardMacroName(const QByteArray &includeGuardMacroName)

See also includeGuardMacroName().

### void Document::setLanguageFeatures(LanguageFeatures features)

See also languageFeatures().

### void Document::setLastModified(const QDateTime &lastModified)

See also lastModified().

### void Document::setRevision(unsigned revision)

See also revision().

### void Document::setSkipFunctionBody(bool skipFunctionBody)

See also skipFunctionBody().

### void Document::setUtf8Source(const QByteArray &utf8Source)

See also utf8Source().

### bool Document::skipFunctionBody() const

See also setSkipFunctionBody().

### QList<Block> Document::skippedBlocks() const

### void Document::startSkippingBlocks(unsigned utf16charsOffset)

### void Document::stopSkippingBlocks(unsigned utf16charsOffset)

### Control *Document::swapControl(Control *newControl)

### void Document::tokenize()

### TranslationUnit *Document::translationUnit() const

### QList<UndefinedMacroUse> Document::undefinedMacroUses() const

Returns a list of referenced but undefined macros.

See also Document::macroUses(), Document::definedMacros(), and Macro.

### QList<Include> Document::unresolvedIncludes() const

### QByteArray Document::utf8Source() const

See also setUtf8Source().