/usr/include/ui-utilcpp/http/URL.hpp is in libui-utilcpp-dev 1.8.5-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | /**
* @file
*/
#ifndef UI_UTIL_HTTP_URL_HPP
#define UI_UTIL_HTTP_URL_HPP
// STDC++
#include <string>
// C++ Libraries
#include <ui-utilcpp/http/Connection.hpp>
namespace UI {
namespace Util {
namespace Http {
/** @brief HTTP URL parser. @see RFC 2616, 3.2.2. */
class URL
{
private:
std::string const url_;
std::string host_;
unsigned int port_;
std::string path_;
public:
URL(std::string const & url);
/** @brief Add param to query part (auto-adds query part if not already added) */
URL & addParam(std::string const & key, std::string const & value);
/** @name Get original url string, host, port and path.
*
* @note Path includes the optional "query" and is prepared to be
* used as request URI.
*
* @{ */
std::string const & getHost() const;
unsigned int const & getPort() const;
std::string const & getPath() const;
std::string const getURL() const;
/** @} */
};
class URLGet
{
private:
URL const url_;
StatusLine status_;
Header header_;
std::string body_;
public:
URLGet(std::string const & url, long int const & timeout=0);
URL const & getURL() const;
StatusLine const & getStatus() const;
Header const & getHeader() const;
std::string const & getBody() const;
};
}}}
#endif
|