Audacity 3.2.0
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
audacity::network_manager::Request Class Referencefinal

#include <Request.h>

Collaboration diagram for audacity::network_manager::Request:
[legend]

Public Types

using Timeout = std::chrono::milliseconds
 

Public Member Functions

 Request ()=default
 
 Request (std::string url) noexcept
 
 Request (const Request &)=default
 
 Request (Request &&)=default
 
Requestoperator= (const Request &)=default
 
Requestoperator= (Request &&)=default
 
RequestsetURL (std::string url) noexcept
 
const std::string & getURL () const noexcept
 
RequestsetHeader (const std::string &name, std::string value)
 
std::string getHeader (const std::string &name) const
 
const HeadersListgetHeaders () const noexcept
 
RequestsetCookie (const std::string &name, std::string value)
 
RequestappendCookies (const CookiesList &list)
 
std::string getCookie (const std::string &name) const
 
const CookiesListgetCookies () noexcept
 
RequestsetMaxRedirects (size_t redirects) noexcept
 
size_t getMaxRedirects () const noexcept
 
RequestsetTimeout (Timeout timeout) noexcept
 
Timeout getTimeout () const noexcept
 

Static Public Attributes

static constexpr size_t INFINITE_REDIRECTS = std::numeric_limits<size_t>::max()
 

Private Attributes

std::string mUrl
 
HeadersList mHeaders
 
CookiesList mCookies
 
size_t mMaxRedirects { INFINITE_REDIRECTS }
 
Timeout mTimeout { std::chrono::seconds (5) }
 

Detailed Description

Definition at line 27 of file Request.h.

Member Typedef Documentation

◆ Timeout

using audacity::network_manager::Request::Timeout = std::chrono::milliseconds

Definition at line 30 of file Request.h.

Constructor & Destructor Documentation

◆ Request() [1/4]

audacity::network_manager::Request::Request ( )
default

◆ Request() [2/4]

Request::Request ( std::string  url)
explicitnoexcept

Definition at line 29 of file Request.cpp.

30 : mUrl (std::move (url))
31{
32}

◆ Request() [3/4]

audacity::network_manager::Request::Request ( const Request )
default

◆ Request() [4/4]

audacity::network_manager::Request::Request ( Request &&  )
default

Member Function Documentation

◆ appendCookies()

Request & Request::appendCookies ( const CookiesList list)

Definition at line 103 of file Request.cpp.

104{
105 for (const Cookie& cookie : list)
106 {
107 if (!cookie.isExpired())
108 mCookies.setCookie (cookie);
109 }
110
111 return *this;
112}
void setCookie(const Cookie &cookie)

References mCookies, and audacity::network_manager::CookiesList::setCookie().

Here is the call graph for this function:

◆ getCookie()

std::string Request::getCookie ( const std::string &  name) const

Definition at line 70 of file Request.cpp.

71{
73}
wxString name
Definition: TagsEditor.cpp:166
std::string getCookieValue(const std::string &cookieName) const

References audacity::network_manager::CookiesList::getCookieValue(), mCookies, and name.

Here is the call graph for this function:

◆ getCookies()

const CookiesList & Request::getCookies ( )
noexcept

Definition at line 75 of file Request.cpp.

76{
77 return mCookies;
78}

References mCookies.

Referenced by audacity::network_manager::CurlResponse::perform().

Here is the caller graph for this function:

◆ getHeader()

std::string Request::getHeader ( const std::string &  name) const

Definition at line 53 of file Request.cpp.

54{
56}
std::string getHeaderValue(const std::string &headerName) const

References audacity::network_manager::HeadersList::getHeaderValue(), mHeaders, and name.

Here is the call graph for this function:

◆ getHeaders()

const HeadersList & Request::getHeaders ( ) const
noexcept

Definition at line 58 of file Request.cpp.

59{
60 return mHeaders;
61}

References mHeaders.

Referenced by audacity::network_manager::CurlResponse::perform().

Here is the caller graph for this function:

◆ getMaxRedirects()

size_t Request::getMaxRedirects ( ) const
noexcept

Definition at line 87 of file Request.cpp.

88{
89 return mMaxRedirects;
90}

References mMaxRedirects.

Referenced by audacity::network_manager::CurlResponse::perform().

Here is the caller graph for this function:

◆ getTimeout()

Request::Timeout Request::getTimeout ( ) const
noexcept

Definition at line 98 of file Request.cpp.

99{
100 return mTimeout;
101}

References mTimeout.

Referenced by audacity::network_manager::CurlResponse::perform().

Here is the caller graph for this function:

◆ getURL()

const std::string & Request::getURL ( ) const
noexcept

Definition at line 41 of file Request.cpp.

42{
43 return mUrl;
44}

References mUrl.

Referenced by audacity::network_manager::CurlResponse::getURL(), and audacity::network_manager::CurlResponse::perform().

Here is the caller graph for this function:

◆ operator=() [1/2]

Request & audacity::network_manager::Request::operator= ( const Request )
default

◆ operator=() [2/2]

Request & audacity::network_manager::Request::operator= ( Request &&  )
default

◆ setCookie()

Request & Request::setCookie ( const std::string &  name,
std::string  value 
)

Definition at line 63 of file Request.cpp.

64{
65 mCookies.setCookie (name, std::move (value));
66
67 return *this;
68}

References mCookies, name, and audacity::network_manager::CookiesList::setCookie().

Here is the call graph for this function:

◆ setHeader()

Request & Request::setHeader ( const std::string &  name,
std::string  value 
)

◆ setMaxRedirects()

Request & Request::setMaxRedirects ( size_t  redirects)
noexcept

Definition at line 80 of file Request.cpp.

81{
82 mMaxRedirects = redirects;
83
84 return *this;
85}

◆ setTimeout()

Request & Request::setTimeout ( Timeout  timeout)
noexcept

Definition at line 92 of file Request.cpp.

93{
94 mTimeout = timeout;
95 return *this;
96}

◆ setURL()

Request & Request::setURL ( std::string  url)
noexcept

Definition at line 34 of file Request.cpp.

35{
36 mUrl = std::move (url);
37
38 return *this;
39}

Member Data Documentation

◆ INFINITE_REDIRECTS

constexpr size_t audacity::network_manager::Request::INFINITE_REDIRECTS = std::numeric_limits<size_t>::max()
staticconstexpr

Definition at line 32 of file Request.h.

◆ mCookies

CookiesList audacity::network_manager::Request::mCookies
private

Definition at line 67 of file Request.h.

Referenced by appendCookies(), getCookie(), getCookies(), and setCookie().

◆ mHeaders

HeadersList audacity::network_manager::Request::mHeaders
private

Definition at line 66 of file Request.h.

Referenced by getHeader(), getHeaders(), and setHeader().

◆ mMaxRedirects

size_t audacity::network_manager::Request::mMaxRedirects { INFINITE_REDIRECTS }
private

Definition at line 69 of file Request.h.

Referenced by getMaxRedirects().

◆ mTimeout

Timeout audacity::network_manager::Request::mTimeout { std::chrono::seconds (5) }
private

Definition at line 71 of file Request.h.

Referenced by getTimeout().

◆ mUrl

std::string audacity::network_manager::Request::mUrl
private

Definition at line 64 of file Request.h.

Referenced by getURL().


The documentation for this class was generated from the following files: