libzypp: zypp::xml::parse_def_assign::Consumer Struct Reference

libzypp 17.36.6

Public Member Functions | Private Member Functions | Private Attributes | List of all members
zypp::xml::parse_def_assign::Consumer Struct Reference

ParseDef consumer assigning Node text and attribues values to variables. More...

`#include <zypp/parser/xml/ParseDefConsume.h>`

Inheritance diagram for zypp::xml::parse_def_assign::Consumer:

## Public Member Functions
void | add (const AssignerRef &assigner_r)
| Extend Consumer.
void | add (const std::string &attr_r, const AssignerRef &assigner_r)
| Extend Consumer.
void | prenotify (function< void(const Node &)> pre_r)
| Set pre notification callback.
void | postnotify (function< void(const Node &)> post_r)
| Set post notification callback.
void | start (const xml::Node &node_r) override
void | text (const xml::Node &node_r) override
void | done (const xml::Node &node_r) override
Public Member Functions inherited from zypp::xml::ParseDefConsume
virtual | ~ParseDefConsume ()
virtual void | cdata (const Node &_node)
virtual void | startSubnode (const Node &_node)
virtual void | doneSubnode (const Node &_node)

## Private Member Functions
void | assign (const std::vector< AssignerRef > &vec_r, const char *value_r)

## Private Attributes
std::unordered_map< std::string, std::vector< AssignerRef > > | _attr
std::vector< AssignerRef > | _text
function< void(const Node &)> | _pre
function< void(const Node &)> | _post

## Detailed Description

ParseDef consumer assigning Node text and attribues values to variables.

This can be used with all types supported by Assigner. Basically all types constructible from `char*`, or where a specialisation exists (e.g. numeric and bool).

You may also set a `void( const Node & )` notification callback which is invoked after the node was processed.

Note
  Use and see xml::parseDefAssign convenience constructor.

// parsedef for '<setup attr="13">value</setup>'
ParseDef( "attr", MANDTAORY, xml::parseDefAssign( data.value )
( "attr", data.attr ) )
zypp::xml::ParseDef
Define a xml node structure to parse.
Definition ParseDef.h:129

Definition at line 213 of file ParseDefConsume.h.

## Member Function Documentation

## ◆ add() [1/2]

void zypp::xml::parse_def_assign::Consumer::add | ( | const AssignerRef & | assigner_r | ) |
| inline

Extend Consumer.

Definition at line 216 of file ParseDefConsume.h.

## ◆ add() [2/2]

void zypp::xml::parse_def_assign::Consumer::add | ( | const std::string & | attr_r,
|  | const AssignerRef & | assigner_r )
| inline

Extend Consumer.

Definition at line 220 of file ParseDefConsume.h.

## ◆ prenotify()

void zypp::xml::parse_def_assign::Consumer::prenotify | ( | function< void(const Node &)> | pre_r | ) |
| inline

Set pre notification callback.

Definition at line 224 of file ParseDefConsume.h.

## ◆ postnotify()

void zypp::xml::parse_def_assign::Consumer::postnotify | ( | function< void(const Node &)> | post_r | ) |
| inline

Set post notification callback.

Definition at line 228 of file ParseDefConsume.h.

## ◆ start()

void zypp::xml::parse_def_assign::Consumer::start | ( | const xml::Node & | node_r | ) |
| inlineoverridevirtual

Reimplemented from zypp::xml::ParseDefConsume.

Definition at line 231 of file ParseDefConsume.h.

## ◆ text()

void zypp::xml::parse_def_assign::Consumer::text | ( | const xml::Node & | node_r | ) |
| inlineoverridevirtual

Reimplemented from zypp::xml::ParseDefConsume.

Definition at line 241 of file ParseDefConsume.h.

## ◆ done()

void zypp::xml::parse_def_assign::Consumer::done | ( | const xml::Node & | node_r | ) |
| inlineoverridevirtual

Reimplemented from zypp::xml::ParseDefConsume.

Definition at line 247 of file ParseDefConsume.h.

## ◆ assign()

void zypp::xml::parse_def_assign::Consumer::assign | ( | const std::vector< AssignerRef > & | vec_r,
|  | const char * | value_r )
| inlineprivate

Definition at line 254 of file ParseDefConsume.h.

## Member Data Documentation

## ◆ _attr

std::unordered_map<std::string, std::vector<AssignerRef> > zypp::xml::parse_def_assign::Consumer::_attr
| private

Definition at line 262 of file ParseDefConsume.h.

## ◆ _text

std::vector<AssignerRef> zypp::xml::parse_def_assign::Consumer::_text
| private

Definition at line 263 of file ParseDefConsume.h.

## ◆ _pre

function<void ( const Node & )> zypp::xml::parse_def_assign::Consumer::_pre
| private

Definition at line 264 of file ParseDefConsume.h.

## ◆ _post

function<void ( const Node & )> zypp::xml::parse_def_assign::Consumer::_post
| private

Definition at line 265 of file ParseDefConsume.h.

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

- zypp/parser/xml/ParseDefConsume.h