ALib C++ Library
Library Version: 2412 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:

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

Function Details:

◆ CBFormat()

ALIB_API Box 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()

ALIB_API Box 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 plugins::AutoCast.
Parameters
scopeThe scope.
argsThe single argument.
Returns
The boxed result string, allocated inside the scope's mono allocator.

◆ ToBoolean()

ALIB_API Box 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 plugins::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 plugins::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.