sbrcsr 3.2.0
ATOMAS sbrcsr
The Business Document Attachment

The CSR API for a CSR Business Document Attachment object. More...

Typedefs

typedef struct _sbr_DocA sbr_DocA
 The CSR Business Document Attachment object. More...
 

Functions

SBR_CSR_EXPORT const char * sbr_doca_iid (sbr_DocA *attachment)
 Return the unique id for the Attachment - this is a memory only value. More...
 
SBR_CSR_EXPORT ato_Stringsbr_doca_content (sbr_DocA *attachment)
 Return the attachment content as base64 within an ato_String. More...
 
SBR_CSR_EXPORT const char * sbr_doca_contenttype (sbr_DocA *attachment)
 Return the contenttype. More...
 
SBR_CSR_EXPORT const char * sbr_doca_description (sbr_DocA *attachment)
 Return the description. More...
 
SBR_CSR_EXPORT const char * sbr_doca_filename (sbr_DocA *attachment)
 Return the filename. More...
 
SBR_CSR_EXPORT size_t sbr_doca_sequencenr (sbr_DocA *attachment)
 Return the sequence number (starting at 1) of the attachment within the document. More...
 
SBR_CSR_EXPORT sbr_eMsgSourceType sbr_doca_msgsourcetype (sbr_DocA *attachment)
 Return whether the attachment is within a sbr_Request or sbr_Response. More...
 
SBR_CSR_EXPORT int sbr_doca_setcontent (ato_Ctx *ctx, sbr_DocA *attachment, ato_String *content, ato_eParamAction contentaction)
 Set the content of an attachment in a Request document. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

The CSR API for a CSR Business Document Attachment object.

Typedef Documentation

◆ sbr_DocA

typedef struct _sbr_DocA 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.

Function Documentation

◆ 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
attachmentthe Attachment
Returns
unique id.

◆ sbr_doca_content()

SBR_CSR_EXPORT ato_String * sbr_doca_content ( sbr_DocA attachment)

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
attachmentthe 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
attachmentthe Attachment.
Returns
the contenttype.

◆ sbr_doca_description()

SBR_CSR_EXPORT const char * sbr_doca_description ( sbr_DocA attachment)

Return the description.

Parameters
attachmentthe Attachment.
Returns
the description.

◆ sbr_doca_filename()

SBR_CSR_EXPORT const char * sbr_doca_filename ( sbr_DocA attachment)

Return the filename.

Parameters
attachmentthe 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
attachmentthe Attachment.
Returns
the sequence number.

◆ sbr_doca_msgsourcetype()

SBR_CSR_EXPORT sbr_eMsgSourceType sbr_doca_msgsourcetype ( sbr_DocA attachment)

Return whether the attachment is within a sbr_Request or sbr_Response.

Parameters
attachmentthe Attachment.
Returns
SBR_MSG_RESPONSE or SBR_MSG_REQUEST.

◆ sbr_doca_setcontent()

SBR_CSR_EXPORT int sbr_doca_setcontent ( ato_Ctx ctx,
sbr_DocA attachment,
ato_String content,
ato_eParamAction  contentaction 
)

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
ctxthe current thread local Context.
attachmentthe Document Attachment.
contentthe base64 content of the attachment as an ato_String (e.g. the PDF itself).
contentactiontells 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
ctxthe current thread local Context.
attachmentthe Document Attachment.
descriptionthe 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
ctxthe current thread local Context.
attachmentthe Document Attachment.
filenamethe 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
ctxthe current thread local Context.
attachmentthe Document Attachment.
contenttypethe contenttype of the attachment
Returns
ATO_ERR_OK if successful or an errorcode OR -1 if the call is ignored (SBR_RESPONSE sbdm).