|
TraceMaker
C++ API of the engine
|
Namespaces | |
| namespace | key |
Classes | |
| struct | Field |
| One command-line option as the screen shows it. More... | |
| struct | Entry |
| One line of an options file: name = value. More... | |
| struct | Span |
| struct | Line |
| One screen line: text is the plain text (what a test or a monochrome terminal sees), spans the same in pieces with their styles. More... | |
| class | Model |
Enumerations | |
| enum class | Scope { run = 0 , global = 1 , project = 2 , file = 3 } |
| Where a value comes from, lowest precedence first. More... | |
| enum class | Action { none , quit , run , print , save } |
| enum class | Style { plain , frame , title , heading , dim , label , key , code , ok , warn , error , accent , global , project , file , run , tag_global , tag_project , tag_file , tag_run } |
| How a piece of text is painted. More... | |
Functions | |
| const char * | scope_name (Scope s) |
| "this run", "global", "project", "file" | |
| std::vector< Entry > | parse_options (const std::string &text) |
| int | truth (const std::string &value) |
| A flag's value in an options file: 1 for true/on/yes/1, 0 for false/off/no/0, -1 for anything else. | |
| std::size_t | display_width (const std::string &s) |
| Columns the text takes (UTF-8 characters count one each, which is right for the box-drawing characters). | |
| void | save_options (Model &m) |
| Writes the target scope's options to its file (creating the folder) and reports the outcome in the status line. | |
| Action | run_terminal (Model &m) |
| Runs the model on the controlling terminal (/dev/tty, so standard output stays free for print) until the user quits, runs or prints. | |
| Action | run_keys (Model &m, const std::string &keys) |
| The same for a scripted key sequence (tests): characters stand for themselves, and <up> <down> <pgup> <pgdn> <home> <end> <enter> <space> <esc> <bs> <del> <lt> name the others. | |
Variables | |
| constexpr int | kScopes = 4 |
|
strong |
|
strong |
Where a value comes from, lowest precedence first.
run is what belongs to one run (board, output) and is never written to a file; global is the user's options for every board, project the options of the board's folder and file a file named with –config. A higher scope overrides a lower one.
| Enumerator | |
|---|---|
| run | |
| global | |
| project | |
| file | |
|
strong |
How a piece of text is painted.
The terminal layer maps these to colours (or to bold, dim and reverse under NO_COLOR); the model only says what the text is.
| Enumerator | |
|---|---|
| plain | |
| frame | |
| title | |
| heading | |
| dim | |
| label | |
| key | |
| code | |
| ok | |
| warn | |
| error | |
| accent | |
| global | |
| project | |
| file | |
| run | a value or a name of that scope |
| tag_global | |
| tag_project | |
| tag_file | |
| tag_run | |
| std::size_t tmk::app::tui::display_width | ( | const std::string & | s | ) |
Columns the text takes (UTF-8 characters count one each, which is right for the box-drawing characters).
| std::vector< Entry > tmk::app::tui::parse_options | ( | const std::string & | text | ) |
The same for a scripted key sequence (tests): characters stand for themselves, and <up> <down> <pgup> <pgdn> <home> <end> <enter> <space> <esc> <bs> <del> <lt> name the others.
Ends with print when the keys run out.
Runs the model on the controlling terminal (/dev/tty, so standard output stays free for print) until the user quits, runs or prints.
Options files are written here. Throws std::runtime_error without a terminal.
| void tmk::app::tui::save_options | ( | Model & | m | ) |
Writes the target scope's options to its file (creating the folder) and reports the outcome in the status line.
| const char * tmk::app::tui::scope_name | ( | Scope | s | ) |
"this run", "global", "project", "file"
| int tmk::app::tui::truth | ( | const std::string & | value | ) |
A flag's value in an options file: 1 for true/on/yes/1, 0 for false/off/no/0, -1 for anything else.