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
proxyinfo
CredentialFileReader.cc
CredentialFileReader.h
CredentialManager.cc
CredentialManager.h
CurlConfig.cc
CurlConfig.h
MediaAccess.cc
MediaAccess.h
MediaAria2c.cc
MediaAria2c.h
MediaBlockList.cc
MediaBlockList.h
MediaCD.cc
MediaCD.h
MediaCIFS.cc
MediaCIFS.h
MediaCurl.cc
MediaCurl.h
MediaDIR.cc
MediaDIR.h
MediaDISK.cc
MediaDISK.h
MediaException.cc
MediaException.h
MediaHandler.cc
MediaHandler.h
MediaISO.cc
MediaISO.h
MediaManager.cc
MediaManager.h
MediaMultiCurl.cc
MediaMultiCurl.h
MediaNFS.cc
MediaNFS.h
MediaPlugin.cc
MediaPlugin.h
MediaPriority.cc
MediaPriority.h
MediaSource.cc
MediaSource.h
MediaUserAuth.cc
MediaUserAuth.h
MetaLinkParser.cc
MetaLinkParser.h
Mount.cc
Mount.h
ProxyInfo.cc
ProxyInfo.h
TransferSettings.cc
TransferSettings.h
UrlResolverPlugin.cc
UrlResolverPlugin.h
ZsyncParser.cc
ZsyncParser.h
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
MediaManager.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_MEDIA_MEDIAMANAGER_H
13
#define ZYPP_MEDIA_MEDIAMANAGER_H
14
15
#include "
zypp/media/MediaAccess.h
"
16
17
#include "
zypp/APIConfig.h
"
18
#include "
zypp/base/NonCopyable.h
"
19
#include "
zypp/base/PtrTypes.h
"
20
#include "
zypp/Pathname.h
"
21
#include "
zypp/Url.h
"
22
23
#include <list>
24
25
27
namespace
zypp
28
{
29
31
namespace
media
32
{
33
34
36
typedef
zypp::RW_pointer<MediaAccess>
MediaAccessRef
;
37
38
// OBSOLETE HERE:
39
typedef
MediaAccessId
MediaId
;
40
typedef
unsigned
int
MediaNr
;
41
42
44
// forward declaration
45
class
MountEntry
;
46
class
MediaManager_Impl
;
47
49
//
50
// CLASS NAME : MediaVerifierBase
51
//
55
class
MediaVerifierBase
//: private zypp::NonCopyable
56
{
57
public
:
58
MediaVerifierBase
()
59
{}
60
61
virtual
62
~MediaVerifierBase
()
63
{}
64
69
virtual
std::string
70
info
()
const
;
71
72
/*
73
** Check if the specified attached media contains
74
** the desired media (e.g. SLES10 CD1).
75
*/
76
virtual
bool
77
isDesiredMedia
(
const
MediaAccessRef
&ref) = 0;
78
};
79
80
82
//
83
// CLASS NAME : NoVerifier
84
//
88
class
NoVerifier
:
public
MediaVerifierBase
89
{
90
public
:
91
NoVerifier
():
MediaVerifierBase
()
92
{}
93
94
virtual
95
~NoVerifier
()
96
{}
97
101
virtual
std::string
102
info
()
const
;
103
104
/*
105
** Don't check if the specified attached media contains
106
** the desired media number. Always return true.
107
*/
108
virtual
bool
109
isDesiredMedia
(
const
MediaAccessRef
&ref)
110
{
111
(void)ref;
112
return
true
;
113
}
114
};
115
116
118
//
119
// CLASS NAME : MediaVerifierRef
120
//
124
typedef
zypp::RW_pointer<MediaVerifierBase>
MediaVerifierRef
;
125
126
128
//
129
// CLASS NAME : MediaManager
130
//
471
class
MediaManager
:
private
zypp::base::NonCopyable
472
{
473
public
:
485
MediaManager
();
486
491
~MediaManager
();
492
513
MediaAccessId
514
open
(
const
Url
&
url
,
const
Pathname & preferred_attach_point =
""
);
515
520
void
521
close
(
MediaAccessId
accessId);
522
529
bool
530
isOpen
(
MediaAccessId
accessId)
const
;
531
541
std::string
542
protocol
(
MediaAccessId
accessId)
const
;
543
549
bool
550
downloads
(
MediaAccessId
accessId)
const
;
551
553
static
554
ZYPP_DEPRECATED
bool
downloads
(
const
Url
&url)
555
{
return
url.
schemeIsDownloading
(); }
556
564
Url
565
url
(
MediaAccessId
accessId)
const
;
566
567
public
:
576
void
577
addVerifier
(
MediaAccessId
accessId,
578
const
MediaVerifierRef
&
verifier
);
579
587
void
588
delVerifier
(
MediaAccessId
accessId);
589
590
public
:
603
bool
604
setAttachPrefix
(
const
Pathname &attach_prefix);
605
615
void
616
attach
(
MediaAccessId
accessId);
617
619
ZYPP_DEPRECATED
void
attachDesiredMedia
(
MediaAccessId
accessId)
620
{
attach
( accessId ); }
621
633
void
634
release
(
MediaAccessId
accessId,
const
std::string & ejectDev =
""
);
635
639
void
640
releaseAll
();
641
656
void
657
disconnect
(
MediaAccessId
accessId);
658
666
bool
667
isAttached
(
MediaAccessId
accessId)
const
;
668
677
bool
678
isSharedMedia
(
MediaAccessId
accessId)
const
;
679
689
bool
690
isDesiredMedia
(
MediaAccessId
accessId)
const
;
691
702
bool
703
isDesiredMedia
(
MediaAccessId
accessId,
704
const
MediaVerifierRef
&
verifier
)
const
;
705
717
bool
718
isChangeable
(
MediaAccessId
accessId);
719
732
Pathname
733
localRoot
(
MediaAccessId
accessId)
const
;
734
747
Pathname
748
localPath
(
MediaAccessId
accessId,
const
Pathname & pathname)
const
;
749
750
public
:
769
void
770
provideFile
(
MediaAccessId
accessId,
771
const
Pathname &filename )
const
;
772
776
void
777
provideDir
(
MediaAccessId
accessId,
778
const
Pathname &dirname)
const
;
779
783
void
784
provideDirTree
(
MediaAccessId
accessId,
785
const
Pathname &dirname)
const
;
786
790
void
791
releaseFile
(
MediaAccessId
accessId,
792
const
Pathname &filename)
const
;
793
797
void
798
releaseDir
(
MediaAccessId
accessId,
799
const
Pathname &dirname)
const
;
800
804
void
805
releasePath
(
MediaAccessId
accessId,
806
const
Pathname &pathname)
const
;
807
811
void
812
dirInfo
(
MediaAccessId
accessId,
813
std::list<std::string> &retlist,
814
const
Pathname &dirname,
815
bool
dots =
true
)
const
;
816
820
void
821
dirInfo
(
MediaAccessId
accessId,
822
filesystem::DirContent
&retlist,
823
const
Pathname &dirname,
824
bool
dots =
true
)
const
;
825
829
bool
doesFileExist
(
MediaAccessId
accessId,
830
const
Pathname & filename )
const
;
831
841
void
842
getDetectedDevices
(
MediaAccessId
accessId,
843
std::vector<std::string> & devices,
844
unsigned
int
& index)
const
;
845
846
void
847
setDeltafile
(
MediaAccessId
accessId,
848
const
Pathname &filename )
const
;
849
850
public
:
855
static
time_t
856
getMountTableMTime
();
857
862
static
std::vector<MountEntry>
863
getMountEntries
();
864
874
bool
875
isUseableAttachPoint
(
const
Pathname &path,
876
bool
mtab=
true
)
const
;
877
878
private
:
879
friend
class
MediaHandler
;
880
890
AttachedMedia
891
getAttachedMedia
(
MediaAccessId
&accessId)
const
;
892
902
AttachedMedia
903
findAttachedMedia
(
const
MediaSourceRef
&media)
const
;
904
913
void
914
forceReleaseShared
(
const
MediaSourceRef
&media);
915
916
private
:
920
static
zypp::RW_pointer<MediaManager_Impl>
m_impl
;
921
};
922
923
925
}
// namespace media
927
929
}
// namespace zypp
931
932
#endif // ZYPP_MEDIA_MEDIAMANAGER_H
933
934
/*
935
** vim: set ts=2 sts=2 sw=2 ai et:
936
*/
zypp
media
MediaManager.h
Generated by
1.8.2