#include <codemodel.h>
Public Member Functions | |
CodeModel () | |
virtual | ~CodeModel () |
template<class T > | |
T::Ptr | create () |
void | wipeout () |
FileList | fileList () |
const FileList | fileList () const |
bool | hasFile (const TQString &name) const |
FileDom | fileByName (const TQString &name) |
const FileDom | fileByName (const TQString &name) const |
bool | addFile (FileDom file) |
void | removeFile (FileDom file) |
const NamespaceDom | globalNamespace () const |
virtual void | read (TQDataStream &stream) |
virtual void | write (TQDataStream &stream) const |
virtual void | dump (std::ostream &file, TQString Info="") |
int | mergeGroups (int g1, int g2) |
FileList | getGroup (int gid) const |
FileList | getGroup (const FileDom &file) const |
virtual TQStringList | getGroupStrings (int gid) const |
Friends | |
class | CodeModelItem |
class | FileModel |
Detailed Description
Code Model - a memory symbol store.
Symbol store (aka class store) is a database of symbols found in code with the important information about those symbols.
For example, programming language support plugins use symbol store to remember information about classes, functions, etc. For each type of symbol a certain information can be stored - symbol name, the location in source file, etc.
- See also
- codemodel.h documentation for a list of typedefs and other convenience functions.
- codemodel_utils.h documentation for an additional code model utility functions and classes reference.
Definition at line 324 of file codemodel.h.
Constructor & Destructor Documentation
◆ CodeModel()
CodeModel::CodeModel | ( | ) |
◆ ~CodeModel()
|
virtual |
Destructor.
Definition at line 102 of file codemodel.cpp.
Member Function Documentation
◆ addFile()
bool CodeModel::addFile | ( | FileDom | file | ) |
Adds a file to the store.
- Parameters
-
file The FileDom object to add to the store.
- Returns
- true if the file was added successfully.
the error-channel is set to 9007 because this problem appears with the cpp-support, so it is needed while debugging it
Definition at line 500 of file codemodel.cpp.
◆ create()
|
inline |
Creates a code model item.
This should be used to create code model items.
For example, to create a class model somewhere in your plugin, use:
- Returns
- Created code model item.
Definition at line 343 of file codemodel.h.
◆ dump()
|
virtual |
this will dump the whole tree into dot-file-format so it can be inspected, not ready yet
Definition at line 309 of file codemodel.cpp.
◆ fileByName() [1/2]
FileDom CodeModel::fileByName | ( | const TQString & | name | ) |
Gets the FileDom object for a file.
- Parameters
-
name The name of the file to get the FileDom object for.
Definition at line 386 of file codemodel.cpp.
◆ fileByName() [2/2]
const FileDom CodeModel::fileByName | ( | const TQString & | name | ) | const |
Gets the FileDom object for a file.
This is a const version provided for convenience.
- Parameters
-
name the name of the file to get the FileDom object for.
Definition at line 396 of file codemodel.cpp.
◆ fileList() [1/2]
FileList CodeModel::fileList | ( | ) |
Gets the list of files in the store.
- Returns
- The FileList object that contains the list of files.
Definition at line 371 of file codemodel.cpp.
◆ fileList() [2/2]
const FileList CodeModel::fileList | ( | ) | const |
Gets the list of files in the store.
This is a const version for convenience.
- Returns
- The FileList object that contains the list of files.
Definition at line 376 of file codemodel.cpp.
◆ getGroup()
FileList CodeModel::getGroup | ( | int | gid | ) | const |
Returns all files within the given group it should be preferred calling FileModel::wholeGroup and FileModel::wholeGroupStrings because those return in constant time if they are the only member of the group.
Definition at line 123 of file codemodel.cpp.
◆ getGroupStrings()
|
virtual |
Same as above, but returns the names instead of the objects.
Definition at line 114 of file codemodel.cpp.
◆ globalNamespace()
const NamespaceDom CodeModel::globalNamespace | ( | ) | const |
Gets the global namespace.
- Returns
- The NamespaceDom object that represents the global namespace.
Definition at line 1280 of file codemodel.cpp.
◆ hasFile()
bool CodeModel::hasFile | ( | const TQString & | name | ) | const |
Checks to see if a file is in the store.
- Returns
- true if
name
is in the file list.
Definition at line 381 of file codemodel.cpp.
◆ mergeGroups()
int CodeModel::mergeGroups | ( | int | g1, |
int | g2 | ||
) |
Merges two groups, by changing the group-ids of the files.
Returns the id of the new group, or 0 on fail.
- Parameters
-
g1 first group g2 second group
Definition at line 135 of file codemodel.cpp.
◆ read()
|
virtual |
Reads the model from a stream.
Use this to save the memory symbol store to a file.
Language support plugins usually save symbols from projects before the project is closed to avoid reparsing when the project is opened next time.
- Parameters
-
stream Stream to read from.
- Returns
- whether the read succeeded(may fail when the store-format is deprecated).
Definition at line 1613 of file codemodel.cpp.
◆ removeFile()
void CodeModel::removeFile | ( | FileDom | file | ) |
Removes a file from the store.
- Parameters
-
file the FileDom object to remove from the store.
Definition at line 545 of file codemodel.cpp.
◆ wipeout()
void CodeModel::wipeout | ( | ) |
Resets the CodeModel.
Definition at line 362 of file codemodel.cpp.
◆ write()
|
virtual |
Writes the model to a stream.
Use this to restore the memory symbol store to a file.
Language support plugins usually save symbols from projects before the project is closed to avoid reparsing when the project is opened next time.
- Parameters
-
stream Stream to write to.
Definition at line 1627 of file codemodel.cpp.
The documentation for this class was generated from the following files: