class TestLineInput

Defined at line 14 of file ../../src/lib/line_input/test_line_input.h

An implementation of the single-line editor that just saves the input instead of writing anything

to the screen. Used for tests.

Public Methods

void TestLineInput (const std::string & prompt, AcceptCallback accept_cb)

This class always stores the accept data and optionally adds it to history, then calls the

accept callback if it's specified. Unlike the normal LineInput, the accept callback may be

null.

Defined at line 19 of file ../../src/lib/line_input/test_line_input.h

const std::optional<std::string> & accept ()

The "accept" value is the result of the most recent callback issuance.

Defined at line 32 of file ../../src/lib/line_input/test_line_input.h

void ClearAccept ()

Defined at line 33 of file ../../src/lib/line_input/test_line_input.h

void ClearOutput ()

Defined at line 35 of file ../../src/lib/line_input/test_line_input.h

void set_accept_goes_to_history (bool a)

See variable below.

Defined at line 38 of file ../../src/lib/line_input/test_line_input.h

std::string GetAndClearOutput ()

Defined at line 40 of file ../../src/lib/line_input/test_line_input.h

bool OnInputStr (const std::string & input)

This input takes a string instead of one character at a time, returning true if the

callback was issued for the *last* character.

Defined at line 48 of file ../../src/lib/line_input/test_line_input.h

void SetLine (const std::string & input)

Defined at line 56 of file ../../src/lib/line_input/test_line_input.h

void SetPos (size_t pos)

Defined at line 61 of file ../../src/lib/line_input/test_line_input.h

Protected Methods

void Write (const std::string & data)

Defined at line 64 of file ../../src/lib/line_input/test_line_input.h