libzypp
12.16.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
User data as transaction id
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
misc
parser
plaindir
susetags
ws
xml
libxmlfwd.cc
libxmlfwd.h
Node.cc
Node.h
Parse.h
ParseDef.cc
ParseDef.h
ParseDefConsume.cc
ParseDefConsume.h
ParseDefException.cc
ParseDefException.h
ParseDefTraits.h
Reader.cc
Reader.h
XmlEscape.cc
XmlEscape.h
XmlString.cc
XmlString.h
yum
HistoryLogReader.cc
HistoryLogReader.h
IniDict.cc
IniDict.h
IniParser.cc
IniParser.h
ParseException.cc
ParseException.h
ParserProgress.h
ProductFileReader.cc
ProductFileReader.h
RepoFileReader.cc
RepoFileReader.h
RepoindexFileReader.cc
RepoindexFileReader.h
ServiceFileReader.cc
ServiceFileReader.h
pool
repo
sat
solver
target
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
Reader.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_PARSER_XML_READER_H
13
#define ZYPP_PARSER_XML_READER_H
14
15
#include <iosfwd>
16
17
#include "
zypp/base/NonCopyable.h
"
18
#include "
zypp/base/InputStream.h
"
19
#include "
zypp/base/Function.h
"
20
21
#include "
zypp/parser/xml/Node.h
"
22
24
namespace
zypp
25
{
26
27
namespace
xml
28
{
29
31
//
32
// CLASS NAME : Validate
33
//
37
struct
Validate
38
{
39
static
Validate
none
()
40
{
return
Validate
(); }
41
};
43
45
//
46
// CLASS NAME : Reader
47
//
95
class
Reader
:
private
zypp::base::NonCopyable
96
{
97
public
:
99
Reader
(
const
InputStream
& stream_r,
100
const
Validate
& validate_r =
Validate::none
() );
101
103
~Reader
();
104
105
public
:
106
115
XmlString
nodeText
();
116
118
bool
nextNode
();
119
121
bool
nextNodeAttribute
();
122
124
bool
nextNodeOrAttribute
()
125
{
return
(
nextNodeAttribute
() ||
nextNode
() ); }
126
128
bool
atEnd
()
const
129
{
return
(
_node
.
readState
() == XML_TEXTREADER_MODE_CLOSED ); }
130
132
const
Node
&
operator*
()
const
133
{
return
_node
; }
134
136
const
Node
*
operator->
()
const
137
{
return
&
_node
; }
138
139
public
:
141
typedef
function<bool( Reader & )>
ProcessNode
;
142
144
bool
foreachNode
(
ProcessNode
fnc_r )
145
{
146
if
(
_node
.
isAttribute
() )
147
nextNode
();
148
for
( ; !
atEnd
();
nextNode
() )
149
{
150
if
( ! fnc_r( *
this
) )
151
return
false
;
152
}
153
return
true
;
154
}
155
157
bool
foreachNodeAttribute
(
ProcessNode
fnc_r )
158
{
159
if
(
_node
.
isAttribute
() && ! fnc_r( *
this
) )
160
return
false
;
161
while
(
nextNodeAttribute
() )
162
{
163
if
( ! fnc_r( *
this
) )
164
return
false
;
165
}
166
return
true
;
167
}
168
170
bool
foreachNodeOrAttribute
(
ProcessNode
fnc_r )
171
{
172
for
( ; !
atEnd
();
nextNodeOrAttribute
() )
173
{
174
if
( ! fnc_r( *
this
) )
175
return
false
;
176
}
177
return
true
;
178
}
179
180
public
:
182
bool
seekToNode
(
int
depth_r,
const
std::string & name_r );
183
185
bool
seekToEndNode
(
int
depth_r,
const
std::string & name_r );
186
187
private
:
188
void
close
();
189
190
private
:
191
InputStream
_stream
;
192
xmlTextReaderPtr
_reader
;
193
Node
_node
;
194
};
196
198
}
// namespace xml
201
}
// namespace zypp
203
#endif // ZYPP_PARSER_XML_READER_H
zypp
parser
xml
Reader.h
Generated by
1.8.2