ATLAS Offline Software
Classes | Static Public Member Functions | Private Member Functions | List of all members
VP1MD5Sum Class Reference

#include <VP1MD5Sum.h>

Collaboration diagram for VP1MD5Sum:

Classes

class  Imp
 

Static Public Member Functions

static QByteArray sum (const QString &filename)
 
static bool sumMatches (const QString &filename, const QByteArray &md5sum)
 
static bool sumMatches (const QString &filename, const QString &md5sum)
 
static QString sumToString (const QByteArray &)
 
static QByteArray sumToByteArray (const QString &)
 
static bool validMD5Sum (const QString &)
 
static QString sumToStandardFormat (const QString &)
 

Private Member Functions

 VP1MD5Sum ()
 
 ~VP1MD5Sum ()
 

Detailed Description

Definition at line 24 of file VP1MD5Sum.h.

Constructor & Destructor Documentation

◆ VP1MD5Sum()

VP1MD5Sum::VP1MD5Sum ( )
private

◆ ~VP1MD5Sum()

VP1MD5Sum::~VP1MD5Sum ( )
private

Member Function Documentation

◆ sum()

QByteArray VP1MD5Sum::sum ( const QString &  filename)
static

Definition at line 28 of file VP1MD5Sum.cxx.

29 {
30  if (!Imp::fileok(filename))
31  return QByteArray();
32  bool ok;
33  QByteArray arr = Imp::actualMd5Sum(filename,ok);
34  return ok ? arr : QByteArray();
35 }

◆ sumMatches() [1/2]

bool VP1MD5Sum::sumMatches ( const QString &  filename,
const QByteArray &  md5sum 
)
static

Definition at line 38 of file VP1MD5Sum.cxx.

39 {
40  if (targetmd5sum.isEmpty()||!Imp::fileok(filename))
41  return false;
42  bool ok;
43  return targetmd5sum==Imp::actualMd5Sum(filename,ok) && ok;
44 }

◆ sumMatches() [2/2]

bool VP1MD5Sum::sumMatches ( const QString &  filename,
const QString &  md5sum 
)
static

Definition at line 47 of file VP1MD5Sum.cxx.

48 {
49  return sumMatches( filename, sumToByteArray(md5sum) );
50 }

◆ sumToByteArray()

QByteArray VP1MD5Sum::sumToByteArray ( const QString &  str)
static

Definition at line 82 of file VP1MD5Sum.cxx.

83 {
84  return QByteArray::fromHex(str.toUtf8());
85 }

◆ sumToStandardFormat()

QString VP1MD5Sum::sumToStandardFormat ( const QString &  sum)
static

Definition at line 96 of file VP1MD5Sum.cxx.

97 {
98  return sum.simplified().toLower();
99 }

◆ sumToString()

QString VP1MD5Sum::sumToString ( const QByteArray &  ba)
static

Definition at line 76 of file VP1MD5Sum.cxx.

77 {
78  return ba.toHex();
79 }

◆ validMD5Sum()

bool VP1MD5Sum::validMD5Sum ( const QString &  sum)
static

Definition at line 88 of file VP1MD5Sum.cxx.

89 {
90  if (sum.count()!=32)
91  return false;
92  return QRegExp("[0-9a-z]*").exactMatch(sum.toLower());
93 }

The documentation for this class was generated from the following files:
VP1MD5Sum::sum
static QByteArray sum(const QString &filename)
Definition: VP1MD5Sum.cxx:28
VP1MD5Sum::Imp::fileok
static bool fileok(const QString &filename)
Definition: VP1MD5Sum.cxx:53
VP1MD5Sum::Imp::actualMd5Sum
static QByteArray actualMd5Sum(const QString &filename, bool &ok)
Definition: VP1MD5Sum.cxx:60
VP1MD5Sum::sumMatches
static bool sumMatches(const QString &filename, const QByteArray &md5sum)
Definition: VP1MD5Sum.cxx:38
VP1MD5Sum::sumToByteArray
static QByteArray sumToByteArray(const QString &)
Definition: VP1MD5Sum.cxx:82
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
str
Definition: BTagTrackIpAccessor.cxx:11