libzypp 17.38.14
httpheader.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*/
10#ifndef ZYPP_CURL_NG_NETWORK_HTTPHEADER_H_INCLUDED
11#define ZYPP_CURL_NG_NETWORK_HTTPHEADER_H_INCLUDED
12
13#include <string>
15
16namespace zyppng
17{
22 {
23 public:
24 HttpHeader( std::string key_r, std::string value_r )
25 : _key { zypp::str::trim( key_r ) }
26 , _value { zypp::str::trim( value_r ) }
27 {}
28
29 const std::string & key() const { return _key; }
30 const std::string & value() const { return _value; }
31
39 std::string asString() const
40 { return _key + ": " + _value; }
41
42 static std::string asString( std::string key_r, std::string value_r )
43 { return HttpHeader( key_r, value_r ).asString(); }
44
45 private:
46 std::string _key;
47 std::string _value;
48 };
49} // namespace zyppng
50#endif // ZYPP_CURL_NG_NETWORK_HTTPHEADER_H_INCLUDED
std::string asString() const
Return valid HTTP header string.
Definition httpheader.h:39
std::string _value
Definition httpheader.h:47
static std::string asString(std::string key_r, std::string value_r)
Definition httpheader.h:42
const std::string & key() const
Definition httpheader.h:29
std::string _key
Definition httpheader.h:46
HttpHeader(std::string key_r, std::string value_r)
Definition httpheader.h:24
const std::string & value() const
Definition httpheader.h:30
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.