hl7parse
Public Attributes | List of all members
message_state_t Struct Reference

holds callbacks and associated variables More...

#include <message_state.h>

Public Attributes

int progress_every
 fire progress callback every N bytes More...
 
size_t parsed_length
 The total length of the parsed file. More...
 
void(* cb_progress )(message_t *message, size_t total, size_t current)
 progress callback More...
 
void(* cb_start )(message_t *message)
 start event, will be fired once when the parser starts
 
void(* cb_end )(message_t *message, size_t max, size_t current, int exit_code)
 finish callback. More...
 
void(* cb_segment )(message_t *message, size_t num, char name[3])
 segment parsed callback More...
 

Detailed Description

holds callbacks and associated variables

Member Data Documentation

◆ cb_end

void(* message_state_t::cb_end) (message_t *message, size_t max, size_t current, int exit_code)

finish callback.

Will be fired when parsing finished and will provide the numebr of bytes processd and the exit code of the parser.

◆ cb_progress

void(* message_state_t::cb_progress) (message_t *message, size_t total, size_t current)

progress callback

This callback will fire every N bytes and will provide the numebr of currently read bytes current and the number of total bytes to read total.

Be carefull how often you make this event fire, on very large files (MDM with base64 embeedded data for example) this could be fired millions of times.

◆ cb_segment

void(* message_state_t::cb_segment) (message_t *message, size_t num, char name[3])

segment parsed callback

will be fired once a segment is parsed and will provide the segment number num (roughly equals line number, blank lines not counted) and the segment name name

◆ parsed_length

size_t message_state_t::parsed_length

The total length of the parsed file.

This is roughly file size (minus the size of the bom if there is any). parsed_length will be set by the parser before the parsing starts.

◆ progress_every

int message_state_t::progress_every

fire progress callback every N bytes

If this value is 0, then progress will be fired every at every 1% of progress.


The documentation for this struct was generated from the following file: