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
susetags
yum
Applydeltarpm.cc
Applydeltarpm.h
DeltaCandidates.cc
DeltaCandidates.h
Downloader.cc
Downloader.h
MediaInfoDownloader.cc
MediaInfoDownloader.h
PackageDelta.cc
PackageDelta.h
PackageProvider.cc
PackageProvider.h
PluginServices.cc
PluginServices.h
RepoException.cc
RepoException.h
RepoInfoBase.cc
RepoInfoBase.h
RepoInfoBaseImpl.h
RepoMirrorList.cc
RepoMirrorList.h
RepoProvideFile.cc
RepoProvideFile.h
RepoType.cc
RepoType.h
RepoVariables.cc
RepoVariables.h
ServiceRepos.cc
ServiceRepos.h
ServiceType.cc
ServiceType.h
SrcPackageProvider.cc
SrcPackageProvider.h
SUSEMediaVerifier.cc
SUSEMediaVerifier.h
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
PluginServices.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
9
#include <iostream>
10
#include <sstream>
11
#include "
zypp/base/Logger.h
"
12
#include "
zypp/base/Gettext.h
"
13
#include "
zypp/base/String.h
"
14
#include "
zypp/base/InputStream.h
"
15
#include "
zypp/base/UserRequestException.h
"
16
17
#include "
zypp/repo/PluginServices.h
"
18
#include "
zypp/ServiceInfo.h
"
19
#include "
zypp/RepoInfo.h
"
20
#include "
zypp/PathInfo.h
"
21
22
using
std::endl;
23
using
std::stringstream;
24
26
namespace
zypp
27
{
28
29
namespace
repo
30
{
31
32
class
PluginServices::Impl
33
{
34
public
:
35
static
void
loadServices
(
const
Pathname &path,
36
const
PluginServices::ProcessService
&callback );
37
};
38
39
void
PluginServices::Impl::loadServices
(
const
Pathname &path,
40
const
PluginServices::ProcessService
& callback
/*,
41
const ProgressData::ReceiverFnc &progress*/
)
42
{
43
std::list<Pathname> entries;
44
if
(PathInfo(path).isExist())
45
{
46
if
(
filesystem::readdir
( entries, path,
false
) != 0 )
47
{
48
// TranslatorExplanation '%s' is a pathname
49
ZYPP_THROW
(
Exception
(
str::form
(
_
(
"Failed to read directory '%s'"
), path.c_str())));
50
}
51
52
//str::regex allowedServiceExt("^\\.service(_[0-9]+)?$");
53
for_
(it, entries.begin(), entries.end() )
54
{
55
ServiceInfo
service_info;
56
service_info.
setAlias
((*it).basename());
57
Url
url
;
58
url.
setPathName
((*it).asString());
59
url.
setScheme
(
"file"
);
60
service_info.
setUrl
(url);
61
service_info.
setType
(
ServiceType::PLUGIN
);
62
service_info.
setAutorefresh
(
true
);
63
DBG
<<
"Plugin Service: "
<< service_info << endl;
64
callback(service_info);
65
}
66
67
}
68
}
69
70
PluginServices::PluginServices
(
const
Pathname &path,
71
const
ProcessService
& callback
/*,
72
const ProgressData::ReceiverFnc &progress */
)
73
{
74
Impl::loadServices
(path, callback
/*, progress*/
);
75
}
76
77
PluginServices::~PluginServices
()
78
{}
79
80
std::ostream &
operator<<
( std::ostream & str,
const
PluginServices
& obj )
81
{
82
return
str;
83
}
84
86
}
// namespace repo
89
}
// namespace zypp
zypp
repo
PluginServices.cc
Generated by
1.8.1