libzypp
17.14.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ProductFileReader.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_PARSER_PRODUCTSDREADER_H
13
#define ZYPP_PARSER_PRODUCTSDREADER_H
14
15
#include <iosfwd>
16
17
#include "
zypp/base/PtrTypes.h
"
18
#include "
zypp/base/Function.h
"
19
#include "
zypp/base/InputStream.h
"
20
21
#include "
zypp/Pathname.h
"
22
#include "
zypp/IdString.h
"
23
#include "
zypp/Edition.h
"
24
#include "
zypp/Arch.h
"
25
27
namespace
zypp
28
{
29
30
namespace
parser
31
{
32
34
//
35
// CLASS NAME : ProductFileData
36
//
40
class
ProductFileData
41
{
42
public
:
43
struct
Impl
;
45
ProductFileData
(
Impl
* allocated_r = 0 );
46
48
bool
empty
()
const
49
{
return
name
().
empty
(); }
50
51
public
:
52
IdString
vendor
()
const
;
53
IdString
name
()
const
;
54
Edition
edition
()
const
;
55
Arch
arch
()
const
;
56
57
std::string
shortName
()
const
;
58
std::string
summary
()
const
;
59
60
public
:
61
std::string
productline
()
const
;
62
std::string
registerTarget
()
const
;
63
std::string
registerRelease
()
const
;
64
std::string
registerFlavor
()
const
;
65
66
public
:
67
std::string
updaterepokey
()
const
;
68
69
public
:
71
72
struct
Upgrade
73
{
74
public
:
75
struct
Impl
;
77
Upgrade
(
Impl
* allocated_r = 0 );
78
79
public
:
80
std::string
name
()
const
;
81
std::string
summary
()
const
;
82
std::string
repository
()
const
;
83
std::string
product
()
const
;
84
bool
notify
()
const
;
85
std::string
status
()
const
;
86
87
private
:
88
RWCOW_pointer<Impl>
_pimpl
;
89
};
91
92
typedef
std::vector<Upgrade>
Upgrades
;
93
const
Upgrades
&
upgrades
()
const
;
94
95
private
:
96
RWCOW_pointer<Impl>
_pimpl
;
97
};
99
101
std::ostream &
operator<<
( std::ostream & str,
const
ProductFileData
& obj );
102
104
std::ostream &
operator<<
( std::ostream & str,
const
ProductFileData::Upgrade
& obj );
105
107
//
108
// CLASS NAME : ProductFileReader
109
//
120
class
ProductFileReader
121
{
122
public
:
126
typedef
function<bool( const ProductFileData & )>
Consumer
;
127
128
public
:
129
ProductFileReader
()
130
{}
131
132
ProductFileReader
(
const
Consumer
& consumer_r )
133
:
_consumer
( consumer_r )
134
{}
135
136
ProductFileReader
(
const
Consumer
& consumer_r,
const
InputStream
& input_r )
137
:
_consumer
( consumer_r )
138
{
parse
( input_r ); }
139
140
public
:
141
const
Consumer
&
consumer
()
const
142
{
return
_consumer
; }
143
144
void
setConsumer
(
const
Consumer
& consumer_r )
145
{
_consumer
= consumer_r; }
146
147
public
:
153
bool
parse
(
const
InputStream
& input_r =
InputStream
() )
const
;
154
155
public
:
161
static
bool
scanDir
(
const
Consumer
& consumer_r,
const
Pathname & dir_r );
162
165
static
ProductFileData
scanFile
(
const
Pathname & file_r );
166
167
private
:
168
Consumer
_consumer
;
169
};
171
173
}
// namespace parser
176
}
// namespace zypp
178
#endif // ZYPP_PARSER_PRODUCTSDREADER_H
zypp
parser
ProductFileReader.h
Generated by
1.8.2