-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.hpp
More file actions
51 lines (38 loc) · 1.13 KB
/
Copy pathdriver.hpp
File metadata and controls
51 lines (38 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* File: /lib/cli/driver.hpp
*
* This file is a part of cpplib project which is distributed under MIT License.
* See file LICENSE for full license details.
*
* Copyright (c) 2020-present Nikita Zuev (V.Slavski!) <[email protected]>
*/
#ifndef CPPLIB__lib__cli__driver__hpp
#define CPPLIB__lib__cli__driver__hpp
#include <string>
#include <cpp/lib_debug>
#include "../../lib/tl/noncopyable.hpp"
#include "../../lib/tl/linkable.hpp"
#include "../../lib/cstring.hpp"
#include "./interface.hpp"
namespace lib::cli {
// PREDECLARATIONS
class Interface;
// DECLARATION lib::cli::IDriver
class IDriver
: tl::noncopymovable<IDriver>
, public tl::linkable<IDriver, Interface>
{
public:
IDriver() = default;
virtual ~IDriver() = default;
virtual void out( const cstring & line ) { CPP_UNUSED( line ); }
void prompt( const cstring & prompt );
const ::std::string & prompt() const { return prompt_; }
protected:
virtual void beforePromptChanged() {}
virtual void afterPromptChanged() {}
using linkable< IDriver, Interface >::get_link;
private:
::std::string prompt_;
};
} // namespace lib::cli
#endif // CPPLIB__lib__cli__driver__hpp