UniMRCP  1.7.0
Data Structures | Macros | Typedefs | Functions
apt_text_stream.h File Reference

Text Stream Parse/Generate Routine. More...

#include "apt_string_table.h"
#include "apt_pair.h"
Include dependency graph for apt_text_stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  apt_text_stream_t
 

Macros

#define APT_TOKEN_SP   0x20
 
#define APT_TOKEN_HTAB   0x09
 
#define APT_TOKEN_CR   0x0D
 
#define APT_TOKEN_LF   0x0A
 

Typedefs

typedef struct apt_text_stream_t apt_text_stream_t
 

Functions

apt_bool_t apt_text_line_read (apt_text_stream_t *stream, apt_str_t *line)
 
apt_bool_t apt_text_header_read (apt_text_stream_t *stream, apt_pair_t *pair)
 
apt_bool_t apt_text_field_read (apt_text_stream_t *stream, char separator, apt_bool_t skip_spaces, apt_str_t *field)
 
apt_bool_t apt_text_name_value_insert (apt_text_stream_t *stream, const apt_str_t *name, const apt_str_t *value)
 
apt_bool_t apt_text_header_name_insert (apt_text_stream_t *stream, const apt_str_t *name)
 
apt_bool_t apt_pair_array_parse (apt_pair_arr_t *arr, const apt_str_t *value, apr_pool_t *pool)
 
apt_bool_t apt_pair_array_generate (const apt_pair_arr_t *arr, apt_str_t *str, apr_pool_t *pool)
 
apt_bool_t apt_boolean_value_parse (const apt_str_t *str, apt_bool_t *value)
 
apt_bool_t apt_boolean_value_generate (apt_bool_t value, apt_str_t *str, apr_pool_t *pool)
 
apr_size_t apt_size_value_parse (const apt_str_t *str)
 
apt_bool_t apt_size_value_generate (apr_size_t value, apt_str_t *str, apr_pool_t *pool)
 
apt_bool_t apt_text_size_value_insert (apt_text_stream_t *stream, apr_size_t value)
 
float apt_float_value_parse (const apt_str_t *str)
 
apt_bool_t apt_float_value_generate (float value, apt_str_t *str, apr_pool_t *pool)
 
apt_bool_t apt_text_float_value_insert (apt_text_stream_t *stream, float value)
 
apt_bool_t apt_text_string_insert (apt_text_stream_t *stream, const apt_str_t *str)
 
apt_bool_t apt_text_stream_scroll (apt_text_stream_t *stream)
 
apt_bool_t apt_id_resource_parse (const apt_str_t *str, char separator, apt_str_t *id, apt_str_t *resource, apr_pool_t *pool)
 
apt_bool_t apt_id_resource_generate (const apt_str_t *id, const apt_str_t *resource, char separator, apt_str_t *str, apr_pool_t *pool)
 
apt_bool_t apt_var_length_value_generate (apr_size_t *value, apr_size_t max_count, apt_str_t *str)
 
apt_bool_t apt_completion_cause_generate (const apt_str_table_item_t table[], apr_size_t size, apr_size_t cause, apt_str_t *str, apr_pool_t *pool)
 
apt_bool_t apt_unique_id_generate (apt_str_t *id, apr_size_t length, apr_pool_t *pool)
 

Detailed Description

Text Stream Parse/Generate Routine.

Macro Definition Documentation

◆ APT_TOKEN_CR

#define APT_TOKEN_CR   0x0D

Carrige return

◆ APT_TOKEN_HTAB

#define APT_TOKEN_HTAB   0x09

Horizontal tab

◆ APT_TOKEN_LF

#define APT_TOKEN_LF   0x0A

Line feed

◆ APT_TOKEN_SP

#define APT_TOKEN_SP   0x20

Space

Typedef Documentation

◆ apt_text_stream_t

Text stream declaration

Function Documentation

◆ apt_boolean_value_generate()

apt_bool_t apt_boolean_value_generate ( apt_bool_t  value,
apt_str_t str,
apr_pool_t *  pool 
)

Generate apr_size_t value from pool (buffer is allocated from pool)

◆ apt_boolean_value_parse()

apt_bool_t apt_boolean_value_parse ( const apt_str_t str,
apt_bool_t value 
)

Parse boolean-value

◆ apt_completion_cause_generate()

apt_bool_t apt_completion_cause_generate ( const apt_str_table_item_t  table[],
apr_size_t  size,
apr_size_t  cause,
apt_str_t str,
apr_pool_t *  pool 
)

Generate completion-cause

◆ apt_float_value_generate()

apt_bool_t apt_float_value_generate ( float  value,
apt_str_t str,
apr_pool_t *  pool 
)

Generate float value (buffer is allocated from pool)

◆ apt_float_value_parse()

float apt_float_value_parse ( const apt_str_t str)

Parse float value

◆ apt_id_resource_generate()

apt_bool_t apt_id_resource_generate ( const apt_str_t id,
const apt_str_t resource,
char  separator,
apt_str_t str,
apr_pool_t *  pool 
)

Generate id at resource string

◆ apt_id_resource_parse()

apt_bool_t apt_id_resource_parse ( const apt_str_t str,
char  separator,
apt_str_t id,
apt_str_t resource,
apr_pool_t *  pool 
)

Parse id at resource string

◆ apt_pair_array_generate()

apt_bool_t apt_pair_array_generate ( const apt_pair_arr_t arr,
apt_str_t str,
apr_pool_t *  pool 
)

Generate array of name-value pairs

◆ apt_pair_array_parse()

apt_bool_t apt_pair_array_parse ( apt_pair_arr_t arr,
const apt_str_t value,
apr_pool_t *  pool 
)

Parse array of name-value pairs

◆ apt_size_value_generate()

apt_bool_t apt_size_value_generate ( apr_size_t  value,
apt_str_t str,
apr_pool_t *  pool 
)

Generate apr_size_t value from pool (buffer is allocated from pool)

◆ apt_size_value_parse()

apr_size_t apt_size_value_parse ( const apt_str_t str)

Parse apr_size_t value

◆ apt_text_field_read()

apt_bool_t apt_text_field_read ( apt_text_stream_t stream,
char  separator,
apt_bool_t  skip_spaces,
apt_str_t field 
)

Read the field terminated with specified separator.

Parameters
streamthe text stream to navigate
separatorthe field separator
skip_spaceswhether to skip spaces or not
fieldthe read field to return
Returns
TRUE if the read field isn't empty, otherwise FALSE
Remarks
To be used to navigate through the fields of the text stream (message).

◆ apt_text_float_value_insert()

apt_bool_t apt_text_float_value_insert ( apt_text_stream_t stream,
float  value 
)

Insert float value

◆ apt_text_header_name_insert()

apt_bool_t apt_text_header_name_insert ( apt_text_stream_t stream,
const apt_str_t name 
)

Generate only the name ("name:") of the header field

◆ apt_text_header_read()

apt_bool_t apt_text_header_read ( apt_text_stream_t stream,
apt_pair_t pair 
)

Read header field (name-value pair) of the text stream by scanning entire line.

Parameters
streamthe text stream to navigate
pairthe read pair to return
Returns
TRUE if the header is successfully read, otherwise FALSE
Remarks
To be used to navigate through the lines and read header fields (name:value pairs) of the text stream (message).

◆ apt_text_line_read()

apt_bool_t apt_text_line_read ( apt_text_stream_t stream,
apt_str_t line 
)

Read entire line of the text stream.

Parameters
streamthe text stream to navigate on
linethe read line to return
Returns
TRUE if the line is successfully read, otherwise FALSE
Remarks
To be used to navigate through the lines of the text stream (message).

◆ apt_text_name_value_insert()

apt_bool_t apt_text_name_value_insert ( apt_text_stream_t stream,
const apt_str_t name,
const apt_str_t value 
)

Generate name-value pair line

◆ apt_text_size_value_insert()

apt_bool_t apt_text_size_value_insert ( apt_text_stream_t stream,
apr_size_t  value 
)

Insert apr_size_t value

◆ apt_text_stream_scroll()

apt_bool_t apt_text_stream_scroll ( apt_text_stream_t stream)

Scroll text stream

◆ apt_text_string_insert()

apt_bool_t apt_text_string_insert ( apt_text_stream_t stream,
const apt_str_t str 
)

Insert string value

◆ apt_unique_id_generate()

apt_bool_t apt_unique_id_generate ( apt_str_t id,
apr_size_t  length,
apr_pool_t *  pool 
)

Generate unique identifier (hex string)

Parameters
idthe id to generate
lengththe length of hex string to generate
poolthe pool to allocate memory from

◆ apt_var_length_value_generate()

apt_bool_t apt_var_length_value_generate ( apr_size_t *  value,
apr_size_t  max_count,
apt_str_t str 
)

Generate value plus the length (number of digits) of the value itself