@@ -8,7 +8,7 @@ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8
8
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9
9
See the Mulan PSL v2 for more details. */
10
10
11
- //
11
+ //
12
12
// Created by Willaaaaaaa in 2025
13
13
//
14
14
@@ -21,45 +21,47 @@ See the Mulan PSL v2 for more details. */
21
21
* @brief A wrapper class for linenoise lib
22
22
* @details Support history memory...
23
23
*/
24
- class LinenoiseReader {
24
+ class LinenoiseReader
25
+ {
25
26
public:
26
27
LinenoiseReader ();
27
28
~LinenoiseReader () = default ;
28
-
29
+
29
30
/* *
30
- * @brief Read input with C string
31
+ * @brief Read input with C++ string
31
32
* @param prompt
32
33
* @return char* to input string or nullptr
34
+ // * @note set prompt to string to be consistent with replxx
33
35
*/
34
- char * input (const char * prompt);
35
-
36
+ char * input (const char * prompt);
37
+
36
38
/* *
37
39
* @brief Load history records from the file
38
40
* @param history_file path/to/history
39
41
* @return Whether load success
40
42
*/
41
- bool history_load (const std::string& history_file);
42
-
43
+ bool history_load (const std::string & history_file);
44
+
43
45
/* *
44
46
* @brief Save history records to the file
45
47
* @param history_file path/to/history
46
48
* @return Whether save success
47
49
*/
48
- bool history_save (const std::string& history_file) const ;
49
-
50
+ bool history_save (const std::string & history_file) const ;
51
+
50
52
/* *
51
53
* @brief Add a single history record to the file
52
54
* @param line the C string command to be recorded
53
55
* @return Whether add success
54
56
*/
55
- bool history_add (const char * line);
56
-
57
+ bool history_add (const char * line);
58
+
57
59
/* *
58
60
* @brief Set the maximum of history length
59
61
* @param len length
60
62
*/
61
63
void history_set_max_len (int len);
62
-
64
+
63
65
/* *
64
66
* @brief Clean the screen: Ctrl + L
65
67
*/
@@ -69,4 +71,4 @@ class LinenoiseReader {
69
71
std::string history_file_;
70
72
};
71
73
72
- #endif // COMMON_LINENOISE_WRAPPER_H
74
+ #endif // COMMON_LINENOISE_WRAPPER_H
0 commit comments