Class TermReader
Terminal input reader module
Inheritance
Namespace: Terminaux.Reader
Assembly: Terminaux.dll
Syntax
public static class TermReader
Properties
| Edit this page View SourceGlobalReaderSettings
The global reader settings
Declaration
public static TermReaderSettings GlobalReaderSettings { get; }
Property Value
Type | Description |
---|---|
TermReaderSettings |
Methods
| Edit this page View SourceRead(bool)
Reads the input
Declaration
public static string Read(bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(Func<string>, bool)
Reads the input
Declaration
public static string Read(Func<string> inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(Func<string>, string, bool, bool, bool)
Reads the input
Declaration
public static string Read(Func<string> inputPrompt, string defaultValue, bool password = false, bool oneLineWrap = false, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(Func<string>, string, TermReaderSettings, bool, bool, bool)
Reads the input
Declaration
public static string Read(Func<string> inputPrompt, string defaultValue, TermReaderSettings settings, bool password = false, bool oneLineWrap = false, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(Func<string>, TermReaderSettings, bool)
Reads the input
Declaration
public static string Read(Func<string> inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(string, bool)
Reads the input
Declaration
public static string Read(string inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(string, string, bool, bool, bool)
Reads the input
Declaration
public static string Read(string inputPrompt, string defaultValue, bool password = false, bool oneLineWrap = false, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
string | defaultValue | Default value to use if no input is provided |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(string, string, TermReaderSettings, bool, bool, bool)
Reads the input
Declaration
public static string Read(string inputPrompt, string defaultValue, TermReaderSettings settings, bool password = false, bool oneLineWrap = false, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(string, TermReaderSettings, bool)
Reads the input
Declaration
public static string Read(string inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read(TermReaderSettings, bool)
Reads the input
Declaration
public static string Read(TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, Func<string>, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, Func<string> inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
Func<string> | inputPrompt | The dynamic input function to prompt the user |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, Func<string>, TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, Func<string> inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
Func<string> | inputPrompt | The dynamic input function to prompt the user |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, string, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, string inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
string | inputPrompt | The input to be read |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, string, TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, string inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
string | inputPrompt | The input to be read |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(char, TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(char mask, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
char | mask | Password mask character |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(Func<string>, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(Func<string> inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(Func<string>, TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(Func<string> inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(string, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(string inputPrompt, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(string, TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(string inputPrompt, TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
ReadPassword(TermReaderSettings, bool)
Reads the input with password character masking
Declaration
public static string ReadPassword(TermReaderSettings settings, bool interruptible = true)
Parameters
Type | Name | Description |
---|---|---|
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
string |
Read<T>(bool)
Reads the input
Declaration
public static T Read<T>(bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(Func<string>, bool)
Reads the input
Declaration
public static T Read<T>(Func<string> inputPrompt, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(Func<string>, string, bool, bool, bool)
Reads the input
Declaration
public static T Read<T>(Func<string> inputPrompt, string defaultValue, bool password = false, bool oneLineWrap = false, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(Func<string>, string, TermReaderSettings, bool, bool, bool)
Reads the input
Declaration
public static T Read<T>(Func<string> inputPrompt, string defaultValue, TermReaderSettings settings, bool password = false, bool oneLineWrap = false, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(Func<string>, TermReaderSettings, bool)
Reads the input
Declaration
public static T Read<T>(Func<string> inputPrompt, TermReaderSettings settings, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
Func<string> | inputPrompt | The dynamic input function to prompt the user |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(string, bool)
Reads the input
Declaration
public static T Read<T>(string inputPrompt, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(string, string, bool, bool, bool)
Reads the input
Declaration
public static T Read<T>(string inputPrompt, string defaultValue, bool password = false, bool oneLineWrap = false, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
string | defaultValue | Default value to use if no input is provided |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(string, string, TermReaderSettings, bool, bool, bool)
Reads the input
Declaration
public static T Read<T>(string inputPrompt, string defaultValue, TermReaderSettings settings, bool password = false, bool oneLineWrap = false, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The dynamic input function to prompt the user |
string | defaultValue | Default value to use if no input is provided |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | password | Whether the password mode is enabled |
bool | oneLineWrap | Whether to wrap overflown text as one line |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(string, TermReaderSettings, bool)
Reads the input
Declaration
public static T Read<T>(string inputPrompt, TermReaderSettings settings, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
string | inputPrompt | The input to be read |
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Read<T>(TermReaderSettings, bool)
Reads the input
Declaration
public static T Read<T>(TermReaderSettings settings, bool interruptible = true) where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
TermReaderSettings | settings | Settings containing reader-related settings |
bool | interruptible | Whether the prompt is interruptible or not |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |