LLDB mainline
Checksum.h
Go to the documentation of this file.
1//===-- Checksum.h ----------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_UTILITY_CHECKSUM_H
10#define LLDB_UTILITY_CHECKSUM_H
11
12#include "llvm/Support/MD5.h"
13
14namespace lldb_private {
15class Checksum {
16public:
17 static llvm::MD5::MD5Result g_sentinel;
18
19 Checksum(llvm::MD5::MD5Result md5 = g_sentinel);
20 Checksum(const Checksum &checksum);
21 Checksum &operator=(const Checksum &checksum);
22
23 explicit operator bool() const;
24 bool operator==(const Checksum &checksum) const;
25 bool operator!=(const Checksum &checksum) const;
26
27 std::string digest() const;
28
29private:
30 void SetMD5(llvm::MD5::MD5Result);
31
32 llvm::MD5::MD5Result m_checksum;
33};
34} // namespace lldb_private
35
36#endif // LLDB_UTILITY_CHECKSUM_H
Checksum & operator=(const Checksum &checksum)
Definition: Checksum.cpp:19
llvm::MD5::MD5Result m_checksum
Definition: Checksum.h:32
static llvm::MD5::MD5Result g_sentinel
Definition: Checksum.h:17
std::string digest() const
Definition: Checksum.cpp:39
bool operator==(const Checksum &checksum) const
Definition: Checksum.cpp:31
void SetMD5(llvm::MD5::MD5Result)
Definition: Checksum.cpp:24
bool operator!=(const Checksum &checksum) const
Definition: Checksum.cpp:35
A class that represents a running process on the host machine.