IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Utilities for reading from a console. More...
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 | ReadPwdBasic (ref string value, string printchar, bool printrandom, bool repeat=true) |
Reads a password from console, masking the input as specified. More... | |
static bool | ReadPwd (ref string value, string printchar, bool repeat=true) |
Reads a password from console, masking the input as specified. More... | |
static bool | ReadPwd (ref string value, bool printrandom, bool repeat=true) |
Reads a password from console, masking the input as specified. More... | |
static bool | ReadPwd (ref string value, bool repeat=true) |
Reads a password from console, masking the input by * characters. More... | |
static void | ReadPwd (ref byte[] passwordBytes, ref string passwordString, string passwordName="password", bool isStringForm=false, bool isByteform=false, bool isHexForm=false, bool isBase64Encoded=false, bool verify=true) |
Reads a password, a key, or any other key - related string form the console. 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) |
Utilities for reading from a console.
$A Igor Feb10;
|
private |
|
private |
|
inlinestatic |
Hides the console window.
Referenced by IG.Script.AppExtBase.CryptoFunctionHashForm().
|
inlinestatic |
Shows the console window.
Referenced by IG.Script.AppExtBase.CryptoFunctionHashForm().
|
inlinestatic |
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.
value | Variable to which the inserted value is assigned. |
Referenced by IG.Crypto.UtilCrypto.AddCertificateToStore(), IG.Crypto.CryptoManager.AppAsymExportKey(), IG.Crypto.CryptoManager.AppCheckSum(), IG.Crypto.CryptoManager.AppCleanFiles(), IG.Crypto.CryptoManager.AppEncryptSymmetricAll(), IG.Crypto.CryptoManager.AppGetFileHash(), IG.Script.LoadableScriptShellNeuralBase.CreateDistortedModelData(), IG.Script.ScriptAppBase.CryptoFunctionCheckSum_OLD_TO_DELETE_LATER(), IG.Script.ScriptAppBase.CryptoFunctionGetFileHash_OLD_TO_DELETE(), IG.Crypto.UtilCrypto.DeleteCertificateFromStore(), IG.Lib.RealFunctionLoader.Example(), IG.Num.mat2.Example(), IG.Lib.ScalarFunctionLoader.Example(), IG.Num.mat3.Example(), IG.Lib.UtilConsole.Examples(), IG.Lib.ArrayDto< ElementType, ElementBaseType, ElementDtoType >.ExampleVectorArray(), IG.Lib.ListDto< ElementType, ElementBaseType, ElementDtoType >.ExampleVectorArray(), IG.Lib.CommandLineApplicationInterpreter.ExecuteSystemCommandsInteractive(), IG.Num.vec2.Read(), IG.Num.vec3.Read(), IG.Lib.UtilConsole.Read(), IG.Num.mat2.Read(), IG.Num.mat3.Read(), IG.Lib.UtilConsole.ReadPwd(), and IG.Lib.CommandLineApplicationInterpreter.RunInteractive().
|
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.
value | Variable to which the inserted value is assigned. |
|
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.
value | Variable to which the inserted value is assigned. |
|
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.
value | Variable to which the inserted value is assigned. |
|
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!):
value | Variable to which the inserted value is assigned. |
|
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.
value | Variable to which the inserted value is assigned. |
|
inlinestatic |
Reads a vector from a console and assigns it to the specified vector variable.
vec | Vector variable to read-in the vector. |
|
inlinestatic |
Reads a vector from a console and assigns it to the specified vector variable.
vec | Vector variable to read-in the vector. |
vecName | Name 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. |
References IG.Lib.UtilConsole.Read(), and IG.Num.VectorBase.Resize().
|
inlinestatic |
Reads a matrix from console and assigns it to the specified matrix variable.
mat | Matrix variable to hold the read-in matrix. |
|
inlinestatic |
Reads a matrix from console and assigns it to the specified matrix variable.
mat | Matrix variable to hold the read-in matrix. |
matName | Name 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. |
References IG.Lib.UtilConsole.Read(), and IG.Num.MatrixBase.Resize().
|
inlinestatic |
Reads a password from console, masking the input as specified.
value | Output parameter where the inserted password is stored. |
printchar | Character that is output to the concole with every character input by the user. |
printrandom | If thrue then random characters are output to console when password characters are typed in. |
repeat | If true (which is default) then insertion is repeated for verification. |
References IG.Lib.UtilStr.RandomChar().
|
inlinestatic |
Reads a password from console, masking the input as specified.
value | Output parameter where the inserted password is stored. |
printchar | Character that is output to the concole with every character input by the user. |
repeat | If true (which is default) then insertion is repeated for verification. |
Referenced by IG.Crypto.CryptoManager.AppAddCertificate(), IG.Crypto.CryptoManager.AppCertInfo(), IG.Crypto.CryptoManager.AppEncryptSymmetricAll(), IG.Lib.UtilConsole.Examples(), and IG.Lib.UtilConsole.ReadPwd().
|
inlinestatic |
Reads a password from console, masking the input as specified.
value | Output parameter where the inserted password is stored. |
printrandom | If true then a random character (alphabitic or numeric) is prineted for each character typed in. Otherwise, * is printed. |
repeat | If true (which is default) then insertion is repeated for verification. |
|
inlinestatic |
Reads a password from console, masking the input by * characters.
value | Output parameter where the inserted password is stored. |
repeat | If true (which is default) then insertion is repeated for verification. |
|
inlinestatic |
Reads a password, a key, or any other key - related string form the console.
Password can be either a string, or a hexadecimal or base-64 encoded sequence of bytes.
If not clear from parameters, user is asked what form of password will be provided.
passwordBytes | Here password in byte form is written (in this case, passwordString is cleared). |
passwordString | Here password in string form is written (in this case, passwordBytes is cleared). |
passwordName | Name of the inserted key item (such as "password", "salt", "key"). Used in user prompts. |
isStringForm | If true then a key in string form must be inserted. |
isByteform | If true then a key in binary form muustt be inserted. |
isHexForm | If true then a key in binary form must be inserted as hexadecimal string. |
Allowed forms are e.g. "a8b023" or "a8-b0-23", with any spearator that does not represent a hexadecimal digit.
isBase64Encoded | If true then a key in binary form must be inserted as a base-64 encoded string. |
verify | If true then user is required to insert the password twice (for verification). |
References IG.Lib.Util.FromHexString(), IG.Lib.UtilConsole.Read(), and IG.Lib.UtilConsole.ReadPwd().
|
inlinestatic |
|
protected |
|
protected |
|
protected |
|
protected |