#include <app/tui.hpp>
|
| using | Check = std::function<std::string(const std::vector<std::string>&)> |
| | Says what is wrong with a list of arguments (the command line's own parser); empty if nothing is.
|
|
| | Model (std::string command, std::vector< Field > fields, Check check={}) |
| Action | press (int k) |
| | One key.
|
| std::vector< Line > | render (int rows, int cols) const |
| | The screen as rows lines of at most cols characters.
|
| std::vector< std::string > | args () const |
| | the chosen arguments: positionals first, then options in list order
|
| std::string | command_line () const |
| | the command with those arguments, quoted for a shell
|
| std::string | config_text (Scope s) const |
| | The options file of a scope: one name = value per line, as route --config reads it.
|
| std::string | config_text () const |
| std::vector< std::string > | load_config (const std::string &text, Scope s=Scope::file) |
| | Takes the values of such a file into a scope; returns one message per line it could not use.
|
| void | enable_scope (Scope s, std::string path, bool exists) |
| | Makes a scope available as a place to keep options: path is its file, exists whether that file is there.
|
| void | disable_scope (Scope s) |
| Scope | target () const |
| | The scope that edits go to and that s saves; Tab moves it.
|
| void | set_target (Scope s) |
| bool | dirty (Scope s) const |
| void | mark_saved () |
| | Records that the target scope's file was written.
|
| bool | set (const std::string &name, const std::string &value) |
| | Sets a field by its label or its argument spelling (e.g. "board", "--output"); false if there is none.
|
| const std::string & | save_path () const |
| | The file of the target scope.
|
| void | set_save_path (std::string p) |
| void | set_status (std::string s) |
| const std::string & | status () const |
| const std::string & | error () const |
| const std::vector< Field > & | fields () const |
Definition at line 77 of file tui.hpp.
◆ Check
Says what is wrong with a list of arguments (the command line's own parser); empty if nothing is.
Definition at line 80 of file tui.hpp.
◆ Model()
| tmk::app::tui::Model::Model |
( |
std::string | command, |
|
|
std::vector< Field > | fields, |
|
|
Check | check = {} ) |
◆ args()
| std::vector< std::string > tmk::app::tui::Model::args |
( |
| ) |
const |
the chosen arguments: positionals first, then options in list order
◆ command_line()
| std::string tmk::app::tui::Model::command_line |
( |
| ) |
const |
the command with those arguments, quoted for a shell
◆ config_text() [1/2]
| std::string tmk::app::tui::Model::config_text |
( |
| ) |
const |
|
inline |
◆ config_text() [2/2]
| std::string tmk::app::tui::Model::config_text |
( |
Scope | s | ) |
const |
The options file of a scope: one name = value per line, as route --config reads it.
Only the values that belong to that scope are written; what a lower or higher scope sets stays in its own file.
◆ dirty()
| bool tmk::app::tui::Model::dirty |
( |
Scope | s | ) |
const |
|
inline |
◆ disable_scope()
| void tmk::app::tui::Model::disable_scope |
( |
Scope | s | ) |
|
◆ enable_scope()
| void tmk::app::tui::Model::enable_scope |
( |
Scope | s, |
|
|
std::string | path, |
|
|
bool | exists ) |
Makes a scope available as a place to keep options: path is its file, exists whether that file is there.
file is available from the start (the –config file); the caller enables global and project.
◆ error()
| const std::string & tmk::app::tui::Model::error |
( |
| ) |
const |
|
inline |
◆ fields()
| const std::vector< Field > & tmk::app::tui::Model::fields |
( |
| ) |
const |
|
inline |
◆ load_config()
| std::vector< std::string > tmk::app::tui::Model::load_config |
( |
const std::string & | text, |
|
|
Scope | s = Scope::file ) |
Takes the values of such a file into a scope; returns one message per line it could not use.
◆ mark_saved()
| void tmk::app::tui::Model::mark_saved |
( |
| ) |
|
Records that the target scope's file was written.
◆ press()
| Action tmk::app::tui::Model::press |
( |
int | k | ) |
|
◆ render()
| std::vector< Line > tmk::app::tui::Model::render |
( |
int | rows, |
|
|
int | cols ) const |
The screen as rows lines of at most cols characters.
◆ save_path()
| const std::string & tmk::app::tui::Model::save_path |
( |
| ) |
const |
|
inline |
The file of the target scope.
Definition at line 115 of file tui.hpp.
◆ set()
| bool tmk::app::tui::Model::set |
( |
const std::string & | name, |
|
|
const std::string & | value ) |
Sets a field by its label or its argument spelling (e.g. "board", "--output"); false if there is none.
◆ set_save_path()
| void tmk::app::tui::Model::set_save_path |
( |
std::string | p | ) |
|
|
inline |
◆ set_status()
| void tmk::app::tui::Model::set_status |
( |
std::string | s | ) |
|
|
inline |
◆ set_target()
| void tmk::app::tui::Model::set_target |
( |
Scope | s | ) |
|
◆ status()
| const std::string & tmk::app::tui::Model::status |
( |
| ) |
const |
|
inline |
◆ target()
| Scope tmk::app::tui::Model::target |
( |
| ) |
const |
|
inline |
The scope that edits go to and that s saves; Tab moves it.
Definition at line 105 of file tui.hpp.
The documentation for this class was generated from the following file: