RecAPI
Classes | Typedefs | Functions
Input/output Stream Handling Module
KernelAPI

API for handling input and output files through memory or other non-standard I/O devices. Supported on: Windows. More...

Classes

struct   _R_IOStreamfuncs
  Container structure of the IOStream callback functions. More...

Typedefs

typedef struct _R_IOStreamfuncs  R_IOStreamfuncs
  Container structure of the IOStream callback functions.

Functions

RECERR RECAPIKRN  kRecSetIOStreamCB (R_IOStreamfuncs *api)
  IOStream.

Detailed Description

API for handling input and output files through memory or other non-standard I/O devices. Supported on: Windows.


Typedef Documentation

Container structure of the IOStream callback functions.

streamname is UTF8 in open/access/is_stream

Note:
I/O Stream Handling Module is supported on: Windows.
See kRecSetIOStreamCB

Function Documentation

RECERR RECAPIKRN kRecSetIOStreamCB ( R_IOStreamfuncs api )

IOStream.

This function sets the application callback API for streaming IO.

Parameters:
[in] api Pointer to the R_IOStreamfuncs structure containing callback functions. Must be provided and implemented by the application. NULL to turn off the callback mechanism.
Note:
I/O Stream Handling Module is supported on: Windows.
After the IOStream API has been set, all CSDK file opens are hooked and the callback R_IOStreamfuncs::ropen_stream is called first. If the actual file does not belong to the application, the ropen_stream must return NOT_APPLICATION_STREAM in the stream parameter. Otherwise application should set a unique ID in stream. Use simple strings to name and identify the application handled streams. Your generated ID will be passed to other callbacks. These IDs should be mapped to handler objects inside your application. Return errno compatible error code when your stream has open error.
See Samples\C_API\Sample71.cpp for a sample implementation of the usage of the IOStream API on RECAPI.
For .NET application Objects API sample #71 (Samples\CSClassSamples\Sample71.cs) contains a worked out sample solution.
In .NET both FileStream and MemoryStream are directly supported as well as byte[] objects. These standard streams can be set using IOStreamCB.SetStream("userStreamName", Stream or byte[]) Any other non standard IO has to be completely implemented in the callbacks by the application.
The specification of this function in Java is:
 int kRecSetIOStreamCB(IOStreamCallbacks iosCB)