XRootD
Loading...
Searching...
No Matches
XrdClHttp::ChecksumInfo Class Reference

#include <XrdClHttpChecksum.hh>

Collaboration diagram for XrdClHttp::ChecksumInfo:

Public Member Functions

const std::array< unsigned char, g_max_checksum_length > & Get (ChecksumType ctype) const
std::tuple< ChecksumType, std::array< unsigned char, g_max_checksum_length >, bool > GetFirst () const
bool IsSet (ChecksumType ctype) const
bool Set (ChecksumType ctype, const std::array< unsigned char, g_max_checksum_length > &value)

Detailed Description

Definition at line 101 of file XrdClHttpChecksum.hh.

Member Function Documentation

◆ Get()

const std::array< unsigned char, g_max_checksum_length > & XrdClHttp::ChecksumInfo::Get ( ChecksumType ctype) const
inline

Definition at line 119 of file XrdClHttpChecksum.hh.

119 {
120 if ((ctype == ChecksumType::kUnknown) || (ctype == ChecksumType::kAll))
121 ctype = ChecksumType::kCRC32C;
122 return checksums[static_cast<size_t>(ctype)].value;
123 }

References XrdClHttp::kAll, XrdClHttp::kCRC32C, and XrdClHttp::kUnknown.

◆ GetFirst()

std::tuple< ChecksumType, std::array< unsigned char, g_max_checksum_length >, bool > XrdClHttp::ChecksumInfo::GetFirst ( ) const
inline

Definition at line 137 of file XrdClHttpChecksum.hh.

137 {
138 for (int idx=0; idx < static_cast<int>(ChecksumType::kAll); ++idx) {
139 if (checksums[idx].type != ChecksumType::kUnknown) {
140 return std::make_tuple(static_cast<ChecksumType>(idx), checksums[idx].value, true);
141 }
142 }
143 return std::make_tuple(ChecksumType::kUnknown, std::array<unsigned char, g_max_checksum_length>(), false);
144 }

References XrdClHttp::kAll, and XrdClHttp::kUnknown.

◆ IsSet()

bool XrdClHttp::ChecksumInfo::IsSet ( ChecksumType ctype) const
inline

Definition at line 107 of file XrdClHttpChecksum.hh.

107 {
108 if ((ctype == ChecksumType::kUnknown) || (ctype == ChecksumType::kAll)) return false;
109 return checksums[static_cast<size_t>(ctype)].type != ChecksumType::kUnknown;
110 }

References XrdClHttp::kAll, and XrdClHttp::kUnknown.

◆ Set()

bool XrdClHttp::ChecksumInfo::Set ( ChecksumType ctype,
const std::array< unsigned char, g_max_checksum_length > & value )
inline

Definition at line 128 of file XrdClHttpChecksum.hh.

128 {
129 if ((ctype == ChecksumType::kUnknown) || (ctype == ChecksumType::kAll)) return false;
130 checksums[static_cast<size_t>(ctype)] = ChecksumEntry{ctype, value};
131 return true;
132 }

References XrdClHttp::kAll, and XrdClHttp::kUnknown.

Referenced by XrdClHttp::HeaderParser::ParseDigest().

Here is the caller graph for this function:

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