Adaptive Framework
0.9.0
|
miscellaneous adaptive functions.
const afw_value_t* afw_function_execute_annotate | ( | afw_function_execute_t * | x | ) |
Adaptive Function annotate
x | function execute parameter. |
Create an annotated value.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
annotation - (object AdaptiveAnnotation) Annotation for value.
value - (any dataType) Any value. This value will not be evaluated.
Returns:
(any dataType) Unevaluated annotated value ready for use by function evaluate().
Definition at line 51 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_compare_uri | ( | afw_function_execute_t * | x | ) |
Adaptive Function compare_uri
x | function execute parameter. |
Compare two URIs.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
uri1 - (string) First URI for compare. This URI can not contain an asterisk ("*").
uri2 - (string) Second URI for compare. This URI can contain asterisk ("*") for substitution if isValuePath is true and currentPath2 is specified.
isValuePath - (optional boolean) The URIs are adaptive value paths. If one of the URIs begins with a single slash "/", both must, and each URI will be parsed as an adaptive value path (example: /adaptorId/objectType/objectId.propertyNames).
currentPath - (optional string) If isValuePath is true, this is the current path that is used to resolve a relative path in the URIs. If isValuePath is not true, this parameter is ignored.
Returns:
(boolean) Result of comparison.
Definition at line 113 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_debug | ( | afw_function_execute_t * | x | ) |
Adaptive Function debug
x | function execute parameter. |
Conditionally, based on the detail parameter, write a value as a string to the debug file descriptor (usually stderr).
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
value - (any dataType) This is the value that will be converted to its string representation and written. An undefined value is represented by <undefined>
.
detail - (optional boolean) If true, the string will only written if the debug:function_active:detail flag is on. If false or not specified, the string will only written if the debug:function_active flag is on.
Returns:
(null)
Definition at line 184 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_execution_start_time_local | ( | afw_function_execute_t * | x | ) |
Adaptive Function execution_start_time_local
x | function execute parameter. |
Return local dateTime when the execution context was created. This will usually be the start of request time.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(dateTime)
Definition at line 505 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_execution_start_time_utc | ( | afw_function_execute_t * | x | ) |
Adaptive Function execution_start_time_utc
x | function execute parameter. |
Return UTC dateTime when the execution context was created. This will usually be the start of request time.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(dateTime)
Definition at line 542 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_generate_uuid | ( | afw_function_execute_t * | x | ) |
Adaptive Function generate_uuid
x | function execute parameter. |
Generate a UUID.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(string)
Definition at line 239 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_is_defined | ( | afw_function_execute_t * | x | ) |
Adaptive Function is_defined
x | function execute parameter. |
Test value returning boolean True if it is not undefined.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
value - (any dataType) Value to check.
Returns:
(boolean) True if value is not undefined.
Definition at line 870 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_is_nullish | ( | afw_function_execute_t * | x | ) |
Adaptive Function is_nullish
x | function execute parameter. |
Test value returning boolean True if it is null or undefined.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
value - (any dataType) Value to check.
Returns:
(boolean) True if value is null or undefined.
Definition at line 829 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_log | ( | afw_function_execute_t * | x | ) |
Adaptive Function log
x | function execute parameter. |
Evaluate and convert value to String and log it.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
value - (any dataType) Value to log.
Returns:
(null)
Definition at line 280 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_now_local | ( | afw_function_execute_t * | x | ) |
Adaptive Function now_local
x | function execute parameter. |
Return current local dateTime.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(dateTime)
Definition at line 316 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_now_utc | ( | afw_function_execute_t * | x | ) |
Adaptive Function now_utc
x | function execute parameter. |
Return current UTC dateTime.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(dateTime)
Definition at line 351 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_nullish_coalescing | ( | afw_function_execute_t * | x | ) |
Adaptive Function nullish_coalescing
x | function execute parameter. |
Returns the first value of values that is not null or undefined leaving the remaining values unevaluated.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
values - (2 or more any dataType)
Returns:
(any dataType) The first value of values that is not null or undefined.
Definition at line 914 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_optional_chaining | ( | afw_function_execute_t * | x | ) |
Adaptive Function optional_chaining
x | function execute parameter. |
Returns undefined if arg1 is null or undefined without evaluating arg2, but otherwise returns evaluated value of arg2.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
arg1 - (any dataType)
arg2 - (any dataType)
Returns:
(any dataType) Undefined value if arg1 is null or undefined but otherwise evaluated arg2.
Definition at line 966 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_parse_uri | ( | afw_function_execute_t * | x | ) |
Adaptive Function parse_uri
x | function execute parameter. |
Parse a URI.
This function is pure, so it will always return the same result given exactly the same parameters and has no side effects.
Declaration:
Parameters:
uri - (string) URI to parse.
isValuePath - (optional boolean) The URI is an adaptive value path. If the path begins with a single slash "/", the URI will be parsed as an adaptive value path (example: /adaptorId/objectType/objectId.propertyNames).
currentPath - (optional string) If isValuePath is true, this is the current path that is used to resolve relative paths. If isValuePath is not true, this parameter is ignored.
Returns:
(object AdaptiveParsedURI) Object with results of parse.
Definition at line 399 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_perform | ( | afw_function_execute_t * | x | ) |
Adaptive Function perform
x | function execute parameter. |
Perform actions right away.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
request - (object AdaptiveActions) See /afw/_AdaptiveObjectType_/_AdaptiveActions_ for more information.
Returns:
(object AdaptiveResponse) Response object.
Definition at line 462 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_trace | ( | afw_function_execute_t * | x | ) |
Adaptive Function trace
x | function execute parameter. |
Write a value to a trace log.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
value - (any dataType) This is the value that will be converted to its string representation and written the trace log. An undefined value is represented by <undefined>
.
filter - (optional boolean) If this optional filter is false, nothing will be written to the trace log. The default is true.
number - (optional integer) This is an optional number between 1 and 8 that is appended to "trace" to identify the trace log. The default is 1.
Returns:
(null)
Definition at line 591 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_variable_exists | ( | afw_function_execute_t * | x | ) |
Adaptive Function variable_exists
x | function execute parameter. |
Return the true if the named variable exists.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
name - (string) Name of variable to check. The name can optionally be preceded with a qualifier followed by "::".
Returns:
(boolean) True if variable exists.
Definition at line 666 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_variable_get | ( | afw_function_execute_t * | x | ) |
Adaptive Function variable_get
x | function execute parameter. |
Return the value of a variable. If variable is not available, return a default or null value.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
name - (string) Name of variable to get. The name can optionally be preceded with a qualifier followed by "::".
defaultValue - (optional any dataType) The default value of variable if it does not exist in object. If not specified, null value is the default.
Returns:
(any dataType) Evaluated variable value or default.
Definition at line 721 of file afw_function_miscellaneous.c.
const afw_value_t* afw_function_execute_variable_is_not_null | ( | afw_function_execute_t * | x | ) |
Adaptive Function variable_is_not_null
x | function execute parameter. |
Return the true if the named variable exists and is not null.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
name - (string) Name of variable to check. The name can optionally be preceded with a qualifier followed by "::".
Returns:
(boolean) True if variable exists and is not null.
Definition at line 778 of file afw_function_miscellaneous.c.