13#include <zypp/base/Logger.h>
15#include <zypp-media/MediaException>
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";
Command frame for communication with PluginScript.
const std::string & body() const
Return the frame body.
HeaderList::const_iterator HeaderListIterator
Header list iterator.
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.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
zypp::url::ParamMap getQueryStringMap(EEncoding eflag=zypp::url::E_DECODED) const
Returns a string map with query parameter and their values.
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
static ZConfig & instance()
Singleton ctor.
Wrapper class for stat/lstat.
bool isExist() const
Return whether valid stat info exists.
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.