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
hal
HalContext.cc
HalContext.h
HalException.h
modalias
rpm
CommitPackageCache.cc
CommitPackageCache.h
CommitPackageCacheImpl.cc
CommitPackageCacheImpl.h
CommitPackageCacheReadAhead.cc
CommitPackageCacheReadAhead.h
HardLocksFile.cc
HardLocksFile.h
RequestedLocalesFile.cc
RequestedLocalesFile.h
SoftLocksFile.cc
SoftLocksFile.h
TargetCallbackReceiver.cc
TargetCallbackReceiver.h
TargetException.cc
TargetException.h
TargetImpl.cc
TargetImpl.h
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
HalContext.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
13
#ifndef ZYPP_TARGET_HAL_HALCONTEXT_H
14
#define ZYPP_TARGET_HAL_HALCONTEXT_H
15
16
#include "
zypp/target/hal/HalException.h
"
17
#include "
zypp/base/PtrTypes.h
"
18
#include <string>
19
#include <vector>
20
#include <stdint.h>
21
23
namespace
zypp
24
{
25
26
namespace
target
27
{
28
29
namespace
hal
30
{
31
32
33
// -------------------------------------------------------------
37
class
HalDrive;
38
class
HalVolume;
39
40
class
HalDrive_Impl;
41
class
HalVolume_Impl;
42
class
HalContext_Impl;
46
47
//
48
// CLASS NAME : HalContext
49
//
57
class
HalContext
58
{
59
public
:
60
typedef
61
zypp::RW_pointer<HalContext_Impl>::unspecified_bool_type
bool_type
;
62
63
HalContext
(
bool
autoconnect=
false
);
64
HalContext
(
const
HalContext
&context);
65
~HalContext
();
66
67
HalContext
&
68
operator=
(
const
HalContext
&context);
69
73
operator
bool_type
()
const
;
74
77
void
78
connect
();
79
84
std::vector<std::string>
85
getAllDevices
()
const
;
86
92
HalDrive
93
getDriveFromUDI
(
const
std::string &udi)
const
;
94
100
HalVolume
101
getVolumeFromUDI
(
const
std::string &udi)
const
;
102
103
HalVolume
104
getVolumeFromDeviceFile
(
const
std::string &device_file)
const
;
105
111
std::vector<std::string>
112
findDevicesByCapability
(
const
std::string &capability)
const
;
113
114
bool
115
getDevicePropertyBool
(
const
std::string &udi,
116
const
std::string &key)
const
;
117
118
int32_t
119
getDevicePropertyInt32
(
const
std::string &udi,
120
const
std::string &key)
const
;
121
122
uint64_t
123
getDevicePropertyUInt64
(
const
std::string &udi,
124
const
std::string &key)
const
;
125
126
double
127
getDevicePropertyDouble
(
const
std::string &udi,
128
const
std::string &key)
const
;
129
130
std::string
131
getDevicePropertyString
(
const
std::string &udi,
132
const
std::string &key)
const
;
133
134
void
135
setDevicePropertyBool
(
const
std::string &udi,
136
const
std::string &key,
137
bool
value);
138
139
void
140
setDevicePropertyInt32
(
const
std::string &udi,
141
const
std::string &key,
142
int32_t value);
143
144
void
145
setDevicePropertyUInt64
(
const
std::string &udi,
146
const
std::string &key,
147
uint64_t value);
148
149
void
150
setDevicePropertyDouble
(
const
std::string &udi,
151
const
std::string &key,
152
double
value);
153
154
void
155
setDevicePropertyString
(
const
std::string &udi,
156
const
std::string &key,
157
const
std::string &value);
158
159
void
160
removeDeviceProperty
(
const
std::string &udi,
161
const
std::string &key);
162
163
private
:
164
165
zypp::RW_pointer<HalContext_Impl>
h_impl
;
166
};
167
168
170
//
171
// CLASS NAME : HalDrive
172
//
177
class
HalDrive
178
{
179
public
:
180
typedef
181
zypp::RW_pointer<HalDrive_Impl>::unspecified_bool_type
bool_type
;
182
183
HalDrive
();
184
HalDrive
(
const
HalDrive
&drive);
185
~HalDrive
();
186
187
HalDrive
&
188
operator=
(
const
HalDrive
&drive);
189
190
operator
bool_type
()
const
;
191
192
std::string
193
getUDI
()
const
;
194
195
std::string
196
getTypeName
()
const
;
197
201
std::string
202
getDeviceFile
()
const
;
203
207
unsigned
int
208
getDeviceMajor
()
const
;
209
213
unsigned
int
214
getDeviceMinor
()
const
;
215
219
bool
220
usesRemovableMedia
()
const
;
221
222
/*
223
** Returns the media type names supported by the drive.
224
**
225
** Since hal does not implement a textual form here, we
226
** are using the drive type and property names from
227
** "storage.cdrom.*" namespace:
228
** cdrom, cdr, cdrw, dvd, dvdr, dvdrw, dvdram,
229
** dvdplusr, dvdplusrw, dvdplusrdl
230
**
231
** FIXME: Should we provide own LibHalDriveCdromCaps?
232
*/
233
std::vector<std::string>
234
getCdromCapabilityNames
()
const
;
235
240
std::vector<std::string>
241
findAllVolumes
()
const
;
242
243
private
:
244
friend
class
HalContext
;
245
246
HalDrive
(
HalDrive_Impl
*impl);
247
248
zypp::RW_pointer<HalDrive_Impl>
d_impl
;
249
};
250
251
253
//
254
// CLASS NAME : HalVolume
255
//
260
class
HalVolume
261
{
262
public
:
263
typedef
264
zypp::RW_pointer<HalVolume_Impl>::unspecified_bool_type
bool_type
;
265
266
HalVolume
();
267
HalVolume
(
const
HalVolume
&volume);
268
~HalVolume
();
269
270
HalVolume
&
271
operator=
(
const
HalVolume
&volume);
272
273
operator
bool_type
()
const
;
274
275
std::string
276
getUDI
()
const
;
277
281
std::string
282
getDeviceFile
()
const
;
283
287
unsigned
int
288
getDeviceMajor
()
const
;
289
293
unsigned
int
294
getDeviceMinor
()
const
;
295
296
bool
297
isDisc
()
const
;
298
299
bool
300
isPartition
()
const
;
301
302
bool
303
isMounted
()
const
;
304
308
std::string
309
getFSType
()
const
;
310
314
std::string
315
getFSUsage
()
const
;
316
320
std::string
321
getMountPoint
()
const
;
322
323
private
:
324
friend
class
HalContext
;
325
friend
class
HalDrive
;
326
HalVolume
(
HalVolume_Impl
*impl);
327
328
zypp::RW_pointer<HalVolume_Impl>
v_impl
;
329
};
330
331
333
}
// namespace hal
336
}
// namespace target
339
}
// namespace zypp
341
342
#endif // ZYPP_TARGET_HAL_HALCONTEXT_H
343
344
/*
345
** vim: set ts=2 sts=2 sw=2 ai et:
346
*/
zypp
target
hal
HalContext.h
Generated by
1.8.2