![]() |
SignDoc SDK (C)
5.0.0
|
Interface for an input stream, inspired by Java's java.io.InputStream. More...
#include <SignDocSDK-c.h>
Public Member Functions | |
struct SIGNDOC_InputStream * | SIGNDOC_FileInputStream_newWithFile (struct SIGNDOC_Exception **aEx, FILE *aFile) |
SIGNDOC_FileInputStream constructor: Read from a C stream. More... | |
struct SIGNDOC_InputStream * | SIGNDOC_FileInputStream_newWithFileAndPath (struct SIGNDOC_Exception **aEx, FILE *aFile, const char *aPath) |
SIGNDOC_FileInputStream constructor: Read from a C stream. More... | |
struct SIGNDOC_InputStream * | SIGNDOC_FileInputStream_newWithPath (struct SIGNDOC_Exception **aEx, const char *aPath) |
SIGNDOC_FileInputStream constructor: Open a file in binary mode. More... | |
struct SIGNDOC_InputStream * | SIGNDOC_FileInputStream_newWithPathW (struct SIGNDOC_Exception **aEx, const wchar_t *aPath) |
SIGNDOC_FileInputStream constructor: Open a file in binary mode. More... | |
struct SIGNDOC_InputStream * | SIGNDOC_UserInputStream_new (struct SIGNDOC_Exception **aEx, void *aClosure, SIGNDOC_UserInputStream_close aClose, SIGNDOC_UserInputStream_read aRead, SIGNDOC_UserInputStream_seek aSeek, SIGNDOC_UserInputStream_tell aTell, SIGNDOC_UserInputStream_getAvailable aGetAvailable) |
SIGNDOC_UserInputStream constructor. More... | |
void | SIGNDOC_InputStream_delete (struct SIGNDOC_InputStream *aObj) |
SIGNDOC_InputStream destructor. More... | |
int | SIGNDOC_InputStream_read (struct SIGNDOC_Exception **aEx, struct SIGNDOC_InputStream *aObj, void *aDst, int aLen) |
Read octets from a SIGNDOC_InputStream. More... | |
void | SIGNDOC_InputStream_close (struct SIGNDOC_Exception **aEx, struct SIGNDOC_InputStream *aObj) |
Close a SIGNDOC_InputStream. More... | |
void | SIGNDOC_InputStream_seek (struct SIGNDOC_Exception **aEx, struct SIGNDOC_InputStream *aObj, int aPos) |
Seek to the specified position in a SIGNDOC_InputStream. More... | |
int | SIGNDOC_InputStream_tell (struct SIGNDOC_Exception **aEx, struct SIGNDOC_InputStream *aObj) |
Retrieve the current position of a SIGNDOC_InputStream. More... | |
int | SIGNDOC_InputStream_getAvailable (struct SIGNDOC_Exception **aEx, struct SIGNDOC_InputStream *aObj) |
Get an estimate of the number of octets available for reading from a SIGNDOC_InputStream. More... | |
struct SIGNDOC_InputStream * | SIGNDOC_MemoryInputStream_new (struct SIGNDOC_Exception **aEx, const unsigned char *aSrc, size_t aLen) |
SIGNDOC_MemoryInputStream constructor. More... | |
Interface for an input stream, inspired by Java's java.io.InputStream.
struct SIGNDOC_InputStream * SIGNDOC_FileInputStream_newWithFile | ( | struct SIGNDOC_Exception ** | aEx, |
FILE * | aFile | ||
) |
SIGNDOC_FileInputStream constructor: Read from 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_InputStream * SIGNDOC_FileInputStream_newWithFileAndPath | ( | struct SIGNDOC_Exception ** | aEx, |
FILE * | aFile, | ||
const char * | aPath | ||
) |
SIGNDOC_FileInputStream constructor: Read from 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. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps. |
struct SIGNDOC_InputStream * SIGNDOC_FileInputStream_newWithPath | ( | struct SIGNDOC_Exception ** | aEx, |
const char * | aPath | ||
) |
SIGNDOC_FileInputStream constructor: Open a file in binary mode.
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_InputStream * SIGNDOC_FileInputStream_newWithPathW | ( | struct SIGNDOC_Exception ** | aEx, |
const wchar_t * | aPath | ||
) |
SIGNDOC_FileInputStream constructor: Open a file in binary mode.
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_InputStream_close | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_InputStream * | aObj | ||
) |
Close a SIGNDOC_InputStream.
Does not destroy the SIGNDOC_InputStream object.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_InputStream object. |
void SIGNDOC_InputStream_delete | ( | struct SIGNDOC_InputStream * | aObj | ) |
SIGNDOC_InputStream destructor.
[in] | aObj | A pointer to the SIGNDOC_InputStream object. |
int SIGNDOC_InputStream_getAvailable | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_InputStream * | aObj | ||
) |
Get an estimate of the number of octets available for reading from a SIGNDOC_InputStream.
Throws an exception (type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO) if this function 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_InputStream object. |
int SIGNDOC_InputStream_read | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_InputStream * | aObj, | ||
void * | aDst, | ||
int | aLen | ||
) |
Read octets from a SIGNDOC_InputStream.
May throw an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_IO.
Once this function has returned a value smaller than aLen, end of input has been reached and further calls should return 0.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aObj | A pointer to the SIGNDOC_InputStream object. |
[out] | aDst | Pointer to buffer to be filled. |
[in] | aLen | Number of octets to read. |
void SIGNDOC_InputStream_seek | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_InputStream * | aObj, | ||
int | aPos | ||
) |
Seek to the specified position in a SIGNDOC_InputStream.
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_InputStream object. |
[in] | aPos | The position (zero being the first octet). |
int SIGNDOC_InputStream_tell | ( | struct SIGNDOC_Exception ** | aEx, |
struct SIGNDOC_InputStream * | aObj | ||
) |
Retrieve the current position of a SIGNDOC_InputStream.
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_InputStream object. |
struct SIGNDOC_InputStream * SIGNDOC_MemoryInputStream_new | ( | struct SIGNDOC_Exception ** | aEx, |
const unsigned char * | aSrc, | ||
size_t | aLen | ||
) |
SIGNDOC_MemoryInputStream constructor.
Read from the buffer pointed to by aSrc. Note that the buffer contents won't be copied, therefore the buffer must remain valid throughout the use of this object.
[out] | aEx | Any exception will be returned in the object pointed to by this parameter. |
[in] | aSrc | Points to the stream contents. |
[in] | aLen | Size of the stream contents. |
struct SIGNDOC_InputStream * SIGNDOC_UserInputStream_new | ( | struct SIGNDOC_Exception ** | aEx, |
void * | aClosure, | ||
SIGNDOC_UserInputStream_close | aClose, | ||
SIGNDOC_UserInputStream_read | aRead, | ||
SIGNDOC_UserInputStream_seek | aSeek, | ||
SIGNDOC_UserInputStream_tell | aTell, | ||
SIGNDOC_UserInputStream_getAvailable | aGetAvailable | ||
) |
SIGNDOC_UserInputStream 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] | aRead | Pointer to function implementing read(). |
[in] | aSeek | Pointer to function implementing seek(). |
[in] | aTell | Pointer to function implementing tell(). |
[in] | aGetAvailable | Pointer to function implementing getAvailable(). |