Class CommandParser
Inheritance
CommandParser
Assembly: cs.temp.dll.dll
Syntax
public class CommandParser
Fields
INVALID_KEYWORD_CHARS
Declaration
public static readonly List<char> INVALID_KEYWORD_CHARS
Field Value
INVALID_VALUE_CHARS
Declaration
public static readonly List<char> INVALID_VALUE_CHARS
Field Value
SUPPORTED_BOOLEAN_VALUES
Declaration
public static readonly List<string> SUPPORTED_BOOLEAN_VALUES
Field Value
Methods
AddNewCommand(CommandDefinition)
Declaration
public bool AddNewCommand(CommandDefinition cmdDef)
Parameters
Returns
AddNewCommandCategory(String)
Declaration
public int AddNewCommandCategory(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
AddUser(UserDefinition)
Declaration
public bool AddUser(UserDefinition user)
Parameters
Returns
Deserialize(Byte[])
Deserialize byte array to Command
Declaration
public Command Deserialize(byte[] networkBytes)
Parameters
Type |
Name |
Description |
Byte[] |
networkBytes |
|
Returns
GetCommandDefinitionById(Int32)
Declaration
public CommandDefinition GetCommandDefinitionById(int id)
Parameters
Type |
Name |
Description |
Int32 |
id |
|
Returns
GetCommandIdByKeyword(String)
Declaration
public int GetCommandIdByKeyword(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
Returns
GetCommandKeywordById(Int32)
Declaration
public string GetCommandKeywordById(int id)
Parameters
Type |
Name |
Description |
Int32 |
id |
|
Returns
GetCommandSplit(String)
Declaration
public static string[] GetCommandSplit(string rawCmdString)
Parameters
Type |
Name |
Description |
String |
rawCmdString |
|
Returns
GetNumCommands()
Declaration
public int GetNumCommands()
Returns
GetParameterSplit(String)
Declaration
public static string[] GetParameterSplit(string rawParamString)
Parameters
Type |
Name |
Description |
String |
rawParamString |
|
Returns
IsValidCommandConfig(CosmosConsoleConfig)
Declaration
public static bool IsValidCommandConfig(CosmosConsoleConfig config)
Parameters
Returns
IsValidKeyword(String)
Declaration
public static bool IsValidKeyword(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
Returns
IsValidParameterValue(String)
Declaration
public static bool IsValidParameterValue(string value)
Parameters
Type |
Name |
Description |
String |
value |
|
Returns
IsValidPassword(String)
Declaration
public static bool IsValidPassword(string password)
Parameters
Type |
Name |
Description |
String |
password |
|
Returns
Parse(String)
Parses input string. Splits on space character, except when enclosed in quotes. First word is considered the command keyword.
Declaration
public Command Parse(string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
RemoveCommand(String)
Declaration
public bool RemoveCommand(string keyword)
Parameters
Type |
Name |
Description |
String |
keyword |
|
Returns
RemoveUser(String)
Declaration
public bool RemoveUser(string username)
Parameters
Type |
Name |
Description |
String |
username |
|
Returns
Serialize(Command)
Serialize Command to byte array
Declaration
public byte[] Serialize(Command command)
Parameters
Type |
Name |
Description |
Command |
command |
|
Returns
SetCommandEnabled(String, Boolean)
Declaration
public bool SetCommandEnabled(string commandKeyword, bool enabled)
Parameters
Returns
SetCommandParameterValues(String, String, List<String>)
Declaration
public bool SetCommandParameterValues(string commandKeyword, string parameterKey, List<string> values)
Parameters
Returns
SetUserCommandAccess(String, String, Boolean)
Declaration
public bool SetUserCommandAccess(string username, string commandKeyword, bool allowAccess)
Parameters
Returns
SetUserCommandsInCategoryAccess(String, String, Boolean)
Declaration
public bool SetUserCommandsInCategoryAccess(string username, string category, bool allowAccess)
Parameters
Returns
ValidateParameters(Command)
Declaration
public void ValidateParameters(Command command)
Parameters
Type |
Name |
Description |
Command |
command |
|