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
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
//
469
class
MediaManager
:
private
zypp::base::NonCopyable
470
{
471
public
:
483
MediaManager
();
484
489
~MediaManager
();
490
511
MediaAccessId
512
open
(
const
Url
&
url
,
const
Pathname & preferred_attach_point =
""
);
513
518
void
519
close
(
MediaAccessId
accessId);
520
527
bool
528
isOpen
(
MediaAccessId
accessId)
const
;
529
539
std::string
540
protocol
(
MediaAccessId
accessId)
const
;
541
547
bool
548
downloads
(
MediaAccessId
accessId)
const
;
549
551
static
552
ZYPP_DEPRECATED
bool
downloads
(
const
Url
&url)
553
{
return
url.
schemeIsDownloading
(); }
554
562
Url
563
url
(
MediaAccessId
accessId)
const
;
564
565
public
:
574
void
575
addVerifier
(
MediaAccessId
accessId,
576
const
MediaVerifierRef
&
verifier
);
577
585
void
586
delVerifier
(
MediaAccessId
accessId);
587
588
public
:
601
bool
602
setAttachPrefix
(
const
Pathname &attach_prefix);
603
613
void
614
attach
(
MediaAccessId
accessId);
615
617
ZYPP_DEPRECATED
void
attachDesiredMedia
(
MediaAccessId
accessId)
618
{
attach
( accessId ); }
619
631
void
632
release
(
MediaAccessId
accessId,
const
std::string & ejectDev =
""
);
633
637
void
638
releaseAll
();
639
654
void
655
disconnect
(
MediaAccessId
accessId);
656
664
bool
665
isAttached
(
MediaAccessId
accessId)
const
;
666
675
bool
676
isSharedMedia
(
MediaAccessId
accessId)
const
;
677
687
bool
688
isDesiredMedia
(
MediaAccessId
accessId)
const
;
689
700
bool
701
isDesiredMedia
(
MediaAccessId
accessId,
702
const
MediaVerifierRef
&
verifier
)
const
;
703
715
bool
716
isChangeable
(
MediaAccessId
accessId);
717
730
Pathname
731
localRoot
(
MediaAccessId
accessId)
const
;
732
745
Pathname
746
localPath
(
MediaAccessId
accessId,
const
Pathname & pathname)
const
;
747
748
public
:
767
void
768
provideFile
(
MediaAccessId
accessId,
769
const
Pathname &filename )
const
;
770
774
void
775
provideDir
(
MediaAccessId
accessId,
776
const
Pathname &dirname)
const
;
777
781
void
782
provideDirTree
(
MediaAccessId
accessId,
783
const
Pathname &dirname)
const
;
784
788
void
789
releaseFile
(
MediaAccessId
accessId,
790
const
Pathname &filename)
const
;
791
795
void
796
releaseDir
(
MediaAccessId
accessId,
797
const
Pathname &dirname)
const
;
798
802
void
803
releasePath
(
MediaAccessId
accessId,
804
const
Pathname &pathname)
const
;
805
809
void
810
dirInfo
(
MediaAccessId
accessId,
811
std::list<std::string> &retlist,
812
const
Pathname &dirname,
813
bool
dots =
true
)
const
;
814
818
void
819
dirInfo
(
MediaAccessId
accessId,
820
filesystem::DirContent
&retlist,
821
const
Pathname &dirname,
822
bool
dots =
true
)
const
;
823
827
bool
doesFileExist
(
MediaAccessId
accessId,
828
const
Pathname & filename )
const
;
829
839
void
840
getDetectedDevices
(
MediaAccessId
accessId,
841
std::vector<std::string> & devices,
842
unsigned
int
& index)
const
;
843
844
void
845
setDeltafile
(
MediaAccessId
accessId,
846
const
Pathname &filename )
const
;
847
848
public
:
853
static
time_t
854
getMountTableMTime
();
855
860
static
std::vector<MountEntry>
861
getMountEntries
();
862
872
bool
873
isUseableAttachPoint
(
const
Pathname &path,
874
bool
mtab=
true
)
const
;
875
876
private
:
877
friend
class
MediaHandler
;
878
888
AttachedMedia
889
getAttachedMedia
(
MediaAccessId
&accessId)
const
;
890
900
AttachedMedia
901
findAttachedMedia
(
const
MediaSourceRef
&media)
const
;
902
911
void
912
forceReleaseShared
(
const
MediaSourceRef
&media);
913
914
private
:
918
static
zypp::RW_pointer<MediaManager_Impl>
m_impl
;
919
};
920
921
923
}
// namespace media
925
927
}
// namespace zypp
929
930
#endif // ZYPP_MEDIA_MEDIAMANAGER_H
931
932
/*
933
** vim: set ts=2 sts=2 sw=2 ai et:
934
*/
zypp
media
MediaManager.h
Generated by
1.8.1