terminal/src/host/CommandNumberPopup.hpp
pi1024e fb22eae072
Add explicit identifier to some constructors (#5652)
If a class has a constructor which can be called with a single argument,
then this constructor becomes conversion constructor because such a
constructor allows conversion of the single argument to the class being
constructed. To ensure these constructors are passed the argument of its
type, I labeled them explicit.

In some header files, there were constructors that took a value that
could involve implicit conversions, so I added explicit to ensure that
does not happen.
2020-04-29 16:50:47 -07:00

46 lines
1.1 KiB
C++

/*++
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Module Name:
- CommandNumberPopup.hpp
Abstract:
- Popup used for use command number input
- contains code pulled from popup.cpp and cmdline.cpp
Author:
- Austin Diviness (AustDi) 18-Aug-2018
--*/
#pragma once
#include "popup.h"
class CommandNumberPopup final : public Popup
{
public:
explicit CommandNumberPopup(SCREEN_INFORMATION& screenInfo);
[[nodiscard]] NTSTATUS Process(COOKED_READ_DATA& cookedReadData) noexcept override;
protected:
void _DrawContent() override;
private:
std::wstring _userInput;
void _handleNumber(COOKED_READ_DATA& cookedReadData, const wchar_t wch) noexcept;
void _handleBackspace(COOKED_READ_DATA& cookedReadData) noexcept;
void _handleEscape(COOKED_READ_DATA& cookedReadData) noexcept;
void _handleReturn(COOKED_READ_DATA& cookedReadData) noexcept;
void _push(const wchar_t wch);
void _pop() noexcept;
int _parse() const noexcept;
#ifdef UNIT_TESTING
friend class CommandNumberPopupTests;
#endif
};