libzypp 17.38.7
ParseDefConsume.h File Reference
#include <zypp-core/base/PtrTypes.h>
#include <zypp-core/base/Function.h>
#include <zypp-core/base/Hash.h>
#include <zypp-core/base/String.h>
#include <utility>
#include <zypp-core/base/DefaultIntegral>
#include <zypp/parser/xml/Node.h>

Go to the source code of this file.

Classes

struct  zypp::xml::ParseDefConsume
 Base class for ParseDef consumer. More...
class  zypp::xml::ParseDefConsumeRedirect
 ParseDef consumer redirecting all events to another consumer. More...
class  zypp::xml::ParseDefConsumeCallback
 ParseDef consumer that invokes callbacks. More...
struct  zypp::xml::parse_def_assign::Assigner< void >
 Common interface to all Assigner types. More...
struct  zypp::xml::parse_def_assign::Assigner< Tp >
 Assigner assigns text to types constructible from char*. More...
struct  zypp::xml::parse_def_assign::Consumer
 ParseDef consumer assigning Node text and attribues values to variables. More...
struct  zypp::xml::parse_def_assign::Builder
 Helper class to build a Consumer. More...

Namespaces

namespace  zypp
 Easy-to use interface to the ZYPP dependency resolver.
namespace  zypp::xml
namespace  zypp::xml::parse_def_assign
 parseDefAssign exposed details

Typedefs

using zypp::xml::parse_def_assign::AssignerRef = shared_ptr<Assigner<void>>

Functions

relates: Assigner Convenience constructor
template<class Tp>
AssignerRef zypp::xml::parse_def_assign::assigner (Tp &value_r)
template<class Tp, Tp TInitial>
AssignerRef zypp::xml::parse_def_assign::assigner (DefaultIntegral< Tp, TInitial > &value_r)
\ref ParseDef consumer assigning \ref Node text and attribues values to variables.

relates: parse_def_assign::Consumer relates: parse_def_assign::Builder

This function allows convenient contruction of a parse_def_assign::Consumer to be passed as Node conssumer to ParseDef. Simply list each attribute's name together with the variable its value should be assigned to. If the attribute name is omitted, the node's text value gets assigned.

Target variables can be of any type tsupported by Assigner. Basically all types constructible from char*, or where a specialisation exists (e.g. numeric and bool).

void setupDone( const xml::Node & _node )
{ ... }
// parsedef for '<setup attr="13">value</setup>'
ParseDef( "attr", MANDTAORY,
xml::parseDefAssign( data.value )
( "attr", data.attr )
>> &setupDone );
xmlTextReader based interface to Reader's current node.
Definition Node.h:36
parse_def_assign::Builder parseDefAssign()
See also
xml::rnParse for more example.
parse_def_assign::Builder zypp::xml::parseDefAssign ()
template<class Tp>
parse_def_assign::Builder zypp::xml::parseDefAssign (Tp &value_r)
template<class Tp>
parse_def_assign::Builder zypp::xml::parseDefAssign (const std::string &attr_r, Tp &value_r)