yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
test_common.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_HANDLERS_AGENT_TEST_COMMON_H_
2#define YAZE_CLI_HANDLERS_AGENT_TEST_COMMON_H_
3
4#include <string>
5#include <vector>
6
7#include "absl/strings/string_view.h"
8
9namespace yaze {
10namespace cli {
11namespace agent {
12
13// Common helper functions for test command handlers
14
15std::string TrimWhitespace(absl::string_view value);
16
18
19std::string PromptWithDefault(const std::string& prompt,
20 const std::string& default_value,
21 bool allow_empty = true);
22
23std::string PromptRequired(const std::string& prompt,
24 const std::string& default_value = std::string());
25
26int PromptInt(const std::string& prompt, int default_value, int min_value);
27
28bool PromptYesNo(const std::string& prompt, bool default_value);
29
30std::vector<std::string> ParseCommaSeparated(absl::string_view input);
31
32bool ParseKeyValueEntry(const std::string& input, std::string* key,
33 std::string* value);
34
35} // namespace agent
36} // namespace cli
37} // namespace yaze
38
39#endif // YAZE_CLI_HANDLERS_AGENT_TEST_COMMON_H_
40
bool ParseKeyValueEntry(const std::string &input, std::string *key, std::string *value)
std::string PromptWithDefault(const std::string &prompt, const std::string &default_value, bool allow_empty)
int PromptInt(const std::string &prompt, int default_value, int min_value)
std::string TrimWhitespace(absl::string_view value)
bool PromptYesNo(const std::string &prompt, bool default_value)
std::vector< std::string > ParseCommaSeparated(absl::string_view input)
bool IsInteractiveInput()
std::string PromptRequired(const std::string &prompt, const std::string &default_value)
Main namespace for the application.