12#ifndef ZYPP_CORE_PLUGINFRAME_H
13#define ZYPP_CORE_PLUGINFRAME_H
50 static const std::string & ackCommand();
52 static const std::string & errorCommand();
54 static const std::string & enomethodCommand();
56 static const std::string &contentLengthHeader();
106 const std::string & command()
const;
111 void setCommand(
const std::string &
command_r );
115 {
return command() == ackCommand(); }
119 {
return command() == errorCommand(); }
123 {
return command() == enomethodCommand(); }
139 void setBody(
const std::string &
body_r );
164 {
return headerList().empty(); }
168 {
return headerList().size(); }
172 {
return headerList().begin(); }
176 {
return headerList().end(); }
180 { headerList().clear(); }
185 {
return ! keyEmpty(
key_r ); }
189 {
return headerList().find(
key_r ) == headerEnd(); }
193 {
return headerList().count(
key_r ); }
197 {
return headerList().lower_bound(
key_r ); }
201 {
return headerList().upper_bound(
key_r ); }
208 const std::string & getHeader(
const std::string &
key_r )
const;
213 const std::string & getHeader(
const std::string &
key_r,
const std::string &
default_r )
const;
216 const std::string & getHeaderNT(
const std::string &
key_r,
const std::string &
default_r = std::string() )
const;
222 void setHeader(
const std::string &
key_r,
const std::string &
value_r = std::string() );
229 { headerList().clear(); addHeader(
contents_r ); }
235 void addHeader(
const std::string &
key_r,
const std::string &
value_r = std::string() );
237 void addHeader( HeaderInitializerList
contents_r );
243 void addRawHeader (
const ByteArray &header );
246 void clearHeader(
const std::string &
key_r );
252 std::ostream & writeTo( std::ostream &
stream_r )
const;
292 {
return( !
operator==( lhs, rhs ) ); }
RepoManager implementation.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Base class for PluginFrame Exception.
Command frame for communication with PluginScript.
HeaderList::const_iterator HeaderListIterator
Header list iterator.
const std::initializer_list< std::pair< std::string, std::string > > & HeaderInitializerList
HeaderListIterator keyBegin(const std::string &key_r) const
Return iterator pointing to the 1st header for key_r (or keyEnd(key_r))
void headerClear()
Clear the list of headers.
void setHeader(HeaderInitializerList contents_r)
Set a new header list.
bool headerEmpty() const
Whether header list is empty.
bool keyEmpty(const std::string &key_r) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned headerSize() const
Return size of the header list.
bool isErrorCommand() const
Convenience to identify an ERROR command.
std::istream & readFrom(std::istream &stream_r)
Read frame from stream.
bool keySize(const std::string &key_r) const
Return number of header entries for key_r.
std::ostream & dumpOn(std::ostream &str, const PluginFrame &obj)
Stream output writing all data for logging (no throw)
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
bool isEnomethodCommand() const
Convenience to identify an _ENOMETHOD command.
HeaderListIterator keyEnd(const std::string &key_r) const
Return iterator pointing behind the last header for key_r.
bool operator!=(const PluginFrame &lhs, const PluginFrame &rhs)
Comparison based on content.
static std::istream & readFrom(std::istream &stream_r, PluginFrame &frame_r)
static std::ostream & writeTo(std::ostream &stream_r, const PluginFrame &frame_r)
HeaderListIterator headerEnd() const
Return iterator pointing behind the last header.
std::multimap< std::string, std::string > HeaderList
The header list.
std::istream & operator>>(std::istream &str, PluginFrame &obj)
Construct from stream.
bool isAckCommand() const
Convenience to identify an ACK command.
HeaderListIterator headerBegin() const
Return iterator pointing to the 1st header (or headerEnd)
std::ostream & writeTo(std::ostream &stream_r) const
Write frame to stream.
bool hasKey(const std::string &key_r) const
Whether the header list contains at least one entry for key_r.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API