#include <codemodel.h>

Public Types | |
typedef ClassDom | Ptr |
![]() | |
enum | Kind { File, Namespace, Class, Function, Variable, Argument, FunctionDefinition, Enum, Enumerator, TypeAlias, Custom = 1000 } |
enum | Access { Public, Protected, Private } |
typedef ItemDom | Ptr |
Public Member Functions | |
virtual bool | isClass () const |
TQStringList | scope () const |
void | setScope (const TQStringList &scope) |
TQStringList | baseClassList () const |
bool | addBaseClass (const TQString &baseClass) |
void | removeBaseClass (const TQString &baseClass) |
ClassList | classList () |
const ClassList | classList () const |
bool | hasClass (const TQString &name) const |
ClassList | classByName (const TQString &name) |
const ClassList | classByName (const TQString &name) const |
bool | addClass (ClassDom klass) |
void | removeClass (ClassDom klass) |
FunctionList | functionList () |
const FunctionList | functionList () const |
bool | hasFunction (const TQString &name) const |
FunctionList | functionByName (const TQString &name) |
const FunctionList | functionByName (const TQString &name) const |
bool | addFunction (FunctionDom fun) |
void | removeFunction (FunctionDom fun) |
FunctionDefinitionList | functionDefinitionList () |
const FunctionDefinitionList | functionDefinitionList () const |
bool | hasFunctionDefinition (const TQString &name) const |
FunctionDefinitionList | functionDefinitionByName (const TQString &name) |
const FunctionDefinitionList | functionDefinitionByName (const TQString &name) const |
bool | addFunctionDefinition (FunctionDefinitionDom fun) |
void | removeFunctionDefinition (FunctionDefinitionDom fun) |
VariableList | variableList () |
const VariableList | variableList () const |
bool | hasVariable (const TQString &name) const |
VariableDom | variableByName (const TQString &name) |
const VariableDom | variableByName (const TQString &name) const |
bool | addVariable (VariableDom var) |
void | removeVariable (VariableDom var) |
TypeAliasList | typeAliasList () |
const TypeAliasList | typeAliasList () const |
bool | hasTypeAlias (const TQString &name) const |
TypeAliasList | typeAliasByName (const TQString &name) |
const TypeAliasList | typeAliasByName (const TQString &name) const |
bool | addTypeAlias (TypeAliasDom typeAlias) |
void | removeTypeAlias (TypeAliasDom typeAlias) |
EnumList | enumList () |
const EnumList | enumList () const |
bool | hasEnum (const TQString &name) const |
EnumDom | enumByName (const TQString &name) |
const EnumDom | enumByName (const TQString &name) const |
bool | addEnum (EnumDom e) |
void | removeEnum (EnumDom e) |
void | update (const ClassModel *i) |
bool | canUpdate (const ClassModel *i) const |
virtual void | read (TQDataStream &stream) |
virtual void | write (TQDataStream &stream) const |
virtual void | dump (std::ostream &file, bool recurse=false, TQString Info="") |
![]() | |
void | update (const CodeModelItem *i) |
bool | canUpdate (const CodeModelItem *i) const |
virtual | ~CodeModelItem () |
int | kind () const |
void | setKind (int kind) |
TQString | name () const |
TQString | comment () const |
void | setComment (TQString comment) |
void | setName (const TQString &name) |
FileDom | file () |
const FileDom | file () const |
TQString | fileName () const |
void | setFileName (const TQString &fileName) |
void | getStartPosition (int *line, int *col) const |
void | setStartPosition (int line, int col) |
void | getEndPosition (int *line, int *col) const |
void | setEndPosition (int line, int col) |
virtual bool | isFile () const |
virtual bool | isNamespace () const |
virtual bool | isFunction () const |
virtual bool | isFunctionDefinition () const |
virtual bool | isVariable () const |
virtual bool | isArgument () const |
virtual bool | isEnum () const |
virtual bool | isEnumerator () const |
virtual bool | isTypeAlias () const |
virtual bool | isCustom () const |
virtual bool | isTemplateable () const |
CodeModel * | codeModel () |
const CodeModel * | codeModel () const |
Protected Member Functions | |
ClassModel (CodeModel *model) | |
![]() | |
CodeModelItem (int kind, CodeModel *model) | |
Friends | |
class | CodeModel |
Detailed Description
Class model.
Represents a class in the code model.
Instances of this class should be created using CodeModel::create method.
Definition at line 696 of file codemodel.h.
Member Typedef Documentation
◆ Ptr
typedef ClassDom ClassModel::Ptr |
A definition of safe pointer to the class model.
Definition at line 705 of file codemodel.h.
Constructor & Destructor Documentation
◆ ClassModel()
|
protected |
Constructor.
- Parameters
-
model Code model which stores this item.
Definition at line 716 of file codemodel.cpp.
Member Function Documentation
◆ addBaseClass()
bool ClassModel::addBaseClass | ( | const TQString & | baseClass | ) |
Adds a base class to the list of base classes.
- Parameters
-
baseClass The base class name.
Definition at line 726 of file codemodel.cpp.
◆ addClass()
bool ClassModel::addClass | ( | ClassDom | klass | ) |
Adds a class to the model.
- Parameters
-
klass The class model to add.
- Returns
- true if addition was successful.
Definition at line 776 of file codemodel.cpp.
◆ addEnum()
bool ClassModel::addEnum | ( | EnumDom | e | ) |
Adds an enum to the model.
- Parameters
-
e The enum model to add to the model.
- Returns
- true if the addition was successful.
Definition at line 969 of file codemodel.cpp.
◆ addFunction()
bool ClassModel::addFunction | ( | FunctionDom | fun | ) |
Adds a function to the class model.
- Parameters
-
fun The function model to add.
- Returns
- true if addition was successful.
Definition at line 832 of file codemodel.cpp.
◆ addFunctionDefinition()
bool ClassModel::addFunctionDefinition | ( | FunctionDefinitionDom | fun | ) |
Adds a function definition to the model.
- Parameters
-
fun The function fefinition model to add to the model.
- Returns
- true if the addition was successful.
Definition at line 888 of file codemodel.cpp.
◆ addTypeAlias()
bool ClassModel::addTypeAlias | ( | TypeAliasDom | typeAlias | ) |
Adds a type alias to the model.
- Parameters
-
typeAlias The type alias model to add to the model.
- Returns
- true if the addition was successful.
Definition at line 1044 of file codemodel.cpp.
◆ addVariable()
bool ClassModel::addVariable | ( | VariableDom | var | ) |
Adds a variable to the model.
- Parameters
-
var The variable model to add to the model.
- Returns
- true if the addition was successful.
Definition at line 930 of file codemodel.cpp.
◆ baseClassList()
TQStringList ClassModel::baseClassList | ( | ) | const |
- Returns
- The list of base class names.
Definition at line 721 of file codemodel.cpp.
◆ classByName() [1/2]
ClassList ClassModel::classByName | ( | const TQString & | name | ) |
- Parameters
-
name The name of a class.
- Returns
- A list of classes that match the name given by
name
.
Definition at line 766 of file codemodel.cpp.
◆ classByName() [2/2]
const ClassList ClassModel::classByName | ( | const TQString & | name | ) | const |
- Parameters
-
name The name of a class.
- Returns
- A list of classes that match the name given by
name
.
- Note
- This is a const version provided for convenience.
Definition at line 771 of file codemodel.cpp.
◆ classList() [1/2]
ClassList ClassModel::classList | ( | ) |
- Returns
- The list of (sub)classes in this model.
Definition at line 737 of file codemodel.cpp.
◆ classList() [2/2]
const ClassList ClassModel::classList | ( | ) | const |
- Note
- This is a const version provided for convenience.
- Returns
- The list of (sub)classes in this model.
Definition at line 749 of file codemodel.cpp.
◆ enumByName() [1/2]
EnumDom ClassModel::enumByName | ( | const TQString & | name | ) |
Gets the enum specified by name
.
The EnumDom object returned will be empty if no match is found.
- Parameters
-
name The name of an enum.
- Returns
- The EnumDom object that contains the match.
Definition at line 954 of file codemodel.cpp.
◆ enumByName() [2/2]
const EnumDom ClassModel::enumByName | ( | const TQString & | name | ) | const |
Gets the enum specified by name
.
The EnumDom object returned will be empty if no match is found.
- Parameters
-
name The name of an enum.
- Returns
- The EnumDom object that contains the match.
Definition at line 959 of file codemodel.cpp.
◆ enumList() [1/2]
EnumList ClassModel::enumList | ( | ) |
- Returns
- The list of enums in the model.
Definition at line 944 of file codemodel.cpp.
◆ enumList() [2/2]
const EnumList ClassModel::enumList | ( | ) | const |
- Returns
- The list of enums in the model.
- Note
- This is a const version provided for convenience.
Definition at line 949 of file codemodel.cpp.
◆ functionByName() [1/2]
FunctionList ClassModel::functionByName | ( | const TQString & | name | ) |
- Parameters
-
name The name of a function to look for.
- Returns
- A list of functions that match the name given by
name
.
Definition at line 822 of file codemodel.cpp.
◆ functionByName() [2/2]
const FunctionList ClassModel::functionByName | ( | const TQString & | name | ) | const |
- Parameters
-
name The name of a function to look for.
- Returns
- A list of functions that match the name given by
name
.
- Note
- This is a const version provided for convenience.
Definition at line 827 of file codemodel.cpp.
◆ functionDefinitionByName() [1/2]
FunctionDefinitionList ClassModel::functionDefinitionByName | ( | const TQString & | name | ) |
Gets the list of functions that match the name given by name
.
If there are no matches, then the list returned is empty.
- Parameters
-
name The name of a function definition to look for.
- Returns
- The FunctionDefinitionList object containing the definitions that match.
Definition at line 878 of file codemodel.cpp.
◆ functionDefinitionByName() [2/2]
const FunctionDefinitionList ClassModel::functionDefinitionByName | ( | const TQString & | name | ) | const |
Gets the list of functions that match the name given by name
.
If there are no matches, then the list returned is empty.
- Parameters
-
name The name of a function definition to look for.
- Returns
- The FunctionDefinitionList object containing the definitions that match.
- Note
- This is a const version provided for convenience.
Definition at line 883 of file codemodel.cpp.
◆ functionDefinitionList() [1/2]
FunctionDefinitionList ClassModel::functionDefinitionList | ( | ) |
- Returns
- The list of function definitions in the model.
Definition at line 849 of file codemodel.cpp.
◆ functionDefinitionList() [2/2]
const FunctionDefinitionList ClassModel::functionDefinitionList | ( | ) | const |
- Returns
- The list of function definitions
- Note
- This is a const version provided for convenience.
Definition at line 861 of file codemodel.cpp.
◆ functionList() [1/2]
FunctionList ClassModel::functionList | ( | ) |
- Returns
- A list of functions in the model.
Definition at line 793 of file codemodel.cpp.
◆ functionList() [2/2]
const FunctionList ClassModel::functionList | ( | ) | const |
- Returns
- A list of functions in the model.
- Note
- This is a const version provided for convenience.
Definition at line 805 of file codemodel.cpp.
◆ hasClass()
bool ClassModel::hasClass | ( | const TQString & | name | ) | const |
Checks if the class specified by name
is in this model.
- Parameters
-
name The name of a class to look for.
- Returns
- true if the model has a class.
Definition at line 761 of file codemodel.cpp.
◆ hasEnum()
bool ClassModel::hasEnum | ( | const TQString & | name | ) | const |
Checks if the enum specified by name
is in the model.
- Parameters
-
name The name of an enum.
- Returns
- true if the enum was found.
Definition at line 964 of file codemodel.cpp.
◆ hasFunction()
bool ClassModel::hasFunction | ( | const TQString & | name | ) | const |
Check if the function specified by name
is in the model.
- Parameters
-
name The name of a function to look for.
- Returns
- true if the model has a class.
Definition at line 817 of file codemodel.cpp.
◆ hasFunctionDefinition()
bool ClassModel::hasFunctionDefinition | ( | const TQString & | name | ) | const |
Checks if the function definition specified by name
is in the model.
- Parameters
-
name The name of a function definition to look for.
- Returns
- true if the function definition was found.
Definition at line 873 of file codemodel.cpp.
◆ hasTypeAlias()
bool ClassModel::hasTypeAlias | ( | const TQString & | name | ) | const |
Checks if the type alias specified by name
is in the model.
- Parameters
-
name The name of a type alias.
- Returns
- true if the type alias was found.
Definition at line 1029 of file codemodel.cpp.
◆ hasVariable()
bool ClassModel::hasVariable | ( | const TQString & | name | ) | const |
Checks if the variable specified by name
is in the model.
- Parameters
-
name The name of a variable.
- Returns
- true if the variable was found.
Definition at line 925 of file codemodel.cpp.
◆ isClass()
|
inlinevirtual |
- Returns
- true if an item is a ClassModel.
Reimplemented from CodeModelItem.
Reimplemented in NamespaceModel.
Definition at line 707 of file codemodel.h.
◆ read()
|
virtual |
Reads an item from the stream.
- Parameters
-
stream The stream to read from.
Reimplemented from CodeModelItem.
Reimplemented in FileModel, and NamespaceModel.
Definition at line 1322 of file codemodel.cpp.
◆ removeBaseClass()
void ClassModel::removeBaseClass | ( | const TQString & | baseClass | ) |
Removes a base class from the list of base classes.
- Parameters
-
baseClass The base class name.
Definition at line 732 of file codemodel.cpp.
◆ removeClass()
void ClassModel::removeClass | ( | ClassDom | klass | ) |
Removes a class from the model.
- Parameters
-
klass The class model to remove.
Definition at line 785 of file codemodel.cpp.
◆ removeEnum()
void ClassModel::removeEnum | ( | EnumDom | e | ) |
Removes an enum from the model.
- Parameters
-
e The enum model to remove from the model.
Definition at line 1000 of file codemodel.cpp.
◆ removeFunction()
void ClassModel::removeFunction | ( | FunctionDom | fun | ) |
Removes a function from the class model.
- Parameters
-
fun The FunctionDom object to remove from the model.
Definition at line 841 of file codemodel.cpp.
◆ removeFunctionDefinition()
void ClassModel::removeFunctionDefinition | ( | FunctionDefinitionDom | fun | ) |
Removes a function definition from the model.
- Parameters
-
fun The function fefinition model to remove from the model.
Definition at line 897 of file codemodel.cpp.
◆ removeTypeAlias()
void ClassModel::removeTypeAlias | ( | TypeAliasDom | typeAlias | ) |
Removes a type alias from the model.
- Parameters
-
typeAlias The TypeAliasDom object to remove from the model.
Definition at line 1053 of file codemodel.cpp.
◆ removeVariable()
void ClassModel::removeVariable | ( | VariableDom | var | ) |
Removes a variable from the model.
- Parameters
-
var The variable model to remove from the model.
Definition at line 939 of file codemodel.cpp.
◆ scope()
|
inline |
- Returns
- The scope of the class. Scope is a string list composed from names of parent classes and namespaces.
Definition at line 710 of file codemodel.h.
◆ setScope()
|
inline |
Sets the scope of this class.
- Parameters
-
scope The scope - a list of parent classes and namespaces.
Definition at line 713 of file codemodel.h.
◆ typeAliasByName() [1/2]
TypeAliasList ClassModel::typeAliasByName | ( | const TQString & | name | ) |
Gets the list of type aliases that match name
.
If there are no matches, the TypeAliasList object is empty.
- Parameters
-
name The name of a type alias.
- Returns
- A TypeAliasList object that contains the matches.
Definition at line 1034 of file codemodel.cpp.
◆ typeAliasByName() [2/2]
const TypeAliasList ClassModel::typeAliasByName | ( | const TQString & | name | ) | const |
Gets the list of type aliases that match name
.
If there are no matches, the TypeAliasList object is empty.
- Parameters
-
name The name of a type alias.
- Returns
- A TypeAliasList object that contains the matches.
- Note
- This is a const version provided for convenience.
Definition at line 1039 of file codemodel.cpp.
◆ typeAliasList() [1/2]
TypeAliasList ClassModel::typeAliasList | ( | ) |
- Returns
- The type alias list for this model.
Definition at line 1005 of file codemodel.cpp.
◆ typeAliasList() [2/2]
const TypeAliasList ClassModel::typeAliasList | ( | ) | const |
- Returns
- The type alias list for this model.
- Note
- This is a const version provided for convenience.
Definition at line 1017 of file codemodel.cpp.
◆ variableByName() [1/2]
VariableDom ClassModel::variableByName | ( | const TQString & | name | ) |
Gets the variable specified by name
.
If there are no matches, then the VariableDom object returned is empty.
- Parameters
-
name The name of a variable.
- Returns
- A VariableDom object that matches the name specified.
Definition at line 915 of file codemodel.cpp.
◆ variableByName() [2/2]
const VariableDom ClassModel::variableByName | ( | const TQString & | name | ) | const |
Gets the variable specified by name
.
If there are no matches, then the VariableDom object returned is empty.
- Parameters
-
name The name of a variable.
- Returns
- A VariableDom object that matches the name specified.
- Note
- This is a const version provided for convenience.
Definition at line 920 of file codemodel.cpp.
◆ variableList() [1/2]
VariableList ClassModel::variableList | ( | ) |
- Returns
- The list of variables in the model.
Definition at line 905 of file codemodel.cpp.
◆ variableList() [2/2]
const VariableList ClassModel::variableList | ( | ) | const |
- Returns
- The list of variables in the model.
- Note
- This is a const version provided for convenience.
Definition at line 910 of file codemodel.cpp.
◆ write()
|
virtual |
Writes an item to the stream.
- Parameters
-
stream The stream to write to.
Reimplemented from CodeModelItem.
Reimplemented in FileModel, and NamespaceModel.
Definition at line 1381 of file codemodel.cpp.
The documentation for this class was generated from the following files: