SignDoc SDK (C)
5.0.0
|
Interface for an output stream, inspired by Java's java.io.OutputStream. More...
#include <SignDocSDK-c.h>
Interface for an output stream, inspired by Java's java.io.OutputStream.
struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithFile | ( | struct SIGNDOC_Exception ** | aEx, |
FILE * | aFile | ||
) |
SIGNDOC_FileOutputStream constructor: Write to a C stream.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aFile | The C stream to be wrapped. |
struct SIGNDOC_OutputStream * SIGNDOC_FileOutputStream_newWithFileAndPath | ( | struct SIGNDOC_Exception ** | aEx, |
FILE * | aFile, | ||
const char * | aPath | ||
) |
SIGNDOC_FileOutputStream constructor: Write to a C stream.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aFile | The C stream to be wrapped. |
[in] | aPath | The pathname (native encoding), used in exceptions, can be NULL. |
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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aPath | The 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. |
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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aPath | The name of the file to be opened. |
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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A 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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
size_t SIGNDOC_MemoryOutputStream_length | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_OutputStream * | aObj | ||
) |
Retrieve the length of the contents of a SIGNDOC_MemoryOutputStream.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
void SIGNDOC_OutputStream_close | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_OutputStream * | aObj | ||
) |
Close a SIGNDOC_OutputStream.
Does not destroy the SIGNDOC_OutputStream object.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
void SIGNDOC_OutputStream_delete | ( | struct SIGNDOC_OutputStream * | aObj | ) |
SIGNDOC_OutputStream destructor.
[in] | aObj | A 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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A 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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
[in] | aPos | The 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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_OutputStream object. |
[in] | aSrc | Pointer to buffer to be written. |
[in] | aLen | Number 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.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aClosure | A pointer to user-defined object that will be passed to the callbacks. |
[in] | aClose | Pointer to function implementing close(). |
[in] | aFlush | Pointer to function implementing flush(). |
[in] | aWrite | Pointer to function implementing write(). |
[in] | aSeek | Pointer to function implementing seek(). |
[in] | aTell | Pointer to function implementing tell(). |