ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::plugins Namespace Reference

Description:

This inner namespace of module ALib Expressions contains the implementations of built-in compiler plug-ins.

In addition, helper-class Calculus is defined here, which is the foundation for most of the built-in functionality.

It is strongly recommended to use this helper-class for the creation of custom compiler plug-ins instead of deriving such from class CompilerPlugin directly.

Note
Sibling ALib module ALib Files, provides a compiler plug-in dedicated to file and directory trees.

Type Index:

struct  Arithmetics
struct  AutoCast
struct  Calculus
struct  DateAndTime
struct  ElvisOperator
struct  Math
struct  Strings

Function Index:

Box CBFormat (Scope &scope, ArgIterator args, ArgIterator)
Box CBToString (Scope &scope, ArgIterator args, ArgIterator)
Box ToBoolean (Scope &scope, ArgIterator args, ArgIterator)

Function Details:

◆ CBFormat()

Box alib::expressions::plugins::CBFormat ( Scope & scope,
ArgIterator args,
ArgIterator  )

This is the callback method for string function Format(...), which formats an arbitrary number of arguments according to a given format string.

The function is compile-time invokable.

Note
As an exception to the rule, this function is not defined in an anonymous namespace, but exposed through the C++ header-file of this struct. The rationale for this is that the function this way can be called by other plug-ins as well.
Parameters
scopeThe scope.
argsThe single argument.
Returns
The boxed result string, allocated inside the scope's mono allocator.

◆ CBToString()

Box alib::expressions::plugins::CBToString ( Scope & scope,
ArgIterator args,
ArgIterator  )

This is the callback method for string function String(...), which converts an arbitrary number of arguments of arbitrary types to a concatenated string.

The function is compile-time invokable.

Note
As an exception to the rule, this function is not defined in an anonymous namespace, but exposed through the C++ header-file of this struct. The rationale for this is that the function is also used for auto-casting custom types to strings, which is performed with compiler plug-in AutoCast.
Parameters
scopeThe scope.
argsThe single argument.
Returns
The boxed result string, allocated inside the scope's mono allocator.

◆ ToBoolean()

Box alib::expressions::plugins::ToBoolean ( Scope & scope,
ArgIterator args,
ArgIterator  )

This is the callback method for function Boolean, which converts arbitrary types to boolean values. As an exception to the rule, this function is not defined in an anonymous namespace, but exposed through the header of struct Arithmetics. The rationale for this is that the function is also used for auto-casting custom types to boolean values, which is performed with compiler plug-in AutoCast.

The function is compile-time invokable and uses box-function FIsTrue to determine if a boxed value represents true or false.

Parameters
scopeThe scope.
argsThe single argument.
Returns
The boxed boolean result.