Xport Interface: parser::option

Sets or retrieves specific parsing options.

bool parser::option(1st Retrieval Variety
  formatter_boolean_option bool_opt
);
int parser::option(2st Retrieval Variety
  formatter_integer_option int_opt
);
std::string parser::option(3rd Retrieval Variety
  formatter_string_option string_opt
);
std::ostream& parser::option(4th Retrieval Variety
  parser_log_stream_option log_ostream_opt
);
logging_verbosity parser::option(5th Retrieval Variety
  parser_log_option log_verbosity_opt
);
bool parser::option(1st Setting Variety
  parser_boolean_option opt,
  bool bool_value
);
bool parser::option(2st Setting Variety
  parser_integer_option int_opt,
  int int_value
);
bool parser::option(3rd Setting Variety
  parser_string_option string_opt,
  const std::string& string_value
);
bool parser::option(4th Setting Variety
  parser_log_stream_option log_stream_opt,
  std::ostream& log_stream_value
);
bool parser::option(5th Setting Variety
  parser_log_option log_verbosity_opt,
  logging_verbosity log_verbosity_value
);

Parameters

bool_opt

A parser_boolean_option enumerator which specifies the boolean option to set or retrieve.

int_opt

An parser_integer_option enumerator which specifies the integer option to set or retrieve.

string_opt

A parser_string_option enumerator which specifies the string option to set or retrieve.

log_stream_opt

A parser_log_stream_option enumerator which specifies setting or retreiving the log stream.

log_verbosity_opt

A parser_log_option enumerator, which specifies that the log verbosity be returned or set.

bool_value

A boolean value which will set the specified boolean option.

int_opt

An integer value which will set the specified boolean option.

string_value

A string value which will set the specified boolean option.

log_stream_value

An output stream which will be used for the log output.

log_verbosity_value

An log_verbosity enumeration which determines the amount and type of log messages the parser sends to the log stream. Available enuerators are lv_none, lv_error, lv_warning, lv_start_element, lv_end_element, and lv_all. Some enumerators overlap for consistancy. The lv_warning enumerator also includes lv_error, and the lv_end_element also includes lv_start_element.

Returns

In the first setting variety, returns a boolean value disclosing the state of the specified option.
In the second setting variety, returns an integer disclosing the integer value of the specified option.
In the third setting variety, returns a string disclosing the string value of the specified option.
In the forth setting variety, returns an output stream which is used for logging purposes.
In the fifth setting variety, returns a log_verbosity enumerator, which reveals the logging verbosity.

Remarks

This operation is used to set and retrieve various parsing options of the called parser object. The various options are described below. Many more options will be added to the list below, allowing more control of the parsed (x)html input.

All options in parser are distinguished, set, and retrieved, by enumerations. The table below lists the various options now available in parser, and their default values. As more options are added, they will be added to the list.

Option enumerator Option type Default Description
convert_entities boolean false Determines if character entity references will be converted according to the current entity list, or unaltered.
preserve_newlines boolean false Determines if newlines in the parsed (x)html will be preseverd or removed.
strip_byte_order_mark boolean false Determines the byte order mark, if present, will be removed, or included in the output document.
log_verbosity enumeration lv_none Determines whether logging will take place, and if so, the amount of logging (logging verbosity).
log_stream enumeration std::cout Determines whether logging will take place, and if so, the amount of logging (logging verbosity).

Complexity

Constant

Examples

Work Time Studio

Datasoft Solutions is proud to present their landmark product, Work Time Studio. Utilizing the tree container library, Work Time Studio provides unparalleled features in personal time, project and task management software. If you're looking for a way to increase your productivity, visit Work Time Studio's product website, and start being more productive today.