The CSR API for a CSR Business Document object. More...
Typedefs | |
typedef struct _sbr_Doc | sbr_Doc |
The CSR Business Document object. More... | |
Functions | |
SBR_CSR_EXPORT const char * | sbr_doc_iid (sbr_Doc *doc) |
Return the unique id for the Document - this is a memory only value. More... | |
SBR_CSR_EXPORT const char * | sbr_doc_content (sbr_Doc *doc) |
Return the document content. More... | |
SBR_CSR_EXPORT const char * | sbr_doc_governmentid (sbr_Doc *doc) |
Return the government id. More... | |
SBR_CSR_EXPORT const char * | sbr_doc_businessid (sbr_Doc *doc) |
Return the business id. More... | |
SBR_CSR_EXPORT const char * | sbr_doc_createtime (sbr_Doc *doc) |
Return the document create time. More... | |
SBR_CSR_EXPORT const char * | sbr_doc_validationuri (sbr_Doc *doc) |
Return the validation uri. More... | |
SBR_CSR_EXPORT size_t | sbr_doc_sequencenr (sbr_Doc *doc) |
Return the sequence number (starting at 1) of the document within the sbr_Sbdm object. More... | |
SBR_CSR_EXPORT sbr_eMsgSourceType | sbr_doc_msgsourcetype (sbr_Doc *doc) |
Return whether the document is within a sbr_Request or sbr_Response. More... | |
SBR_CSR_EXPORT int | sbr_doc_setcontent (ato_Ctx *ctx, sbr_Doc *doc, const char *content, ato_eParamAction contentaction) |
Set the content of a document in a Request document - see also sbr_doc_setcontentref(). More... | |
SBR_CSR_EXPORT int | sbr_doc_setcontentref (ato_Ctx *ctx, sbr_Doc *doc, char *content, ato_eParamAction contentaction) |
Set the content of a document in a Request document where content is a non-const parameter - see also sbr_doc_setcontent(). More... | |
SBR_CSR_EXPORT int | sbr_doc_setvalidationuri (ato_Ctx *ctx, sbr_Doc *doc, const char *validationuri) |
Set the validationuri of a document in a Request document. More... | |
SBR_CSR_EXPORT int | sbr_doc_setgovernmentid (ato_Ctx *ctx, sbr_Doc *doc, const char *governmentid) |
Set the governmentid of a document in a Request document. More... | |
SBR_CSR_EXPORT int | sbr_doc_setbusinessid (ato_Ctx *ctx, sbr_Doc *doc, const char *businessid) |
Set the businessid of a document in a Request document. More... | |
SBR_CSR_EXPORT int | sbr_doc_setcreatetime (ato_Ctx *ctx, sbr_Doc *doc, time_t createtime) |
Set the createtime of a document in a Request document. More... | |
SBR_CSR_EXPORT size_t | sbr_doc_attachment_count (sbr_Doc *doc) |
Return the number of attachments this document has. More... | |
SBR_CSR_EXPORT void | sbr_doc_attachment_iterator (sbr_Doc *doc, ato_Iterator **iter) |
Create an iterator for the collection of attachments - caller must free. More... | |
SBR_CSR_EXPORT sbr_DocA * | sbr_doc_attachment_firstv (sbr_Doc *doc) |
Get the first attachment of the collection. More... | |
SBR_CSR_EXPORT sbr_DocA * | sbr_doc_attachment_nextv (sbr_Doc *doc) |
Get the next attachment of the collection. More... | |
SBR_CSR_EXPORT int | sbr_doc_attachment_add (ato_Ctx *ctx, sbr_Doc *doc, sbr_DocA **attachment, const char *description, const char *filename, const char *contenttype) |
Add an attachment to a Request document - use sbr_doca_setcontent() to set the content. More... | |
SBR_CSR_EXPORT int | sbr_doc_attachment_remove (ato_Ctx *ctx, sbr_Doc *doc, sbr_DocA *attachment) |
Remove an attachment from a Request document - not currently implemented. More... | |
The CSR API for a CSR Business Document object.
typedef struct _sbr_Doc sbr_Doc |
The CSR Business Document 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_CSR_EXPORT const char * sbr_doc_iid | ( | sbr_Doc * | doc | ) |
Return the unique id for the Document - this is a memory only value.
doc | the Business Document |
SBR_CSR_EXPORT const char * sbr_doc_content | ( | sbr_Doc * | doc | ) |
Return the document content.
doc | the Business Document. |
SBR_CSR_EXPORT const char * sbr_doc_governmentid | ( | sbr_Doc * | doc | ) |
Return the government id.
doc | the Business Document. |
SBR_CSR_EXPORT const char * sbr_doc_businessid | ( | sbr_Doc * | doc | ) |
Return the business id.
doc | the Business Document. |
SBR_CSR_EXPORT const char * sbr_doc_createtime | ( | sbr_Doc * | doc | ) |
Return the document create time.
doc | the Business Document. |
SBR_CSR_EXPORT const char * sbr_doc_validationuri | ( | sbr_Doc * | doc | ) |
Return the validation uri.
doc | the Business Document. |
SBR_CSR_EXPORT size_t sbr_doc_sequencenr | ( | sbr_Doc * | doc | ) |
Return the sequence number (starting at 1) of the document within the sbr_Sbdm object.
doc | the Business Document. |
SBR_CSR_EXPORT sbr_eMsgSourceType sbr_doc_msgsourcetype | ( | sbr_Doc * | doc | ) |
Return whether the document is within a sbr_Request or sbr_Response.
doc | the Business Document. |
SBR_CSR_EXPORT int sbr_doc_setcontent | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
const char * | content, | ||
ato_eParamAction | contentaction | ||
) |
Set the content of a document in a Request document - see also sbr_doc_setcontentref().
ctx | the current thread local Context. |
doc | the Business Document. |
content | the content of the document (e.g. the xbrl) This is inserted at StandardBusinessDocumentBody:BusinessDocumentInstances:BusinessDocument.Instance.Text |
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 is not valid as content is a const - use sbr_doc_setcontentref() for this. |
SBR_CSR_EXPORT int sbr_doc_setcontentref | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
char * | content, | ||
ato_eParamAction | contentaction | ||
) |
Set the content of a document in a Request document where content is a non-const parameter - see also sbr_doc_setcontent().
ctx | the current thread local Context. |
doc | the Business Document. |
content | the content of the document (e.g. the xbrl) This is inserted at StandardBusinessDocumentBody:BusinessDocumentInstances:BusinessDocument.Instance.Text |
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). |
SBR_CSR_EXPORT int sbr_doc_setvalidationuri | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
const char * | validationuri | ||
) |
Set the validationuri of a document in a Request document.
ctx | the current thread local Context. |
doc | the Business Document. |
validationuri | the validationuri to use in the header |
SBR_CSR_EXPORT int sbr_doc_setgovernmentid | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
const char * | governmentid | ||
) |
Set the governmentid of a document in a Request document.
ctx | the current thread local Context. |
doc | the Business Document. |
governmentid | the validationuri to use in the header |
Set the businessid of a document in a Request document.
ctx | the current thread local Context. |
doc | the Business Document. |
businessid | the businessid to use in the header |
Set the createtime of a document in a Request document.
ctx | the current thread local Context. |
doc | the Business Document. |
createtime | the createtime to use in the header. |
SBR_CSR_EXPORT size_t sbr_doc_attachment_count | ( | sbr_Doc * | doc | ) |
Return the number of attachments this document has.
doc | the Business Document. |
SBR_CSR_EXPORT void sbr_doc_attachment_iterator | ( | sbr_Doc * | doc, |
ato_Iterator ** | iter | ||
) |
Create an iterator for the collection of attachments - caller must free.
This is useful if a collection is being shared between threads and each thread has its own iterator.
If this is not the case then the sbr_doc_attachment_firstv() and sbr_doc_attachment_nextv() methods are simpler and this method can be ignored.
doc | the Business Document. |
iter | the address of the iterator to create - *iter must be NULL. This will be NULL if there is no collection. |
Get the first attachment of the collection.
This also initialises the iterator associated with the current doc attachments.
doc | the Business Document. |
Get the next attachment of the collection.
doc | the Business Document. |
SBR_CSR_EXPORT int sbr_doc_attachment_add | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
sbr_DocA ** | attachment, | ||
const char * | description, | ||
const char * | filename, | ||
const char * | contenttype | ||
) |
Add an attachment to a Request document - use sbr_doca_setcontent() to set the content.
ctx | the current thread local Context. |
doc | the Business Document. |
attachment | the address of the attachment object to allocate - DO NOT free. |
description | a description to use in the header |
filename | the filename to associate with the attachment |
contenttype | the type of the content |
SBR_CSR_EXPORT int sbr_doc_attachment_remove | ( | ato_Ctx * | ctx, |
sbr_Doc * | doc, | ||
sbr_DocA * | attachment | ||
) |
Remove an attachment from a Request document - not currently implemented.
ctx | the current thread local Context. |
doc | the Business Document. |
attachment | the attachment object. |