diff options
author | 2015-01-11 08:10:25 +0100 | |
---|---|---|
committer | 2015-01-11 08:10:25 +0100 | |
commit | 6a23c2f3b766cf4fc7028628f76b5ff9396383f0 (patch) | |
tree | a01e16637118ae0c80f337119898bdf18f081e24 /3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp | |
parent | 45ac9b351e0076c371de4c7453f59567b27b1cb6 (diff) |
Added full lzma sdk source (nw)
Diffstat (limited to '3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp')
-rw-r--r-- | 3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp b/3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp new file mode 100644 index 00000000000..7dba2ad5d9b --- /dev/null +++ b/3rdparty/lzma/CPP/7zip/UI/Console/OpenCallbackConsole.cpp @@ -0,0 +1,58 @@ +// OpenCallbackConsole.cpp + +#include "StdAfx.h" + +#include "OpenCallbackConsole.h" + +#include "ConsoleClose.h" +#include "UserInputUtils.h" + +HRESULT COpenCallbackConsole::Open_CheckBreak() +{ + if (NConsoleClose::TestBreakSignal()) + return E_ABORT; + return S_OK; +} + +HRESULT COpenCallbackConsole::Open_SetTotal(const UInt64 *, const UInt64 *) +{ + return Open_CheckBreak(); +} + +HRESULT COpenCallbackConsole::Open_SetCompleted(const UInt64 *, const UInt64 *) +{ + return Open_CheckBreak(); +} + +#ifndef _NO_CRYPTO + +HRESULT COpenCallbackConsole::Open_CryptoGetTextPassword(BSTR *password) +{ + PasswordWasAsked = true; + RINOK(Open_CheckBreak()); + if (!PasswordIsDefined) + { + Password = GetPassword(OutStream); + PasswordIsDefined = true; + } + return StringToBstr(Password, password); +} + +HRESULT COpenCallbackConsole::Open_GetPasswordIfAny(UString &password) +{ + if (PasswordIsDefined) + password = Password; + return S_OK; +} + +bool COpenCallbackConsole::Open_WasPasswordAsked() +{ + return PasswordWasAsked; +} + +void COpenCallbackConsole::Open_ClearPasswordWasAskedFlag() +{ + PasswordWasAsked = false; +} + +#endif |