IGLib  1.5
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
IG.Lib.UtilConsole Class Reference

Utilities for reading from a console. More...

+ Inheritance diagram for IG.Lib.UtilConsole:

Static Public Member Functions

static void HideConsoleWindow ()
 Hides the console window. More...
 
static void ShowConsoleWindow ()
 Shows the console window. More...
 
static bool Read (ref int value)
 Reads an integer from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content. More...
 
static bool Read (ref long value)
 Reads an integer (of type long) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content. More...
 
static bool Read (ref double value)
 Reads a floating point number (type double) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content. More...
 
static bool Read (ref float value)
 Reads a floating point number (type float) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content. More...
 
static bool Read (ref bool value)
 Reads a boolean from a console and assigns it to a variable. User can input a non-boolean to see current content, or insert an empty string to leave the old content. Eligible input to assign a new boolean value (strings are not case sensitive!): More...
 
static bool Read (ref string value)
 Reads a string from a console and assigns it to a variable. User can input a ? to see current content, or insert an empty string to leave the old content. More...
 
static bool Read (ref IVector vec)
 Reads a vector from a console and assigns it to the specified vector variable. More...
 
static bool Read (ref IVector vec, string vecName)
 Reads a vector from a console and assigns it to the specified vector variable. More...
 
static bool Read (ref IMatrix mat)
 Reads a matrix from console and assigns it to the specified matrix variable. More...
 
static bool Read (ref IMatrix mat, string matName)
 Reads a matrix from console and assigns it to the specified matrix variable. More...
 
static bool ReadPwd (ref string value, string printchar, bool printrandom)
 Reads a password from console, masking the input as specified. More...
 
static bool ReadPwd (ref string value, string printchar)
 Reads a password from console, masking the input as specified. More...
 
static bool ReadPwd (ref string value, bool printrandom)
 Reads a password from console, masking the input as specified. More...
 
static bool ReadPwd (ref string value)
 Reads a password from console, masking the input by * characters. More...
 
static void Examples ()
 

Protected Attributes

const int SW_HIDE = 0
 
const int SW_SHOW = 5
 
const string _defaultVectorName = "vec"
 
const string _defaultMatrixName = "vec"
 

Private Member Functions

static IntPtr GetConsoleWindow ()
 
static bool ShowWindow (IntPtr hWnd, int nCmdShow)
 

Detailed Description

Utilities for reading from a console.

$A Igor Feb10;

Member Function Documentation

static IntPtr IG.Lib.UtilConsole.GetConsoleWindow ( )
private
static bool IG.Lib.UtilConsole.ShowWindow ( IntPtr  hWnd,
int  nCmdShow 
)
private
static void IG.Lib.UtilConsole.HideConsoleWindow ( )
inlinestatic

Hides the console window.

Referenced by IG.Script.AppExtBase.CryptoFunctionHashForm().

static void IG.Lib.UtilConsole.ShowConsoleWindow ( )
inlinestatic

Shows the console window.

Referenced by IG.Script.AppExtBase.CryptoFunctionHashForm().

static bool IG.Lib.UtilConsole.Read ( ref long  value)
inlinestatic

Reads an integer (of type long) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content.

Parameters
valueVariable to which the inserted value is assigned.
Returns
true if a new value has been assigned, false otherwise.
static bool IG.Lib.UtilConsole.Read ( ref double  value)
inlinestatic

Reads a floating point number (type double) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content.

Parameters
valueVariable to which the inserted value is assigned.
Returns
true if a new value has been assigned, false otherwise.
static bool IG.Lib.UtilConsole.Read ( ref float  value)
inlinestatic

Reads a floating point number (type float) from a console and assigns it to a variable. User can input a non-integer to see current content, or insert an empty string to leave the old content.

Parameters
valueVariable to which the inserted value is assigned.
Returns
true if a new value has been assigned, false otherwise.
static bool IG.Lib.UtilConsole.Read ( ref bool  value)
inlinestatic

Reads a boolean from a console and assigns it to a variable. User can input a non-boolean to see current content, or insert an empty string to leave the old content. Eligible input to assign a new boolean value (strings are not case sensitive!):

Parameters
valueVariable to which the inserted value is assigned.
Returns
true if a new value has been assigned, false otherwise.
static bool IG.Lib.UtilConsole.Read ( ref string  value)
inlinestatic

Reads a string from a console and assigns it to a variable. User can input a ? to see current content, or insert an empty string to leave the old content.

Parameters
valueVariable to which the inserted value is assigned.
Returns
true if a new value has been assigned, false otherwise.
static bool IG.Lib.UtilConsole.Read ( ref IVector  vec)
inlinestatic

Reads a vector from a console and assigns it to the specified vector variable.

Parameters
vecVector variable to read-in the vector.
Returns
True if the value of vec has been modified by the reading operation, false if not.
static bool IG.Lib.UtilConsole.Read ( ref IVector  vec,
string  vecName 
)
inlinestatic

Reads a vector from a console and assigns it to the specified vector variable.

Parameters
vecVector variable to read-in the vector.
vecNameName of the vector to be read in (used just in writing help strings to console). If null or empty string then default name is taken.
Returns
True if the value of vec has been modified by the reading operation, false if not.

References IG.Lib.UtilConsole.Read(), and IG.Num.VectorBase.Resize().

static bool IG.Lib.UtilConsole.Read ( ref IMatrix  mat)
inlinestatic

Reads a matrix from console and assigns it to the specified matrix variable.

Parameters
matMatrix variable to hold the read-in matrix.
Returns
True if the value of mat has been modified by the reading operation, false if not.
static bool IG.Lib.UtilConsole.Read ( ref IMatrix  mat,
string  matName 
)
inlinestatic

Reads a matrix from console and assigns it to the specified matrix variable.

Parameters
matMatrix variable to hold the read-in matrix.
matNameName of the matrix to be read in (used just in writing help strings to console). If null or empty string then default name is taken.
Returns
True if the value of mat has been modified by the reading operation, false if not.

References IG.Lib.UtilConsole.Read(), and IG.Num.MatrixBase.Resize().

static bool IG.Lib.UtilConsole.ReadPwd ( ref string  value,
string  printchar,
bool  printrandom 
)
inlinestatic

Reads a password from console, masking the input as specified.

Parameters
valueOutput parameter where the inserted password is stored.
printcharCharacter that is output to the concole with every character input by the user.
printrandomIf thrue then random characters are output to console when password characters are typed in.
Returns
True if password has been read, false if not (i.e. empty string was inserted).

References IG.Lib.UtilStr.RandomChar().

Referenced by IG.Lib.UtilConsole.Examples().

static bool IG.Lib.UtilConsole.ReadPwd ( ref string  value,
string  printchar 
)
inlinestatic

Reads a password from console, masking the input as specified.

Parameters
valueOutput parameter where the inserted password is stored.
printcharCharacter that is output to the concole with every character input by the user.
Returns
True if password has been read, false if not (i.e. empty string was inserted).
static bool IG.Lib.UtilConsole.ReadPwd ( ref string  value,
bool  printrandom 
)
inlinestatic

Reads a password from console, masking the input as specified.

Parameters
valueOutput parameter where the inserted password is stored.
printrandomIf true then a random character (alphabitic or numeric) is prineted for each character typed in. Otherwise, * is printed.
Returns
True if password has been read, false if not (i.e. empty string was inserted).
static bool IG.Lib.UtilConsole.ReadPwd ( ref string  value)
inlinestatic

Reads a password from console, masking the input by * characters.

Parameters
valueOutput parameter where the inserted password is stored.
Returns
True if password has been read, false if not (i.e. empty string was inserted).
static void IG.Lib.UtilConsole.Examples ( )
inlinestatic

Member Data Documentation

const int IG.Lib.UtilConsole.SW_HIDE = 0
protected
const int IG.Lib.UtilConsole.SW_SHOW = 5
protected
const string IG.Lib.UtilConsole._defaultVectorName = "vec"
protected
const string IG.Lib.UtilConsole._defaultMatrixName = "vec"
protected

The documentation for this class was generated from the following file: