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
IdString.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_SAT_IDSTR_H
13
#define ZYPP_SAT_IDSTR_H
14
15
#include <iosfwd>
16
#include <string>
17
18
#include "
zypp/base/SafeBool.h
"
19
20
#include "
zypp/sat/detail/PoolMember.h
"
21
23
namespace
zypp
24
{
25
26
class
IdString
;
27
typedef
std::tr1::unordered_set<IdString>
IdStringSet
;
28
30
//
31
// CLASS NAME : IdString
32
//
41
class
IdString
:
protected
sat::detail::PoolMember
,
42
private
base::SafeBool
<IdString>
43
{
44
public
:
45
typedef
sat::detail::IdType
IdType
;
46
47
public
:
49
IdString
() :
_id
( sat::detail::
emptyId
) {}
50
52
explicit
IdString
(
IdType
id_r ) :
_id
( id_r ) {}
53
55
explicit
IdString
(
const
char
* str_r );
56
58
explicit
IdString
(
const
std::string & str_r );
59
60
public
:
62
static
const
IdString
Null
;
63
65
static
const
IdString
Empty
;
66
67
public
:
68
#ifndef SWIG // Swig treats it as syntax error
69
70
using
base::SafeBool<IdString>::operator
bool_type
;
71
#endif
72
75
bool
empty
()
const
76
{
return
(
_id
==
sat::detail::emptyId
||
_id
==
sat::detail::noId
); }
77
79
unsigned
size
()
const
;
80
81
public
:
83
const
char
*
c_str
()
const
;
84
86
std::string
asString
()
const
87
{
return
c_str
(); }
88
89
public
:
91
bool
compareEQ
(
const
IdString
& rhs )
const
92
{
return
(
_id
== rhs.
id
() ); }
93
95
int
compare
(
const
IdString
& rhs )
const
;
96
98
int
compare
(
const
char
* rhs )
const
;
99
101
int
compare
(
const
std::string & rhs )
const
102
{
return
compare
( rhs.c_str() ); }
103
104
public
:
106
IdType
id
()
const
107
{
return
_id
; }
108
private
:
109
#ifndef SWIG // Swig treats it as syntax error
110
friend
base::SafeBool<IdString>::operator
bool_type
()
const
;
111
#endif
112
bool
boolTest
()
const
{
return
_id
; }
113
private
:
114
IdType
_id
;
115
};
117
119
std::ostream &
operator<<
( std::ostream & str,
const
IdString
& obj );
120
122
std::ostream &
dumpOn
( std::ostream & str,
const
IdString
& obj );
123
125
inline
bool
operator==
(
const
IdString
& lhs,
const
IdString
& rhs )
126
{
return
lhs.
compareEQ
( rhs ); }
128
inline
bool
operator==
(
const
IdString
& lhs,
const
char
* rhs )
129
{
return
lhs.
compare
( rhs ) == 0; }
131
inline
bool
operator==
(
const
IdString
& lhs,
const
std::string & rhs )
132
{
return
lhs.
compare
( rhs ) == 0; }
134
inline
bool
operator==
(
const
char
* lhs,
const
IdString
& rhs )
135
{
return
rhs.
compare
( lhs ) == 0; }
137
inline
bool
operator==
(
const
std::string & lhs,
const
IdString
& rhs )
138
{
return
rhs.
compare
( lhs ) == 0; }
139
141
inline
bool
operator!=
(
const
IdString
& lhs,
const
IdString
& rhs )
142
{
return
! lhs.
compareEQ
( rhs ); }
144
inline
bool
operator!=
(
const
IdString
& lhs,
const
char
* rhs )
145
{
return
lhs.
compare
( rhs ) != 0; }
147
inline
bool
operator!=
(
const
IdString
& lhs,
const
std::string & rhs )
148
{
return
lhs.
compare
( rhs ) != 0; }
150
inline
bool
operator!=
(
const
char
* lhs,
const
IdString
& rhs )
151
{
return
rhs.
compare
( lhs ) != 0; }
153
inline
bool
operator!=
(
const
std::string & lhs,
const
IdString
& rhs )
154
{
return
rhs.
compare
( lhs ) != 0; }
155
157
inline
bool
operator<
(
const
IdString
& lhs,
const
IdString
& rhs )
158
{
return
lhs.
compare
( rhs ) < 0; }
160
inline
bool
operator<
(
const
IdString
& lhs,
const
char
* rhs )
161
{
return
lhs.
compare
( rhs ) < 0; }
163
inline
bool
operator<
(
const
IdString
& lhs,
const
std::string & rhs )
164
{
return
lhs.
compare
( rhs ) < 0; }
166
inline
bool
operator<
(
const
char
* lhs,
const
IdString
& rhs )
167
{
return
rhs.
compare
( lhs ) >= 0; }
169
inline
bool
operator<
(
const
std::string & lhs,
const
IdString
& rhs )
170
{
return
rhs.
compare
( lhs ) >= 0; }
171
173
inline
bool
operator<=
(
const
IdString
& lhs,
const
IdString
& rhs )
174
{
return
lhs.
compare
( rhs ) <= 0; }
176
inline
bool
operator<=
(
const
IdString
& lhs,
const
char
* rhs )
177
{
return
lhs.
compare
( rhs ) <= 0; }
179
inline
bool
operator<=
(
const
IdString
& lhs,
const
std::string & rhs )
180
{
return
lhs.
compare
( rhs ) <= 0; }
182
inline
bool
operator<=
(
const
char
* lhs,
const
IdString
& rhs )
183
{
return
rhs.
compare
( lhs ) > 0; }
185
inline
bool
operator<=
(
const
std::string & lhs,
const
IdString
& rhs )
186
{
return
rhs.
compare
( lhs ) > 0; }
187
189
inline
bool
operator>
(
const
IdString
& lhs,
const
IdString
& rhs )
190
{
return
lhs.
compare
( rhs ) > 0; }
192
inline
bool
operator>
(
const
IdString
& lhs,
const
char
* rhs )
193
{
return
lhs.
compare
( rhs ) > 0; }
195
inline
bool
operator>
(
const
IdString
& lhs,
const
std::string & rhs )
196
{
return
lhs.
compare
( rhs ) > 0; }
198
inline
bool
operator>
(
const
char
* lhs,
const
IdString
& rhs )
199
{
return
rhs.
compare
( lhs ) <= 0; }
201
inline
bool
operator>
(
const
std::string & lhs,
const
IdString
& rhs )
202
{
return
rhs.
compare
( lhs ) <= 0; }
203
205
inline
bool
operator>=
(
const
IdString
& lhs,
const
IdString
& rhs )
206
{
return
lhs.
compare
( rhs ) >= 0; }
208
inline
bool
operator>=
(
const
IdString
& lhs,
const
char
* rhs )
209
{
return
lhs.
compare
( rhs ) >= 0; }
211
inline
bool
operator>=
(
const
IdString
& lhs,
const
std::string & rhs )
212
{
return
lhs.
compare
( rhs ) >= 0; }
214
inline
bool
operator>=
(
const
char
* lhs,
const
IdString
& rhs )
215
{
return
rhs.
compare
( lhs ) < 0; }
217
inline
bool
operator>=
(
const
std::string & lhs,
const
IdString
& rhs )
218
{
return
rhs.
compare
( lhs ) < 0; }
219
221
}
// namespace zypp
223
224
ZYPP_DEFINE_ID_HASHABLE
( ::
zypp::IdString
);
225
226
#endif // ZYPP_SAT_IDSTR_H
zypp
IdString.h
Generated by
1.8.2