#include <codemodel.h>

Public Types | |
typedef std::set< NamespaceAliasModel > | NamespaceAliasModelList |
typedef std::set< NamespaceImportModel > | NamespaceImportModelList |
typedef NamespaceDom | Ptr |
![]() | |
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 |
virtual bool | isNamespace () const |
NamespaceList | namespaceList () |
const NamespaceList | namespaceList () const |
bool | hasNamespace (const TQString &name) const |
NamespaceDom | namespaceByName (const TQString &name) |
const NamespaceDom | namespaceByName (const TQString &name) const |
bool | addNamespace (NamespaceDom ns) |
void | removeNamespace (NamespaceDom ns) |
void | update (const NamespaceModel *ns) |
bool | canUpdate (const NamespaceModel *ns) const |
virtual void | read (TQDataStream &stream) |
virtual void | write (TQDataStream &stream) const |
virtual void | dump (std::ostream &file, bool recurse=false, TQString Info="") |
void | addNamespaceImport (const NamespaceImportModel &import) |
void | addNamespaceAlias (const NamespaceAliasModel &alias) |
void | removeNamespaceImport (const NamespaceImportModel &import) |
void | removeNamespaceAlias (const NamespaceAliasModel &alias) |
const NamespaceAliasModelList & | namespaceAliases () const |
const NamespaceImportModelList & | namespaceImports () 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 |
![]() | |
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 | 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 | |
NamespaceModel (CodeModel *model) | |
![]() | |
ClassModel (CodeModel *model) | |
![]() | |
CodeModelItem (int kind, CodeModel *model) | |
Friends | |
class | CodeModel |
Detailed Description
Namespace model.
Represents a namespace in the code model. Namespace model can represent either usual c++ namespaces and packages or modules from other languages.
Instances of this class should be created using CodeModel::create method.
Definition at line 1039 of file codemodel.h.
Member Typedef Documentation
◆ NamespaceImportModelList
typedef std::set<NamespaceImportModel> NamespaceModel::NamespaceImportModelList |
I'm using std-sets here, because TQt-3 has no appropriate replacement.
Definition at line 1048 of file codemodel.h.
◆ Ptr
typedef NamespaceDom NamespaceModel::Ptr |
A definition of safe pointer to the namespace model.
Definition at line 1051 of file codemodel.h.
Constructor & Destructor Documentation
◆ NamespaceModel()
|
protected |
Constructor.
- Parameters
-
model Code model which stores this item.
Definition at line 664 of file codemodel.cpp.
Member Function Documentation
◆ addNamespace()
bool NamespaceModel::addNamespace | ( | NamespaceDom | ns | ) |
Adds a namespace to the model.
- Parameters
-
ns The namespace model to add to the model.
- Returns
- true if addition was successful.
Definition at line 695 of file codemodel.cpp.
◆ canUpdate()
bool NamespaceModel::canUpdate | ( | const NamespaceModel * | ns | ) | const |
Test if all aliases are same, if not return false
Test if all imports are same, if not return false
Definition at line 1482 of file codemodel.cpp.
◆ hasNamespace()
bool NamespaceModel::hasNamespace | ( | const TQString & | name | ) | const |
Checks if the namespace referenced by name
is in the model.
- Parameters
-
name The name of a namespace.
- Returns
- true if the namespace was found.
Definition at line 690 of file codemodel.cpp.
◆ isClass()
|
inlinevirtual |
- Returns
- true if an item is a ClassModel.
Reimplemented from ClassModel.
Definition at line 1053 of file codemodel.h.
◆ isNamespace()
|
inlinevirtual |
- Returns
- true if an item is a NamespaceModel.
Reimplemented from CodeModelItem.
Definition at line 1054 of file codemodel.h.
◆ namespaceAliases()
|
inline |
Must not be called on temporary objects because a reference is returned(for performance-reasons)
Definition at line 1107 of file codemodel.h.
◆ namespaceByName() [1/2]
NamespaceDom NamespaceModel::namespaceByName | ( | const TQString & | name | ) |
Gets the namespace specified by name
.
If there are no matches, then the NamespaceDom object returned is empty.
- Parameters
-
name The name of a namespace.
- Returns
- The NamespaceDom object that contains the match.
Definition at line 680 of file codemodel.cpp.
◆ namespaceByName() [2/2]
const NamespaceDom NamespaceModel::namespaceByName | ( | const TQString & | name | ) | const |
Gets the namespace specified by name
.
If there are no matches, then the NamespaceDom object returned is empty.
- Parameters
-
name The name of a namespace.
- Returns
- The NamespaceDom object that contains the match.
- Note
- This is a const version provided for convenience.
Definition at line 685 of file codemodel.cpp.
◆ namespaceImports()
|
inline |
Must not be called on temporary objects because a reference is returned(for performance-reasons)
Definition at line 1112 of file codemodel.h.
◆ namespaceList() [1/2]
NamespaceList NamespaceModel::namespaceList | ( | ) |
- Returns
- The list of namespaces in this model.
Definition at line 670 of file codemodel.cpp.
◆ namespaceList() [2/2]
const NamespaceList NamespaceModel::namespaceList | ( | ) | const |
- Returns
- The list of namespaces in this model.
- Note
- This is a const version provided for convenience.
Definition at line 675 of file codemodel.cpp.
◆ read()
|
virtual |
Reads an item from the stream.
- Parameters
-
stream The stream to read from.
Reimplemented from ClassModel.
Reimplemented in FileModel.
Definition at line 1421 of file codemodel.cpp.
◆ removeNamespace()
void NamespaceModel::removeNamespace | ( | NamespaceDom | ns | ) |
Removes the namespace from the model.
- Parameters
-
ns The namespace model to remove from the model.
Definition at line 704 of file codemodel.cpp.
◆ update()
void NamespaceModel::update | ( | const NamespaceModel * | ns | ) |
Updates this model so it has the same content as the other one.
Only the line/column is updated. canUpdate(..) must be tested before.
- Parameters
-
ns the namespace to match
Definition at line 1519 of file codemodel.cpp.
◆ write()
|
virtual |
Writes an item to the stream.
- Parameters
-
stream The stream to write to.
Reimplemented from ClassModel.
Reimplemented in FileModel.
Definition at line 1465 of file codemodel.cpp.
The documentation for this class was generated from the following files: