Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
audacity::network_manager::Header Struct Referencefinal

#include <HeadersList.h>

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

Public Member Functions

bool hasSameName (const Header &header) const
 
bool hasSameName (const std::string &name) const
 

Static Public Member Functions

static Header Parse (const std::string &header)
 

Public Attributes

std::string Name
 
std::string Value
 

Detailed Description

Definition at line 51 of file HeadersList.h.

Member Function Documentation

◆ hasSameName() [1/2]

bool Header::hasSameName ( const Header header) const

Definition at line 64 of file HeadersList.cpp.

65{
66 return hasSameName (header.Name);
67}
bool hasSameName(const Header &header) const
Definition: HeadersList.cpp:64

References hasSameName(), and Name.

Referenced by audacity::network_manager::CurlHandleManager::Handle::appendHeader(), hasSameName(), and audacity::network_manager::CurlResponse::HeaderCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasSameName() [2/2]

bool Header::hasSameName ( const std::string &  name) const

Definition at line 69 of file HeadersList.cpp.

70{
71 return std::equal (
72 name.begin (), name.end (),
73 Name.begin (), Name.end (),
74 [](const char leftChar, const char rightChar) {
75 return std::tolower (leftChar) == std::tolower (rightChar);
76 });
77}
const TranslatableString name
Definition: Distortion.cpp:76

References Name, and name.

◆ Parse()

Header Header::Parse ( const std::string &  header)
static

Definition at line 79 of file HeadersList.cpp.

80{
81 const size_t colonPosition = header.find (": ");
82
83 if (colonPosition == std::string::npos) // This can happen when we receive the first line of the response
84 return { header, std::string () };
85
86 return {
87 header.substr (0, colonPosition),
88 header.substr (colonPosition + 2)
89 };
90}
constexpr size_t npos(-1)

References Tuple::detail::npos().

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

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Name

std::string audacity::network_manager::Header::Name

◆ Value

std::string audacity::network_manager::Header::Value

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