Files
Aaru.Compression.Native/3rdparty/lzma/CPP/7zip/UI/Console/HashCon.h

59 lines
1.2 KiB
C
Raw Normal View History

2021-10-19 21:27:23 +01:00
// HashCon.h
2023-09-24 03:13:03 +01:00
#ifndef ZIP7_INC_HASH_CON_H
#define ZIP7_INC_HASH_CON_H
2021-10-19 21:27:23 +01:00
#include "../Common/HashCalc.h"
#include "UpdateCallbackConsole.h"
2023-09-24 03:13:03 +01:00
class CHashCallbackConsole Z7_final:
public IHashCallbackUI,
public CCallbackConsoleBase
2021-10-19 21:27:23 +01:00
{
2023-09-24 03:13:03 +01:00
Z7_IFACE_IMP(IDirItemsCallback)
Z7_IFACE_IMP(IHashCallbackUI)
2021-10-19 21:27:23 +01:00
UString _fileName;
AString _s;
2023-09-24 03:13:03 +01:00
void AddSpace()
{
_s.Add_Space_if_NotEmpty();
}
2021-10-19 21:27:23 +01:00
void AddSpacesBeforeName()
{
2023-09-24 03:13:03 +01:00
if (!_s.IsEmpty())
{
_s.Add_Space();
_s.Add_Space();
}
2021-10-19 21:27:23 +01:00
}
void PrintSeparatorLine(const CObjectVector<CHasherState> &hashers);
void PrintResultLine(UInt64 fileSize,
2023-09-24 03:13:03 +01:00
const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash, const AString &path);
2021-10-19 21:27:23 +01:00
void PrintProperty(const char *name, UInt64 value);
public:
bool PrintNameInPercents;
bool PrintHeaders;
2023-09-24 03:13:03 +01:00
// bool PrintSize;
// bool PrintNewLine; // set it too (false), if you need only hash for single file without LF char.
AString PrintFields;
AString GetFields() const;
2021-10-19 21:27:23 +01:00
CHashCallbackConsole():
PrintNameInPercents(true),
2023-09-24 03:13:03 +01:00
PrintHeaders(false)
// , PrintSize(true),
// , PrintNewLine(true)
2021-10-19 21:27:23 +01:00
{}
};
void PrintHashStat(CStdOutStream &so, const CHashBundle &hb);
#endif