XRootD
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 113 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 131 of file XrdClHttpChecksum.hh.

131  {
132  if ((ctype == ChecksumType::kUnknown) || (ctype == ChecksumType::kAll))
133  ctype = ChecksumType::kCRC32C;
134  return checksums[static_cast<size_t>(ctype)].value;
135  }

◆ GetFirst()

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

Definition at line 149 of file XrdClHttpChecksum.hh.

149  {
150  for (int idx=0; idx < static_cast<int>(ChecksumType::kAll); ++idx) {
151  if (checksums[idx].type != ChecksumType::kUnknown) {
152  return std::make_tuple(static_cast<ChecksumType>(idx), checksums[idx].value, true);
153  }
154  }
155  return std::make_tuple(ChecksumType::kUnknown, std::array<unsigned char, g_max_checksum_length>(), false);
156  }

◆ IsSet()

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

Definition at line 119 of file XrdClHttpChecksum.hh.

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

◆ Set()

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

Definition at line 140 of file XrdClHttpChecksum.hh.

140  {
141  if ((ctype == ChecksumType::kUnknown) || (ctype == ChecksumType::kAll)) return false;
142  checksums[static_cast<size_t>(ctype)] = ChecksumEntry{ctype, value};
143  return true;
144  }

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

+ Here is the caller graph for this function:

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