Adaptive Framework
0.9.0
|
stream adaptive functions.
const afw_value_t* afw_function_execute_close | ( | afw_function_execute_t * | x | ) |
Adaptive Function close
x | function execute parameter. |
This will close an open stream
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) The streamNumber for the stream to close.
Returns:
(null)
Definition at line 354 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_flush | ( | afw_function_execute_t * | x | ) |
Adaptive Function flush
x | function execute parameter. |
Write the content of the stream's buffers to its destination.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) The streamNumber for the stream to flush.
Returns:
(null)
Definition at line 47 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_get_stream_error | ( | afw_function_execute_t * | x | ) |
Adaptive Function get_stream_error
x | function execute parameter. |
Get the most recent stream error.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
Returns:
(string) The most recent stream error.
Definition at line 401 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_open_file | ( | afw_function_execute_t * | x | ) |
Adaptive Function open_file
x | function execute parameter. |
This will open a file stream.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamId - (string) This is the streamId that will be associated with this open file stream.
path - (string) This is the path to the file to open. The rootDirectory of the path is defined in the application object.
mode - (string) This is the access mode string. Values can be: r - Open an existing file text file for read. w - Open a text file for writing. If the file does not exist, it will be created. a - Open a text file for writing additional data to the end. If the file does not exist, it will be created. r+ - Open a text file for both reading and writing. w+ - Open a text file for both reading and writing. If the file exists, it will be overwritten. If the file does not exist, it will be created. a+ - Open a text file for both reading and writing. Reading will begin at the start of the file while writing will be appended to the end.
All of these modes expect data type string. If you are using data type base64Binary or hexBinary you can use corresponding binary modes, "rb", "wb", "ab", "rb+", "r+b", "wb+", "w+b", "ab+", and "a+b".
autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.
Returns:
(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.
Definition at line 473 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_open_response | ( | afw_function_execute_t * | x | ) |
Adaptive Function open_response
x | function execute parameter. |
This will open a response text write-only stream that will be written to the http response.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamId - (string) This is the streamId that will be associated with this open response stream.
autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.
Returns:
(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.
Definition at line 552 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_open_uri | ( | afw_function_execute_t * | x | ) |
Adaptive Function open_uri
x | function execute parameter. |
This will open a read or write stream for a URI.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamId - (string) This is the streamId that will be associated with this open URI stream.
uri - (string) This is the URI of the stream to open.
mode - (string) This is the access mode string. Values can be "r" for read or "w" for write.
autoFlush - (optional boolean) If specified and true, this will automatically flush the stream's buffers after every write.
Returns:
(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.
Definition at line 624 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_print | ( | afw_function_execute_t * | x | ) |
Adaptive Function print
x | function execute parameter. |
Evaluate and convert 0 or more values to its string value, then write them to stdout. An undefined value is represented by <undefined>
.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
values - (0 or more any dataType) Values to print.
Returns:
(null)
Definition at line 98 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_println | ( | afw_function_execute_t * | x | ) |
Adaptive Function println
x | function execute parameter. |
Evaluate and convert 0 or more values to their string value, then write them to stdout. A newline character ('
') is written after the last value. An undefined value is represented by <undefined>
.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
value - (0 or more any dataType) Values to print.
Returns:
(null)
Definition at line 157 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_read | ( | afw_function_execute_t * | x | ) |
Adaptive Function read
x | function execute parameter. |
Read a UTF-8 text stream up to a specified number of octets. The stream must contain valid UTF-8 or an error is thrown.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) Stream number.
n - (any dataType) The maximum number of octets to read.
Returns:
(string) The UTF-8 string read. Check the size of this value to determine the actual number of octets read.
Definition at line 667 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_read_to_base64Binary | ( | afw_function_execute_t * | x | ) |
Adaptive Function read_to_base64Binary
x | function execute parameter. |
Read a stream up to a specified number of octets. The result will be the internal memory of a base64Binary value.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) Stream number.
n - (any dataType) The maximum number of octets to read.
Returns:
(base64Binary) The base64Binary value read. Check the size of this value to determine the actual number of octets read.
Definition at line 710 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_read_to_hexBinary | ( | afw_function_execute_t * | x | ) |
Adaptive Function read_to_hexBinary
x | function execute parameter. |
Read a stream up to a specified number of octets. The result will be the internal memory of a hexBinary value.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) Stream number.
n - (any dataType) The maximum number of octets to read.
Returns:
(hexBinary) The hexBinary value read. Check the size of this value to determine the actual number of octets read.
Definition at line 753 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_readln | ( | afw_function_execute_t * | x | ) |
Adaptive Function readln
x | function execute parameter. |
Read a UTF-8 text stream line. The stream must contain valid UTF-8 or an error is thrown.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) Stream number.
Returns:
(string) The UTF-8 string read.
Definition at line 792 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_stream | ( | afw_function_execute_t * | x | ) |
Adaptive Function stream
x | function execute parameter. |
This will return the streamNumber for a streamId. This function useful to obtain the number of the automatically opened standard streams "console", "stderr" and "stdout" as well and any other open stream.
This function is not pure, so it may return a different result given exactly the same parameters.
Declaration:
Parameters:
streamId - (string) The id of a stream.
Returns:
(integer) The streamNumber for the streamId or -1 if there was an error. Use get_stream_error() for error information.
Definition at line 833 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_write | ( | afw_function_execute_t * | x | ) |
Adaptive Function write
x | function execute parameter. |
Evaluate and convert 0 or more values to its string value, then write them to stream. An value with an undefined value is represented by <undefined>
.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) The streamNumber for the stream to write.
value - (0 or more any) Values to write as their string value.
Returns:
(null)
Definition at line 219 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_write_internal | ( | afw_function_execute_t * | x | ) |
Adaptive Function write_internal
x | function execute parameter. |
Write a value's internal memory. This is especially useful for writing data type base64Binary and hexBinary.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) The streamNumber for the stream to write.
value - (any) The internal memory of this value is written.
Returns:
(null)
Definition at line 889 of file afw_function_stream.c.
const afw_value_t* afw_function_execute_writeln | ( | afw_function_execute_t * | x | ) |
Adaptive Function writeln
x | function execute parameter. |
Evaluate and convert 0 or more values to its string value, then write them to stream. A newline character ('
') is written after the last value. An undefined value is represented by <undefined>
.
This function is not pure, so it may return a different result given exactly the same parameters and has side effects.
Declaration:
Parameters:
streamNumber - (integer) The streamNumber for the stream to write.
value - (0 or more any dataType) Values to write.
Returns:
(null)
Definition at line 289 of file afw_function_stream.c.