#include "mbl_read_props.h"
#include <vsl/vsl_indent.h>
#include <vcl_sstream.h>
#include <vcl_iostream.h>
#include <vcl_string.h>
#include <vcl_cctype.h>
#include <vcl_utility.h>
#include <mbl/mbl_parse_block.h>
#include <mbl/mbl_exception.h>
Go to the source code of this file.
Functions | |
void | mbl_read_props_print (vcl_ostream &afs, mbl_read_props_type props) |
Print a list of properties for debugging purposes. | |
void | mbl_read_props_print (vcl_ostream &afs, mbl_read_props_type props, unsigned max_chars) |
Print a list of properties for debugging purposes. Limit each property value length to max_chars . | |
mbl_read_props_type | mbl_read_props (vcl_istream &afs) |
Read properties from a text stream. | |
mbl_read_props_type | mbl_read_props_ws (vcl_istream &afs) |
Read properties from a text stream. | |
mbl_read_props_type | mbl_read_props_merge (const mbl_read_props_type &a, const mbl_read_props_type &b, bool first_overrides) |
merge two property sets. | |
void | mbl_read_props_look_for_unused_props (const vcl_string &function_name, const mbl_read_props_type &props, const mbl_read_props_type &ignore) |
Throw error if there are any keys in props that aren't in ignore. |
Definition in file mbl_read_props.cxx.
mbl_read_props_type mbl_read_props | ( | vcl_istream & | afs | ) |
Read properties from a text stream.
The function will terminate on an eof. If one of the opening lines contains an opening brace '{', then the function will also stop reading the stream after finding a line containing a closing brace '}'
There should be one property per line, with a colon ':' after each property label. The remainder of that line is the property value. If the next line begins with a brace, the following text up to matching braces is included in the property value. Each property label should not contain any whitespace.
Definition at line 94 of file mbl_read_props.cxx.
void mbl_read_props_look_for_unused_props | ( | const vcl_string & | function_name, |
const mbl_read_props_type & | props, | ||
const mbl_read_props_type & | ignore | ||
) |
Throw error if there are any keys in props that aren't in ignore.
mbl_exception_unused_props |
Definition at line 469 of file mbl_read_props.cxx.
mbl_read_props_type mbl_read_props_merge | ( | const mbl_read_props_type & | a, |
const mbl_read_props_type & | b, | ||
bool | first_overrides | ||
) |
merge two property sets.
first_overrides | properties in "a" will override identically named properties in "b" |
Definition at line 435 of file mbl_read_props.cxx.
void mbl_read_props_print | ( | vcl_ostream & | afs, |
mbl_read_props_type | props | ||
) |
Print a list of properties for debugging purposes.
Definition at line 48 of file mbl_read_props.cxx.
void mbl_read_props_print | ( | vcl_ostream & | afs, |
mbl_read_props_type | props, | ||
unsigned | max_chars | ||
) |
Print a list of properties for debugging purposes. Limit each property value length to max_chars
.
Useful for preventing diagnostic output from being flooded by large properties.
Definition at line 60 of file mbl_read_props.cxx.
mbl_read_props_type mbl_read_props_ws | ( | vcl_istream & | afs | ) |
Read properties from a text stream.
The function will terminate on an eof. If one of the opening lines contains an opening brace '{', then the function will also stop reading the stream after finding a line containing a closing brace '}'
Every property label ends in ":", and should not contain any whitespace. Differs from mbl_read_props(afs) in that all whitespace is treated as a separator. If there is a brace after the first string following the label, the following text up to matching braces is included in the property value. Each property label should not contain any whitespace.
Definition at line 267 of file mbl_read_props.cxx.