libzypp: zypp-curl/ng/network/httpheader.h Source File

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>
14#include <zypp-core/base/String.h>
15
16namespace zyppng
17{
21 class HttpHeader
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
String.h
zyppng::HttpHeader::asString
std::string asString() const
Return valid HTTP header string.
Definition httpheader.h:39
zyppng::HttpHeader::_value
std::string _value
Definition httpheader.h:47
zyppng::HttpHeader::asString
static std::string asString(std::string key_r, std::string value_r)
Definition httpheader.h:42
zyppng::HttpHeader::key
const std::string & key() const
Definition httpheader.h:29
zyppng::HttpHeader::_key
std::string _key
Definition httpheader.h:46
zyppng::HttpHeader::HttpHeader
HttpHeader(std::string key_r, std::string value_r)
Definition httpheader.h:24
zyppng::HttpHeader::value
const std::string & value() const
Definition httpheader.h:30
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zyppng
Definition MediaNetworkRequestExecutor.h:16