Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Functions | |
template<class Arg , class Invalid > | |
void | tinker::ioReadStream (Arg &arg, std::string prompt, Arg auto_fill, Invalid &&invalid, std::istream &istream=std::cin) |
Tests the validity of arg . If invalid, read ONE value from an std::istream object. arg will not change until the reading successfully exits. More... | |
template<class T > | |
void | tinker::ioRewindStream (T &stream) |
Rewind a stream object. More... | |
template<class Arg > | |
int | tinker::ioReadString (Arg &arg, const char *str, size_t len) |
Reads ONE value from a string and save to arg . arg will not change until the reading successfully exits. More... | |
int | tinker::ioReadString (std::string &arg, const char *str, size_t len) |
Reads ONE value from a string and save to arg . arg will not change until the reading successfully exits. More... | |
template<class Arg , size_t Len> | |
int | tinker::ioReadString (Arg &arg, const char(&src)[Len]) |
Reads ONE value from a string and save to arg . arg will not change until the reading successfully exits. More... | |
void tinker::ioReadStream | ( | Arg & | arg, |
std::string | prompt, | ||
Arg | auto_fill, | ||
Invalid && | invalid, | ||
std::istream & | istream = std::cin |
||
) |
Tests the validity of arg
. If invalid, read ONE value from an std::istream
object. arg
will not change until the reading successfully exits.
[out] | arg | Variable to store the value read from input. |
[in] | prompt | Help message to be sent to stdout . |
[in] | auto_fill | Default value to be assigned to arg . |
[in] | invalid | Function that returns true if arg is invalid or false if valid. |
[in] | istream | An std::istream object; use std::cin by default. |
int tinker::ioReadString | ( | Arg & | arg, |
const char * | str, | ||
size_t | len | ||
) |
Reads ONE value from a string and save to arg
. arg
will not change until the reading successfully exits.
int tinker::ioReadString | ( | Arg & | arg, |
const char(&) | src[Len] | ||
) |
Reads ONE value from a string and save to arg
. arg
will not change until the reading successfully exits.
|
inline |
Reads ONE value from a string and save to arg
. arg
will not change until the reading successfully exits.
void tinker::ioRewindStream | ( | T & | stream | ) |
Rewind a stream object.