mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Add .gitattributes rules for text and binary handling
This commit is contained in:
@ -1,54 +1,54 @@
|
||||
#ifndef OPEN_CALLBACKS_H
|
||||
#define OPEN_CALLBACKS_H
|
||||
|
||||
#include "7z_includes.h"
|
||||
#include <QDebug>
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Archive Open callback class
|
||||
|
||||
|
||||
class CArchiveOpenCallback:
|
||||
public IArchiveOpenCallback,
|
||||
public ICryptoGetTextPassword,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
MY_UNKNOWN_IMP1(ICryptoGetTextPassword)
|
||||
|
||||
STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes);
|
||||
STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes);
|
||||
|
||||
STDMETHOD(CryptoGetTextPassword)(BSTR *password);
|
||||
|
||||
bool PasswordIsDefined;
|
||||
UString Password;
|
||||
|
||||
CArchiveOpenCallback() : PasswordIsDefined(false) {}
|
||||
};
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::SetTotal(const UInt64 * /* files */, const UInt64 * /* bytes */)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::SetCompleted(const UInt64 * /* files */, const UInt64 * /* bytes */)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::CryptoGetTextPassword(BSTR *password)
|
||||
{
|
||||
if (!PasswordIsDefined)
|
||||
{
|
||||
// You can ask real password here from user
|
||||
// Password = GetPassword(OutStream);
|
||||
// PasswordIsDefined = true;
|
||||
qDebug() << "Password is not defined" << endl;
|
||||
return E_ABORT;
|
||||
}
|
||||
return StringToBstr(Password, password);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef OPEN_CALLBACKS_H
|
||||
#define OPEN_CALLBACKS_H
|
||||
|
||||
#include "7z_includes.h"
|
||||
#include <QDebug>
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Archive Open callback class
|
||||
|
||||
|
||||
class CArchiveOpenCallback:
|
||||
public IArchiveOpenCallback,
|
||||
public ICryptoGetTextPassword,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
MY_UNKNOWN_IMP1(ICryptoGetTextPassword)
|
||||
|
||||
STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes);
|
||||
STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes);
|
||||
|
||||
STDMETHOD(CryptoGetTextPassword)(BSTR *password);
|
||||
|
||||
bool PasswordIsDefined;
|
||||
UString Password;
|
||||
|
||||
CArchiveOpenCallback() : PasswordIsDefined(false) {}
|
||||
};
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::SetTotal(const UInt64 * /* files */, const UInt64 * /* bytes */)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::SetCompleted(const UInt64 * /* files */, const UInt64 * /* bytes */)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CArchiveOpenCallback::CryptoGetTextPassword(BSTR *password)
|
||||
{
|
||||
if (!PasswordIsDefined)
|
||||
{
|
||||
// You can ask real password here from user
|
||||
// Password = GetPassword(OutStream);
|
||||
// PasswordIsDefined = true;
|
||||
qDebug() << "Password is not defined" << endl;
|
||||
return E_ABORT;
|
||||
}
|
||||
return StringToBstr(Password, password);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user