PrevUpHomeNext

utx::readline


Include

#include <utxcpp/core.hpp>

class utx::readline

Constructors

Default Constructor
// Default Prompt
utx::readline::readline() noexcept;
Constructor with setting a Prompt
// Init customized Prompt
utx::readline::readline(const std::string & prompt) noexcept;

Public Methods

setps
// Change Prompt
void utx::readline::setps(const std::string & prompt) noexcept;
read
// Read Input and Return the line string
std::string utx::readline::read() noexcept;
read
// Read Input and Return the line string with the prompt
std::string utx::readline::read(const std::string & prompt) noexcept;
get
// Get the line string
std::string utx::readline::get() const noexcept;

Private Members

std::string utx::readline::prompt;
std::string utx::readline::line;

Example

#include <utxcpp/core.hpp>

int main() {
	utx::print(
		"Your Name is:",
		utx::readline("Please Input Your Name: ").read(),
		"\nHow are you."
	);
}
Result:
Please Input Your Name: Fas Xmut
Your Name is: Fas Xmut
How are you.

See Also

utx::print


PrevUpHomeNext

utx::print

esv::print