Namespaces | |
FunctionDefinitions | |
Functions | |
Classes | |
struct | AllFunctionDefinitions |
struct | AllFunctions |
class | PredDefinitionMatchesDeclaration |
struct | Scope |
Detailed Description
Namespace which contains utility functions and classes for the CodeModel.
Function Documentation
◆ accessSpecifierToString()
TQString CodeModelUtils::accessSpecifierToString | ( | CodeModelItem::Access | access | ) |
Get the string representation of an accesss pecifier.
- Parameters
-
access An access specifier to get a string representation of.
- Returns
- string The representation of an access (e.g. "public").
Definition at line 489 of file codemodel_utils.cpp.
◆ allFunctionDefinitionsDetailed()
AllFunctionDefinitions CodeModelUtils::allFunctionDefinitionsDetailed | ( | const FileDom & | dom | ) |
- Returns
- A detailed list of all function definitions in the file (detailed list contains the information about a scope of each FunctionDefinitionDom found).
- Parameters
-
dom File Dom to look for functions in.
Definition at line 271 of file codemodel_utils.cpp.
◆ allFunctionDefinitionsExhaustive()
FunctionDefinitionList CodeModelUtils::allFunctionDefinitionsExhaustive | ( | FileDom & | dom | ) |
- Returns
- A list of all function-definitions in the file. This version searches the file's whole group for functions that may have been inserted into the other file's structure. Unlike the methods above, this guarantees that all returned functions physically belong to that file.
- Parameters
-
dom File Dom to look for functions in.
Definition at line 393 of file codemodel_utils.cpp.
◆ allFunctions()
FunctionList CodeModelUtils::allFunctions | ( | const FileDom & | dom | ) |
- Returns
- A list of all functions in the file.
- Parameters
-
dom File Dom to look for functions in.
Definition at line 219 of file codemodel_utils.cpp.
◆ allFunctionsDetailed()
AllFunctions CodeModelUtils::allFunctionsDetailed | ( | const FileDom & | dom | ) |
- Returns
- A detailed list of all functions in the file (detailed list contains the information about a scope of each FunctionDom found).
- Parameters
-
dom File Dom to look for functions in.
Definition at line 245 of file codemodel_utils.cpp.
◆ allFunctionsExhaustive()
FunctionList CodeModelUtils::allFunctionsExhaustive | ( | FileDom & | dom | ) |
- Returns
- A list of all functions in the file. This version searches the file's whole group for functions that may have been inserted into the other file's structure. Unlike the methods above, this guarantees that all returned functions physically belong to that file.
- Parameters
-
dom File Dom to look for functions in.
Definition at line 383 of file codemodel_utils.cpp.
◆ compareDeclarationToDefinition() [1/2]
bool CodeModelUtils::compareDeclarationToDefinition | ( | const FunctionDom & | dec, |
const FunctionDefinitionDom & | def | ||
) |
Compares a declaration and a defintion of a function.
- Parameters
-
dec declaration def definition
- Returns
- true, if dec is the declaration of the function definition def, false otherwise
Definition at line 320 of file codemodel_utils.cpp.
◆ compareDeclarationToDefinition() [2/2]
bool CodeModelUtils::compareDeclarationToDefinition | ( | const FunctionDom & | dec, |
const FunctionDefinitionDom & | def, | ||
const std::set< NamespaceImportModel > & | nsImports | ||
) |
Compares a declaration and a defintion of a function.
- Parameters
-
dec declaration def definition nsImports namespace imports for the namespace the definition appears in
- Returns
- true, if dec is the declaration of the function definition def, false otherwise
Definition at line 339 of file codemodel_utils.cpp.
◆ findClassByPosition() [1/2]
ClassDom CodeModelUtils::findClassByPosition | ( | NamespaceModel * | nameSpace, |
int | line, | ||
int | col | ||
) |
Finds a class by its position in a file(position inside the part of the file, where the class is declared).
In the case of nested classes the innermost class which is declared at/around the provided position.
- Parameters
-
nameSpace A namespace to search for the class. line A linenumber inside the class declaration. col The colum of line.
- Returns
- The innermost class, which is declared at/around position defined with line / col, or 0 if no class is found.
Definition at line 404 of file codemodel_utils.cpp.
◆ findClassByPosition() [2/2]
ClassDom CodeModelUtils::findClassByPosition | ( | ClassModel * | aClass, |
int | line, | ||
int | col | ||
) |
Same as above, just searches inside a class instead of a namespace.
Definition at line 428 of file codemodel_utils.cpp.
◆ findFunctionDeclarations() [1/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const FileList & | fileList, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in files.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. fileList The list of files to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 276 of file codemodel_utils.h.
◆ findFunctionDeclarations() [2/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const NamespaceDom & | ns, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in the namespace.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. ns The namespace to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 283 of file codemodel_utils.h.
◆ findFunctionDeclarations() [3/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const NamespaceList & | namespaceList, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in namespaces.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. namespaceList The list of namespaces to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 291 of file codemodel_utils.h.
◆ findFunctionDeclarations() [4/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const ClassList & | classList, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in classes.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. classList The list of classes to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 298 of file codemodel_utils.h.
◆ findFunctionDeclarations() [5/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const FunctionList & | functionList, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in the list of function declarations.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. functionList The list of function declarations to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 305 of file codemodel_utils.h.
◆ findFunctionDeclarations() [6/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const ClassDom & | klass, | ||
FunctionList & | lst | ||
) |
Finds function declarations which match given predicate in the class.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. klass The class to find function declarations in. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 312 of file codemodel_utils.h.
◆ findFunctionDeclarations() [7/7]
void CodeModelUtils::findFunctionDeclarations | ( | Pred | pred, |
const FunctionDom & | fun, | ||
FunctionList & | lst | ||
) |
Applies a predicate to a function declaration.
Predicate can be considered as a condition. If it is true then the function declaration is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function declaration before it is returned. fun The function declaration. lst The reference to a list of function declarations. Will be filled by this function.
Definition at line 319 of file codemodel_utils.h.
◆ findFunctionDefinitions() [1/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const FileList & | fileList, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in files.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. fileList The list of files to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 224 of file codemodel_utils.h.
◆ findFunctionDefinitions() [2/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const NamespaceDom & | ns, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in the namespace.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. ns The namespace to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 231 of file codemodel_utils.h.
◆ findFunctionDefinitions() [3/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const NamespaceList & | namespaceList, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in namespaces.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. namespaceList The list of namespaces to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 239 of file codemodel_utils.h.
◆ findFunctionDefinitions() [4/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const ClassList & | classList, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in classes.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. classList The list of classes to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 246 of file codemodel_utils.h.
◆ findFunctionDefinitions() [5/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const FunctionDefinitionList & | functionDefinitionList, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in the list of function definitions.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. functionDefinitionList The list of function definitions to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 253 of file codemodel_utils.h.
◆ findFunctionDefinitions() [6/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const ClassDom & | klass, | ||
FunctionDefinitionList & | lst | ||
) |
Finds function definitions which match given predicate in the class.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. klass The class to find function definitions in. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 260 of file codemodel_utils.h.
◆ findFunctionDefinitions() [7/7]
void CodeModelUtils::findFunctionDefinitions | ( | Pred | pred, |
const FunctionDefinitionDom & | fun, | ||
FunctionDefinitionList & | lst | ||
) |
Applies a predicate to a function definition.
Predicate can be considered as a condition. If it is true then the function definition is added to the result list otherwise it is skipped.
- See also
- Pred class documentation for a detailed description on how to create and use predicates.
- Parameters
-
pred Predicate which is applied to a function definition before it is returned. fun The function definition. lst The reference to a list of function definitions. Will be filled by this function.
Definition at line 267 of file codemodel_utils.h.
◆ findLastMethodLine()
int CodeModelUtils::findLastMethodLine | ( | ClassDom | aClass, |
CodeModelItem::Access | access | ||
) |
Finds the last occurrence (line of file wise) of a method inside a class declaration with specific access specificer.
This can be used e.g. to find a position to new methods to the class.
- Parameters
-
aClass class to search for method. access the access specifier with which methods are searched for.
- Returns
- The last line a Method with access specifier access is found, or -1 if no method with that access specifier was found.
Definition at line 455 of file codemodel_utils.cpp.
◆ findLastVariableLine()
int CodeModelUtils::findLastVariableLine | ( | ClassDom | aClass, |
CodeModelItem::Access | access | ||
) |
Same as above, but finds a membervariable instead of a method.
Definition at line 472 of file codemodel_utils.cpp.