Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
A class for parsing and managing a function parameter list. More...
#include <parameters.h>
Public Member Functions | |
Parameters () | |
Parameters (const QString &signature) | |
void | clear () |
const ParameterVector & | parameters () const |
bool | isPrivateSignal () const |
bool | isEmpty () const |
bool | isValid () const |
int | count () const |
void | reserve (int count) |
const Parameter & | at (int i) const |
Parameter & | last () |
const Parameter & | last () const |
Parameter & | operator[] (int index) |
void | append (const QString &type, const QString &name, const QString &value) |
Append a Parameter constructed from type, name, and value to the parameter vector. | |
void | append (const QString &type, const QString &name) |
void | append (const QString &type) |
void | pop_back () |
void | setPrivateSignal () |
QString | signature (bool includeValues=false) const |
Returns the list of reconstructed parameters. | |
QString | rawSignature (bool names=false, bool values=false) const |
Returns the signature of all the parameters with all the spaces and commas removed. | |
void | set (const QString &signature) |
Parse the parameter signature by splitting the string, and store the individual parameters in the parameter vector. | |
QSet< QString > | getNames () const |
Insert all the parameter names into names. | |
QString | generateTypeList () const |
Construct a list of the parameter types and return it. | |
QString | generateTypeAndNameList () const |
Construct a list of the parameter type/name pairs and return it. | |
bool | match (const Parameters ¶meters) const |
Returns true if parameters contains the same parameter signature as this. | |
A class for parsing and managing a function parameter list.
The constructor is passed a string that is the text inside the parentheses of a function declaration. The constructor parses the parameter list into a vector of class Parameter.
The Parameters object is then used in function searches to find the correct function node given the function name and the signature of its parameters.
Definition at line 56 of file parameters.h.
Parameters::Parameters | ( | ) |
Definition at line 63 of file parameters.cpp.
Parameters::Parameters | ( | const QString & | signature | ) |
Definition at line 68 of file parameters.cpp.
Definition at line 80 of file parameters.h.
Definition at line 79 of file parameters.h.
Append a Parameter constructed from type, name, and value to the parameter vector.
Definition at line 389 of file parameters.cpp.
|
inlinenodiscard |
Definition at line 74 of file parameters.h.
Referenced by Aggregate::findFunctionChild(), DocBookGenerator::generateDocBookSynopsis(), and match().
|
inline |
Definition at line 62 of file parameters.h.
Referenced by QmlSignatureParser::matchFunctionDecl(), and set().
|
inlinenodiscard |
Definition at line 72 of file parameters.h.
Referenced by Aggregate::findFunctionChild(), DocBookGenerator::generateDocBookSynopsis(), generateTypeAndNameList(), generateTypeList(), CppCodeMarker::markedUpQmlItem(), CppCodeMarker::markedUpSynopsis(), match(), and FnCommandParser::operator()().
|
nodiscard |
Construct a list of the parameter type/name pairs and return it.
Definition at line 508 of file parameters.cpp.
References count().
|
nodiscard |
Construct a list of the parameter types and return it.
Definition at line 491 of file parameters.cpp.
References count().
Insert all the parameter names into names.
Definition at line 477 of file parameters.cpp.
|
inlinenodiscard |
Definition at line 70 of file parameters.h.
Referenced by Aggregate::findFunctionChild(), DocBookGenerator::generateDocBookSynopsis(), CppCodeMarker::markedUpQmlItem(), and CppCodeMarker::markedUpSynopsis().
|
inlinenodiscard |
Definition at line 69 of file parameters.h.
Referenced by CodeMarker::extraSynopsis(), and FunctionNode::isPrivateSignal().
|
inlinenodiscard |
Definition at line 71 of file parameters.h.
|
inline |
Definition at line 75 of file parameters.h.
|
inlinenodiscard |
Definition at line 76 of file parameters.h.
|
nodiscard |
Returns true if parameters contains the same parameter signature as this.
Definition at line 529 of file parameters.cpp.
|
inline |
Definition at line 77 of file parameters.h.
Referenced by FnCommandParser::operator()().
|
inlinenodiscard |
Definition at line 68 of file parameters.h.
|
inline |
Definition at line 81 of file parameters.h.
Returns the signature of all the parameters with all the spaces and commas removed.
It is unintelligible, but that is what the caller wants.
If names is true, the parameter names are included. If values is true, the default values are included.
Definition at line 419 of file parameters.cpp.
|
inline |
Definition at line 73 of file parameters.h.
Parse the parameter signature by splitting the string, and store the individual parameters in the parameter vector.
This method of parsing is naive but sufficient for QML methods and macros.
Definition at line 440 of file parameters.cpp.
References clear().
|
inline |
Definition at line 82 of file parameters.h.
Returns the list of reconstructed parameters.
If includeValues is true, the default values are included, if any are present.
Definition at line 398 of file parameters.cpp.