| File PromptRequest.cpp changed (mode: 100644) (index aaf8c27..f1ae7ee) |
| ... |
... |
private: |
| 94 |
94 |
} |
} |
| 95 |
95 |
|
|
| 96 |
96 |
void |
void |
| 97 |
|
PromptRequest::loadHistory(const std::string &path) |
|
| 98 |
|
{ |
|
| 99 |
|
static_cast<void>(read_history(path.c_str())); |
|
| 100 |
|
} |
|
|
97 |
|
PromptHistory::load(const std::string &path) |
|
98 |
|
{ static_cast<void>(read_history(path.c_str())); } |
| 101 |
99 |
|
|
| 102 |
100 |
void |
void |
| 103 |
|
PromptRequest::saveHistory(const std::string &path) |
|
| 104 |
|
{ |
|
| 105 |
|
static_cast<void>(write_history(path.c_str())); |
|
| 106 |
|
} |
|
|
101 |
|
PromptHistory::save(const std::string &path) |
|
102 |
|
{ static_cast<void>(write_history(path.c_str())); } |
| 107 |
103 |
|
|
| 108 |
104 |
PromptResult::PromptResult(std::wstring input, bool accepted) |
PromptResult::PromptResult(std::wstring input, bool accepted) |
| 109 |
105 |
: input(std::move(input)), accepted(accepted) |
: input(std::move(input)), accepted(accepted) |
| File PromptRequest.hpp changed (mode: 100644) (index c15eb62..c8e8b04) |
| ... |
... |
class Screen; |
| 35 |
35 |
|
|
| 36 |
36 |
namespace cursedrl { |
namespace cursedrl { |
| 37 |
37 |
|
|
|
38 |
|
// Groups history management functions. |
|
39 |
|
namespace PromptHistory { |
|
40 |
|
// Loads history from the file. |
|
41 |
|
void load(const std::string &path); |
|
42 |
|
// Stores history to the file. |
|
43 |
|
void save(const std::string &path); |
|
44 |
|
}; |
|
45 |
|
|
| 38 |
46 |
// Describes result of a prompt request. |
// Describes result of a prompt request. |
| 39 |
47 |
class PromptResult |
class PromptResult |
| 40 |
48 |
{ |
{ |
| |
| ... |
... |
public: |
| 79 |
87 |
PromptRequest & operator=(const PromptRequest &rhs) = delete; |
PromptRequest & operator=(const PromptRequest &rhs) = delete; |
| 80 |
88 |
PromptRequest & operator=(PromptRequest &&rhs) = delete; |
PromptRequest & operator=(PromptRequest &&rhs) = delete; |
| 81 |
89 |
|
|
| 82 |
|
public: |
|
| 83 |
|
// Loads history from the file. |
|
| 84 |
|
static void loadHistory(const std::string &path); |
|
| 85 |
|
// Stores history to the file. |
|
| 86 |
|
static void saveHistory(const std::string &path); |
|
| 87 |
|
|
|
| 88 |
90 |
public: |
public: |
| 89 |
91 |
// Sets callback to be invoked when input is changed. |
// Sets callback to be invoked when input is changed. |
| 90 |
92 |
void setOnInputChanged(inputChangedFunc newOnInputChanged); |
void setOnInputChanged(inputChangedFunc newOnInputChanged); |