Class Function.

Inherits Garbage

The Function class models a member function.

Member functions are the only functions in udoc's world.

Each function has a file() and line() number, which consequently are the ones in the class declaration, and it should have a docBlock(). (The DocBlock's file and line number presumably are in a .cpp file.)

Function::Function( const String & type, const String & name, const String & arguments, bool constness, File * originFile, uint originLine )

Constructs a function whose return type is type, whose full name (including class) is name, whose arguments are arguments, and with constness. originFile and originLine point to the function's defining source, which will be used in any error messages.

String Function::arguments() const

Returns the arguments of this Function as a string.

DocBlock * Function::docBlock() const

Returns a pointer to the DocBlock that documents this Function, or a null pointer if the Function is undocumented.

File * Function::file() const

Returns a pointer to the File where this Function is defined, suitable for error messages.

static Function * Function::find( const String & name, const String & arguments, bool constness )

Returns a pointer to the Function object that is named (fully qualified) name, accepts arguments, and is/is not const as described by constness. If there is no such Function object, find() returns 0.

If only name is supplied, any arguments and constness are accepted.

bool Function::hasArgument( const String & s ) const

Returns true if s is the variable name of one of this function's arguments as specified in the .cpp file, and false if not.

bool Function::isConst()

Returns true if this function is const, and false otherwise.

uint Function::line() const

Returns the line number where this Function was defined, suitable for error messages.

String Function::name() const

Returns the name of this Function.

void Function::setArgumentList( const String & arguments )

Notifies this Function that its argument list is really arguments, contrary to what it may previously have believed.

It is legal to have different parameter names in the .h and .cpp file names. In that case, udoc needs to see and remember the names in the .cpp file, even if the Function was originally created based on the .h file.

void Function::setDocBlock( DocBlock * db )

Sets this Function's DocBlock to db.

void Function::setOverload()

Notifies this function that it has an "\overload" directive.

Function * Function::super() const

Returns a pointer to the function which this function reimplements, or a null pointer if this function isn't a reimplementation (or if it is, but udoc can't see it.)

String Function::type() const

Returns the type of this Function.

static String Function::typesOnly( const String & a )

Returns a version of the argument list a which is stripped of argument names. For example, "( int a, const String & b, int )" is transformed into "( int a, const String &, int )".

This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.