Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
dxl::Target::FunctionArguments Struct Reference

Description:

A List of function argument types (strings). This is not a vector or list container, but a mono-allocated array of arguments. Construction and allocation is done with the static method PARSE.

The names of the arguments are left pruned. Furthermore, few standardizations in respect to spacing are performed. This enables to easily identify whether a given XLink and a corresponding Target share the exact same parameters

Definition at line 81 of file target.hpp.

#include <target.hpp>

Public Static Method Index:

static int MATCH (FunctionArguments *linkArgs, FunctionArguments *targetArgs)
static FunctionArgumentsPARSE (alib::MonoAllocator &ma, alib::Substring &parser)

Public Field Index:

alib::StringArguments = nullptr
 An array of length Count of strings.
int Count
 The number of arguments.

Public Method Index:

void Print (alib::AString &dest)

Protected Method Index:

 FunctionArguments ()=default
 Constructor.

Field Details:

◆ Arguments

alib::String* dxl::Target::FunctionArguments::Arguments = nullptr

An array of length Count of strings.

Definition at line 86 of file target.hpp.

◆ Count

int dxl::Target::FunctionArguments::Count

The number of arguments.

Definition at line 83 of file target.hpp.

Method Details:

◆ MATCH()

int dxl::Target::FunctionArguments::MATCH ( FunctionArguments * linkArgs,
FunctionArguments * targetArgs )
static

Tests if the arguments linkArgs of an XLink match the ones of a target. Not all the arguments need to match, and only substrings of the arguments need to be given to have a match (see return value). todo

Parameters
linkArgsThe arguments in the XLink.
targetArgsThe arguments in the target.
Returns
This method has five possible return values:
  • 0 if arguments are given in the linkArgs and those do not match.
  • 1 if the XLink has no arguments specified (or empty brackets), while the target has arguments.
  • 2 if no arguments are given in the XLink and the target has no arguments.
  • 3 - if both instances have no arguments, or
    • if both instances have arguments, and the ones in the linkArgs are a subset, or one or more of the arguments are only partly given.
  • 4 if both instances have arguments provided and they match exactly. (This includes a given empty pair of brackets "()" on parameterless functions.) If each argument matches entirely, 3 is returned. This indicates to the caller that the arguments should be displayed in the XLink.

Definition at line 208 of file target.cpp.

◆ PARSE()

Target::FunctionArguments * dxl::Target::FunctionArguments::PARSE ( alib::MonoAllocator & ma,
alib::Substring & parser )
static

Static method to parse an instance of this type from the given src and allocate the instance and its argument list in the given ma

Parameters
maThe mono allocator to use.
parserThe substring used for parsing. The round brackets and their contents are removed when the method returns.
Returns
The instance created and parsed. If a syntax error occurs, nullptr is returned.

Definition at line 28 of file target.cpp.

◆ Print()

void dxl::Target::FunctionArguments::Print ( alib::AString & dest)

Prints the parsed argument types in a standardized format.

Parameters
destThe destination string. The string is not cleared.

Definition at line 17 of file target.cpp.


The documentation for this struct was generated from the following files: