libzypp  17.37.5
zypp::xml::ParseDef::Impl Class Reference

ParseDef implementation. More...

Public Types

using ImplPtr = shared_ptr< Impl >
 
using SubNodes = std::map< std::string, ImplPtr >
 

Public Member Functions

 Impl (std::string &&name_r, Mode mode_r, shared_ptr< ParseDefConsume > &&target_r=shared_ptr< ParseDefConsume >())
 
 Impl (const Impl &)=default
 
 Impl (Impl &&)=delete
 
Imploperator= (const Impl &)=delete
 
Imploperator= (Impl &&)=delete
 
 ~Impl ()
 
bool isOptional () const
 
bool isMandatory () const
 
bool singleDef () const
 
bool multiDef () const
 
void addNode (const ImplPtr &subnode_r)
 
ImplPtr getNode (const std::string &name_r) const
 
void take (Reader &reader_r)
 

Public Attributes

std::string _name
 
Mode _mode
 
DefaultIntegral< unsigned, 0 > _visited
 
Impl_parent
 
SubNodes _subnodes
 
ParseDefImplConsume _callback
 
DefaultIntegral< int,-1 > _parseDepth
 

Private Member Functions

bool skipNode (Reader &reader_r)
 Skip the current node. More...
 
std::string exstr (const std::string &what_r, const Impl &impl_r) const
 
std::string exstr (const std::string &what_r, const Impl &impl_r, const Reader &reader_r) const
 

Friends

std::ostream & operator<< (std::ostream &str, const ParseDef::Impl &obj)
 

Detailed Description

ParseDef implementation.

Todo:
Check using share_ptr_from_this for parent in addNode.

Definition at line 95 of file ParseDef.cc.

Member Typedef Documentation

◆ ImplPtr

Definition at line 99 of file ParseDef.cc.

◆ SubNodes

using zypp::xml::ParseDef::Impl::SubNodes = std::map<std::string, ImplPtr>

Definition at line 100 of file ParseDef.cc.

Constructor & Destructor Documentation

◆ Impl() [1/3]

zypp::xml::ParseDef::Impl::Impl ( std::string &&  name_r,
Mode  mode_r,
shared_ptr< ParseDefConsume > &&  target_r = shared_ptr<ParseDefConsume>() 
)
inline

Definition at line 103 of file ParseDef.cc.

◆ Impl() [2/3]

zypp::xml::ParseDef::Impl::Impl ( const Impl )
default

◆ Impl() [3/3]

zypp::xml::ParseDef::Impl::Impl ( Impl &&  )
delete

◆ ~Impl()

zypp::xml::ParseDef::Impl::~Impl ( )
inline

Definition at line 116 of file ParseDef.cc.

Member Function Documentation

◆ operator=() [1/2]

Impl& zypp::xml::ParseDef::Impl::operator= ( const Impl )
delete

◆ operator=() [2/2]

Impl& zypp::xml::ParseDef::Impl::operator= ( Impl &&  )
delete

◆ isOptional()

bool zypp::xml::ParseDef::Impl::isOptional ( ) const
inline

Definition at line 124 of file ParseDef.cc.

◆ isMandatory()

bool zypp::xml::ParseDef::Impl::isMandatory ( ) const
inline

Definition at line 127 of file ParseDef.cc.

◆ singleDef()

bool zypp::xml::ParseDef::Impl::singleDef ( ) const
inline

Definition at line 130 of file ParseDef.cc.

◆ multiDef()

bool zypp::xml::ParseDef::Impl::multiDef ( ) const
inline

Definition at line 133 of file ParseDef.cc.

◆ addNode()

void zypp::xml::ParseDef::Impl::addNode ( const ImplPtr subnode_r)

Definition at line 191 of file ParseDef.cc.

◆ getNode()

ImplPtr zypp::xml::ParseDef::Impl::getNode ( const std::string &  name_r) const
inline

Definition at line 139 of file ParseDef.cc.

◆ take()

void zypp::xml::ParseDef::Impl::take ( Reader reader_r)

Definition at line 212 of file ParseDef.cc.

◆ skipNode()

bool zypp::xml::ParseDef::Impl::skipNode ( xml::Reader reader_r)
private

Skip the current node.

Precondition
Current node must be XML_READER_TYPE_ELEMENT.
Postcondition
At the corresponding end node. (XML_READER_TYPE_END_ELEMENT or atill at the same node, if it'a an empty element <node />).
Returns
last call to xml::Reader::nextNode.
Exceptions
ParseDefValidateExceptionif no matching end node found.

Definition at line 334 of file ParseDef.cc.

◆ exstr() [1/2]

std::string zypp::xml::ParseDef::Impl::exstr ( const std::string &  what_r,
const Impl impl_r 
) const
inlineprivate

Definition at line 160 of file ParseDef.cc.

◆ exstr() [2/2]

std::string zypp::xml::ParseDef::Impl::exstr ( const std::string &  what_r,
const Impl impl_r,
const Reader reader_r 
) const
inlineprivate

Definition at line 166 of file ParseDef.cc.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  str,
const ParseDef::Impl obj 
)
friend

Definition at line 353 of file ParseDef.cc.

Member Data Documentation

◆ _name

std::string zypp::xml::ParseDef::Impl::_name

Definition at line 174 of file ParseDef.cc.

◆ _mode

Mode zypp::xml::ParseDef::Impl::_mode

Definition at line 175 of file ParseDef.cc.

◆ _visited

DefaultIntegral<unsigned,0> zypp::xml::ParseDef::Impl::_visited

Definition at line 176 of file ParseDef.cc.

◆ _parent

Impl* zypp::xml::ParseDef::Impl::_parent

Definition at line 178 of file ParseDef.cc.

◆ _subnodes

SubNodes zypp::xml::ParseDef::Impl::_subnodes

Definition at line 179 of file ParseDef.cc.

◆ _callback

ParseDefImplConsume zypp::xml::ParseDef::Impl::_callback

Definition at line 180 of file ParseDef.cc.

◆ _parseDepth

DefaultIntegral<int,-1> zypp::xml::ParseDef::Impl::_parseDepth

Definition at line 182 of file ParseDef.cc.


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