Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/7zip/UI/Console/UserInputUtils.cpp

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // UserInputUtils.cpp
2
3 #include "StdAfx.h"
4
5 #include "Common/StdInStream.h"
6 #include "Common/StringConvert.h"
7
8 #include "UserInputUtils.h"
9
10 static const char kYes = 'Y';
11 static const char kNo = 'N';
12 static const char kYesAll = 'A';
13 static const char kNoAll = 'S';
14 static const char kAutoRenameAll = 'U';
15 static const char kQuit = 'Q';
16
17 static const char *kFirstQuestionMessage = "?\n";
18 static const char *kHelpQuestionMessage =
19 "(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? ";
20
21 // return true if pressed Quite;
22
23 NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
24 {
25 (*outStream) << kFirstQuestionMessage;
26 for(;;)
27 {
28 (*outStream) << kHelpQuestionMessage;
29 AString scannedString = g_StdIn.ScanStringUntilNewLine();
30 scannedString.Trim();
31 if(!scannedString.IsEmpty())
32 switch(::MyCharUpper(scannedString[0]))
33 {
34 case kYes:
35 return NUserAnswerMode::kYes;
36 case kNo:
37 return NUserAnswerMode::kNo;
38 case kYesAll:
39 return NUserAnswerMode::kYesAll;
40 case kNoAll:
41 return NUserAnswerMode::kNoAll;
42 case kAutoRenameAll:
43 return NUserAnswerMode::kAutoRenameAll;
44 case kQuit:
45 return NUserAnswerMode::kQuit;
46 }
47 }
48 }
49
50 UString GetPassword(CStdOutStream *outStream)
51 {
52 (*outStream) << "\nEnter password:";
53 outStream->Flush();
54 AString oemPassword = g_StdIn.ScanStringUntilNewLine();
55 return MultiByteToUnicodeString(oemPassword, CP_OEMCP);
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698