SignDoc SDK (C)  5.0.0
SIGNDOC_OutputStream Class Reference

Interface for an output stream, inspired by Java's java.io.OutputStream. More...

#include <SignDocSDK-c.h>

Public Member Functions

struct SIGNDOC_OutputStreamSIGNDOC_FileOutputStream_newWithFile (struct SIGNDOC_Exception **aEx, FILE *aFile)
 SIGNDOC_FileOutputStream constructor: Write to a C stream. More...
 
struct SIGNDOC_OutputStreamSIGNDOC_FileOutputStream_newWithFileAndPath (struct SIGNDOC_Exception **aEx, FILE *aFile, const char *aPath)
 SIGNDOC_FileOutputStream constructor: Write to a C stream. More...
 
struct SIGNDOC_OutputStreamSIGNDOC_FileOutputStream_newWithPath (struct SIGNDOC_Exception **aEx, const char *aPath)
 SIGNDOC_FileOutputStream constructor: Open a file in binary mode. More...
 
struct SIGNDOC_OutputStreamSIGNDOC_FileOutputStream_newWithPathW (struct SIGNDOC_Exception **aEx, const wchar_t *aPath)
 SIGNDOC_FileOutputStream constructor: Open a file in binary mode. More...
 
struct SIGNDOC_OutputStreamSIGNDOC_UserOutputStream_new (struct SIGNDOC_Exception **aEx, void *aClosure, SIGNDOC_UserOutputStream_close aClose, SIGNDOC_UserOutputStream_flush aFlush, SIGNDOC_UserOutputStream_write aWrite, SIGNDOC_UserOutputStream_seek aSeek, SIGNDOC_UserOutputStream_tell aTell)
 SIGNDOC_UserOutputStream constructor. More...
 
struct SIGNDOC_OutputStreamSIGNDOC_MemoryOutputStream_new (struct SIGNDOC_Exception **aEx)
 SIGNDOC_MemoryOutputStream constructor. More...
 
const unsigned char * SIGNDOC_MemoryOutputStream_data (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Retrieve a pointer to the contents of a SIGNDOC_MemoryOutputStream. More...
 
size_t SIGNDOC_MemoryOutputStream_length (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Retrieve the length of the contents of a SIGNDOC_MemoryOutputStream. More...
 
void SIGNDOC_MemoryOutputStream_clear (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Clear the buffered data of a SIGNDOC_MemoryOutputStream. More...
 
void SIGNDOC_OutputStream_delete (struct SIGNDOC_OutputStream *aObj)
 SIGNDOC_OutputStream destructor. More...
 
void SIGNDOC_OutputStream_close (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Close a SIGNDOC_OutputStream. More...
 
void SIGNDOC_OutputStream_flush (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Flush a SIGNDOC_OutputStream. More...
 
void SIGNDOC_OutputStream_seek (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj, int aPos)
 Seek to the specified position in a SIGNDOC_OutputStream. More...
 
int SIGNDOC_OutputStream_tell (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj)
 Retrieve the current position of a SIGNDOC_OutputStream. More...
 
void SIGNDOC_OutputStream_write (struct SIGNDOC_Exception **aEx, struct SIGNDOC_OutputStream *aObj, const void *aSrc, int aLen)
 Write octets to a SIGNDOC_OutputStream. More...
 

Detailed Description

Interface for an output stream, inspired by Java's java.io.OutputStream.

Member Function Documentation

struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithFile ( struct SIGNDOC_Exception **  aEx,
FILE *  aFile 
)

SIGNDOC_FileOutputStream constructor: Write to a C stream.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aFileThe C stream to be wrapped.
Returns
A pointer to a new SIGNDOC_FileOutputStream object or NULL on error.
struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithFileAndPath ( struct SIGNDOC_Exception **  aEx,
FILE *  aFile,
const char *  aPath 
)

SIGNDOC_FileOutputStream constructor: Write to a C stream.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aFileThe C stream to be wrapped.
[in]aPathThe pathname (native encoding), used in exceptions, can be NULL.
Returns
A pointer to a new SIGNDOC_FileOutputStream object or NULL on error.
struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithPath ( struct SIGNDOC_Exception **  aEx,
const char *  aPath 
)

SIGNDOC_FileOutputStream constructor: Open a file in binary mode.

If the named file already exists, it will be truncated.

Throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO on error.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aPathThe name of the file to be opened (native encoding). See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
A pointer to a new SIGNDOC_FileOutputStream object or NULL on error.
struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithPathW ( struct SIGNDOC_Exception **  aEx,
const wchar_t *  aPath 
)

SIGNDOC_FileOutputStream constructor: Open a file in binary mode.

If the named file already exists, it will be truncated.

Throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO on error.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aPathThe name of the file to be opened.
Returns
A pointer to a new SIGNDOC_FileOutputStream object or NULL on error.
void SIGNDOC_MemoryOutputStream_clear ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Clear the buffered data of a SIGNDOC_MemoryOutputStream.

The buffer will be empty and the current position will be zero.

The buffer may or may not be deallocated.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
const unsigned char * SIGNDOC_MemoryOutputStream_data ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Retrieve a pointer to the contents of a SIGNDOC_MemoryOutputStream.

Note that the returned pointer is only valid up to the next output to the stream.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
Returns
Pointer to the first octet of the stream contents.
size_t SIGNDOC_MemoryOutputStream_length ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Retrieve the length of the contents of a SIGNDOC_MemoryOutputStream.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
Returns
Number of octets.
struct SIGNDOC_OutputStream * SIGNDOC_MemoryOutputStream_new ( struct SIGNDOC_Exception **  aEx)

SIGNDOC_MemoryOutputStream constructor.

Create a new SIGNDOC_OutputStream object which writes to memory, allocating memory as needed.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
Returns
A pointer to a new SIGNDOC_OutputStream object or NULL on error.
void SIGNDOC_OutputStream_close ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Close a SIGNDOC_OutputStream.

Does not destroy the SIGNDOC_OutputStream object.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
void SIGNDOC_OutputStream_delete ( struct SIGNDOC_OutputStream aObj)

SIGNDOC_OutputStream destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_OutputStream object.
void SIGNDOC_OutputStream_flush ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Flush a SIGNDOC_OutputStream.

This function forces any buffered data to be written.

Throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO on error.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
void SIGNDOC_OutputStream_seek ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj,
int  aPos 
)

Seek to the specified position in a SIGNDOC_OutputStream.

Throws an exception (type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO) if the position is invalid or if seeking is not supported.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
[in]aPosThe position (zero being the first octet).
int SIGNDOC_OutputStream_tell ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj 
)

Retrieve the current position of a SIGNDOC_OutputStream.

Throws an exception (type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO) if seeking is not supported or if the position cannot be represented as non-negative int.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
Returns
The current position (zero being the first octet)
void SIGNDOC_OutputStream_write ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_OutputStream aObj,
const void *  aSrc,
int  aLen 
)

Write octets to a SIGNDOC_OutputStream.

Throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO on error.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_OutputStream object.
[in]aSrcPointer to buffer to be written.
[in]aLenNumber of octets to write.
struct SIGNDOC_OutputStream * SIGNDOC_UserOutputStream_new ( struct SIGNDOC_Exception **  aEx,
void *  aClosure,
SIGNDOC_UserOutputStream_close  aClose,
SIGNDOC_UserOutputStream_flush  aFlush,
SIGNDOC_UserOutputStream_write  aWrite,
SIGNDOC_UserOutputStream_seek  aSeek,
SIGNDOC_UserOutputStream_tell  aTell 
)

SIGNDOC_UserOutputStream constructor.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aClosureA pointer to user-defined object that will be passed to the callbacks.
[in]aClosePointer to function implementing close().
[in]aFlushPointer to function implementing flush().
[in]aWritePointer to function implementing write().
[in]aSeekPointer to function implementing seek().
[in]aTellPointer to function implementing tell().
Returns
A pointer to a new SIGNDOC_OutputStream object or NULL on error.

The documentation for this class was generated from the following file: