15#include <zypp-media/MediaException>
42 std::string name =
url.getPathName();
44 if (
PathInfo(plugin_path).isExist()) {
46 scr.
open(plugin_path);
51 url::ParamMap::const_iterator param_it;
52 for( param_it = params.begin();
53 param_it != params.end();
55 f.
setHeader(param_it->first, param_it->second);
60 if (r.
command() ==
"RESOLVEDURL") {
68 std::pair<std::string, std::string> values(*it);
70 if (values.second.empty()) {
71 values.second =
"\r\nX-libcurl-Empty-Header-Workaround: *";
73 headers.insert(values);
76 else if (r.
command() ==
"ERROR") {
86 return str <<
"UrlResolverPlugin::Impl";
std::string asString() const
Command frame for communication with PluginScript.
HeaderList::const_iterator HeaderListIterator
Header list iterator.
const ByteArray & body() const
Return the frame body.
const std::string & command() const
Return the frame command.
HeaderListIterator headerEnd() const
Return iterator pointing behind the last header.
void setHeader(const std::string &key_r, const std::string &value_r=std::string())
Set header for key_r removing all other occurrences of key_r.
HeaderListIterator headerBegin() const
Return iterator pointing to the 1st header (or headerEnd)
Interface to plugin scripts using a Stomp inspired communication protocol.
PluginFrame receive() const
Receive a PluginFrame.
void send(const PluginFrame &frame_r) const
Send a PluginFrame.
void open()
Setup connection and execute script.
std::string getScheme() const
Returns the scheme name of the URL.
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
static ZConfig & instance()
Singleton ctor.
Wrapper class for stat/lstat.
String related utilities and Regular expression matching.
std::map< std::string, std::string > ParamMap
A parameter map container.
Easy-to use interface to the ZYPP dependency resolver.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.