libzypp
11.13.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
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
Dep.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#include <map>
13
#include <iostream>
14
15
#include "
zypp/base/Exception.h
"
16
#include "
zypp/base/String.h
"
17
18
#include "
zypp/Dep.h
"
19
21
namespace
zypp
22
{
23
24
namespace
25
{
26
27
std::map<std::string,Dep::for_use_in_switch>
_table
;
28
29
Dep::for_use_in_switch
parse(
const
std::string & strval_r )
30
{
31
if
( _table.empty() )
32
{
33
// initialize it
34
_table[
"provides"
] =
Dep::PROVIDES_e
;
35
_table[
"prerequires"
] =
Dep::PREREQUIRES_e
;
36
_table[
"requires"
] =
Dep::REQUIRES_e
;
37
_table[
"conflicts"
] =
Dep::CONFLICTS_e
;
38
_table[
"obsoletes"
] =
Dep::OBSOLETES_e
;
39
_table[
"recommends"
] =
Dep::RECOMMENDS_e
;
40
_table[
"suggests"
] =
Dep::SUGGESTS_e
;
41
_table[
"enhances"
] =
Dep::ENHANCES_e
;
42
_table[
"supplements"
] =
Dep::SUPPLEMENTS_e
;
43
}
44
45
std::map<std::string,Dep::for_use_in_switch>::const_iterator it
46
= _table.find(
str::toLower
( strval_r ) );
47
if
( it == _table.end() )
48
{
49
ZYPP_THROW
( Exception(
"Dep parse: illegal string value '"
+strval_r+
"'"
) );
50
}
51
return
it->second;
52
}
53
}
54
56
57
const
Dep
Dep::PROVIDES
(
Dep::PROVIDES_e
);
58
const
Dep
Dep::PREREQUIRES
(
Dep::PREREQUIRES_e
);
59
const
Dep
Dep::REQUIRES
(
Dep::REQUIRES_e
);
60
const
Dep
Dep::CONFLICTS
(
Dep::CONFLICTS_e
);
61
const
Dep
Dep::OBSOLETES
(
Dep::OBSOLETES_e
);
62
const
Dep
Dep::RECOMMENDS
(
Dep::RECOMMENDS_e
);
63
const
Dep
Dep::SUGGESTS
(
Dep::SUGGESTS_e
);
64
const
Dep
Dep::ENHANCES
(
Dep::ENHANCES_e
);
65
const
Dep
Dep::SUPPLEMENTS
(
Dep::SUPPLEMENTS_e
);
66
68
//
69
// METHOD NAME : Dep::Dep
70
// METHOD TYPE : Ctor
71
//
72
Dep::Dep
(
const
std::string & strval_r )
73
: _type( parse( strval_r ) )
74
{}
75
77
//
78
// METHOD NAME : Dep::asString
79
// METHOD TYPE : const std::string &
80
//
81
const
std::string &
Dep::asString
()
const
82
{
83
static
std::map<for_use_in_switch,std::string>
_table
;
84
if
( _table.empty() )
85
{
86
// initialize it
87
_table[
PROVIDES_e
] =
"provides"
;
88
_table[
PREREQUIRES_e
] =
"prerequires"
;
89
_table[
REQUIRES_e
] =
"requires"
;
90
_table[
CONFLICTS_e
] =
"conflicts"
;
91
_table[
OBSOLETES_e
] =
"obsoletes"
;
92
_table[
RECOMMENDS_e
] =
"recommends"
;
93
_table[
SUGGESTS_e
] =
"suggests"
;
94
_table[
ENHANCES_e
] =
"enhances"
;
95
_table[
SUPPLEMENTS_e
] =
"supplements"
;
96
}
97
return
_table[
_type
];
98
}
99
101
}
// namespace zypp
zypp
Dep.cc
Generated by
1.8.1