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
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
ResObject.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
13
#include "
zypp/ResObject.h
"
14
#include "
zypp/sat/SolvAttr.h
"
15
#include "
zypp/sat/Solvable.h
"
16
#include "
zypp/Repository.h
"
17
#include "
zypp/RepoInfo.h
"
18
#include "
zypp/IdString.h
"
19
20
using namespace
zypp;
21
using namespace
std;
22
24
namespace
zypp
25
{
26
27
IMPL_PTR_TYPE
(
ResObject
);
28
30
//
31
// METHOD NAME : ResObject::ResObject
32
// METHOD TYPE : Ctor
33
//
34
ResObject::ResObject
(
const
sat::Solvable
& solvable_r )
35
:
Resolvable
( solvable_r )
36
{}
37
39
//
40
// METHOD NAME : ResObject::~ResObject
41
// METHOD TYPE : Dtor
42
//
43
ResObject::~ResObject
()
44
{}
45
47
//
48
// METHOD NAME : ResObject::dumpOn
49
// METHOD TYPE : std::ostream &
50
//
51
std::ostream &
ResObject::dumpOn
( std::ostream & str )
const
52
{
53
return
Resolvable::dumpOn
( str );
54
}
55
57
58
std::string
ResObject::summary
(
const
Locale
& lang_r )
const
59
{
return
lookupStrAttribute
(
sat::SolvAttr::summary
, lang_r ); }
60
61
std::string
ResObject::description
(
const
Locale
& lang_r )
const
62
{
return
lookupStrAttribute
(
sat::SolvAttr::description
, lang_r ); }
63
64
std::string
ResObject::insnotify
(
const
Locale
& lang_r )
const
65
{
return
lookupStrAttribute
(
sat::SolvAttr::insnotify
, lang_r ); }
66
67
std::string
ResObject::delnotify
(
const
Locale
& lang_r )
const
68
{
return
lookupStrAttribute
(
sat::SolvAttr::delnotify
, lang_r ); }
69
70
std::string
ResObject::licenseToConfirm
(
const
Locale
& lang_r )
const
71
{
72
std::string ret =
lookupStrAttribute
(
sat::SolvAttr::eula
, lang_r );
73
if
( ret.empty() && isKind<Product>() )
74
return
repoInfo
().
getLicense
( lang_r );
75
return
ret;
76
}
77
78
bool
ResObject::needToAcceptLicense
()
const
79
{
80
if
( isKind<Product>() )
81
return
repoInfo
().
needToAcceptLicense
( );
82
return
true
;
83
}
84
85
std::string
ResObject::distribution
()
const
86
{
return
lookupStrAttribute
(
sat::SolvAttr::distribution
); }
87
88
std::string
ResObject::cpeId
()
const
89
{
return
lookupStrAttribute
(
sat::SolvAttr::cpeid
); }
90
91
ByteCount
ResObject::installSize
()
const
92
{
return
ByteCount
(
lookupNumAttribute
(
sat::SolvAttr::installsize
) ); }
93
94
ByteCount
ResObject::downloadSize
()
const
95
{
return
ByteCount
(
lookupNumAttribute
(
sat::SolvAttr::downloadsize
) ); }
96
97
unsigned
ResObject::mediaNr
()
const
98
{
return
lookupNumAttribute
(
sat::SolvAttr::medianr
); }
99
100
Date
ResObject::buildtime
()
const
101
{
return
Date
(
lookupNumAttribute
(
sat::SolvAttr::buildtime
) ); }
102
103
Date
ResObject::installtime
()
const
104
{
return
Date
(
lookupNumAttribute
(
sat::SolvAttr::installtime
) ); }
105
106
#warning DUMMY diskusage
107
const
DiskUsage
&
ResObject::diskusage
()
const
108
{
109
static
DiskUsage
_du;
110
return
_du;
111
}
112
114
}
// namespace zypp
116
117
#include "
zypp/ResObjects.h
"
118
120
namespace
zypp
121
{
122
123
ResObject::Ptr
makeResObject
(
const
sat::Solvable
& solvable_r )
124
{
125
if
( ! solvable_r )
126
return
0;
127
128
ResKind
kind( solvable_r.
kind
() );
129
#define OUTS(X) if ( kind == ResTraits<X>::kind ) return make<X>( solvable_r );
130
OUTS
(
Package
);
131
OUTS(
Patch
);
132
OUTS(
Pattern
);
133
OUTS(
Product
);
134
OUTS(
SrcPackage
);
135
#undef OUTS
136
// unknow => return a plain ResObject
137
return
new
ResObject
( solvable_r );
138
}
139
141
}
// namespace zypp
zypp
ResObject.cc
Generated by
1.8.2