The CSR API for a CSR Business Document Attachment object.
More...
|
typedef struct _sbr_DocA | sbr_DocA |
| The CSR Business Document Attachment object. More...
|
|
The CSR API for a CSR Business Document Attachment object.
◆ sbr_DocA
The CSR Business Document Attachment object.
Used when adding business documents to a request for submission to CSR - see also sbr_Request. Used when extracting business documents from a response - see also sbr_Response.
◆ sbr_doca_iid()
SBR_CSR_EXPORT const char * sbr_doca_iid |
( |
sbr_DocA * |
attachment | ) |
|
Return the unique id for the Attachment - this is a memory only value.
- Parameters
-
- Returns
- unique id.
◆ sbr_doca_content()
Return the attachment content as base64 within an ato_String.
To access the content, use ato_str_value() and ato_str_len().
See also the utility methods ato_base64encode()/ato_base64decode() to convert binary to base64 and back.
- Parameters
-
attachment | the Attachment. |
- Returns
- attachment content or NULL if none.
◆ sbr_doca_contenttype()
SBR_CSR_EXPORT const char * sbr_doca_contenttype |
( |
sbr_DocA * |
attachment | ) |
|
Return the contenttype.
- Parameters
-
attachment | the Attachment. |
- Returns
- the contenttype.
◆ sbr_doca_description()
SBR_CSR_EXPORT const char * sbr_doca_description |
( |
sbr_DocA * |
attachment | ) |
|
Return the description.
- Parameters
-
attachment | the Attachment. |
- Returns
- the description.
◆ sbr_doca_filename()
SBR_CSR_EXPORT const char * sbr_doca_filename |
( |
sbr_DocA * |
attachment | ) |
|
Return the filename.
- Parameters
-
attachment | the Attachment. |
- Returns
- the filename.
◆ sbr_doca_sequencenr()
SBR_CSR_EXPORT size_t sbr_doca_sequencenr |
( |
sbr_DocA * |
attachment | ) |
|
Return the sequence number (starting at 1) of the attachment within the document.
- Parameters
-
attachment | the Attachment. |
- Returns
- the sequence number.
◆ sbr_doca_msgsourcetype()
Return whether the attachment is within a sbr_Request or sbr_Response.
- Parameters
-
attachment | the Attachment. |
- Returns
- SBR_MSG_RESPONSE or SBR_MSG_REQUEST.
◆ sbr_doca_setcontent()
Set the content of an attachment in a Request document.
See also the utility methods: ato_base64encode_array()/ato_base64decode_array() to convert binary to base64 and back; and ato_str_create() to wrap char[] in an ato_String object if required.
- Parameters
-
ctx | the current thread local Context. |
attachment | the Document Attachment. |
content | the base64 content of the attachment as an ato_String (e.g. the PDF itself). |
contentaction | tells the attachment object what to do with the content. ATO_PARAMACTION_DEFAULT or ATO_PARAMACTION_COPY will cause a copy to be taken. ATO_PARAMACTION_CONST will cause content to be referenced directly and not touched in any way - the caller must maintain until the attachment is freed. ATO_PARAMACTION_FREE will cause content to be referenced directly and will be freed when the attachment is freed (i.e. the attachment object takes "ownership" of the content). |
- Returns
- ATO_ERR_OK if successful or an errorcode OR -1 if the call is ignored (SBR_RESPONSE sbdm).
◆ sbr_doca_setdescription()
SBR_CSR_EXPORT int sbr_doca_setdescription |
( |
ato_Ctx * |
ctx, |
|
|
sbr_DocA * |
attachment, |
|
|
const char * |
description |
|
) |
| |
Set the content of an attachment in a Request document.
- Parameters
-
ctx | the current thread local Context. |
attachment | the Document Attachment. |
description | the description of the attachment (e.g. the PDF itself) |
- Returns
- ATO_ERR_OK if successful or an errorcode OR -1 if the call is ignored (SBR_RESPONSE sbdm).
◆ sbr_doca_setfilename()
SBR_CSR_EXPORT int sbr_doca_setfilename |
( |
ato_Ctx * |
ctx, |
|
|
sbr_DocA * |
attachment, |
|
|
const char * |
filename |
|
) |
| |
Set the filename of an attachment in a Request document.
- Parameters
-
ctx | the current thread local Context. |
attachment | the Document Attachment. |
filename | the filename of the attachment (e.g. the PDF itself) |
- Returns
- ATO_ERR_OK if successful or an errorcode OR -1 if the call is ignored (SBR_RESPONSE sbdm).
◆ sbr_doca_setcontenttype()
SBR_CSR_EXPORT int sbr_doca_setcontenttype |
( |
ato_Ctx * |
ctx, |
|
|
sbr_DocA * |
attachment, |
|
|
const char * |
contenttype |
|
) |
| |
Set the contenttype of an attachment in a Request document.
- Parameters
-
ctx | the current thread local Context. |
attachment | the Document Attachment. |
contenttype | the contenttype of the attachment |
- Returns
- ATO_ERR_OK if successful or an errorcode OR -1 if the call is ignored (SBR_RESPONSE sbdm).