OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OpenSim.Framework.Console.ConsoleUtil Class Reference

Static Public Member Functions

static bool CheckFileDoesNotExist (ICommandConsole console, string path)
 Check if the given file path exists. More...
 
static bool TryParseConsoleUuid (ICommandConsole console, string rawUuid, out UUID uuid)
 Try to parse a console UUID from the console. More...
 
static bool TryParseConsoleLocalId (ICommandConsole console, string rawLocalId, out uint localId)
 
static bool TryParseConsoleId (ICommandConsole console, string rawId, out UUID uuid, out uint localId)
 Tries to parse the input as either a UUID or a local ID. More...
 
static bool TryParseConsoleBool (ICommandConsole console, string rawConsoleString, out bool b)
 Convert a console input to a bool, automatically complaining if a console is given. More...
 
static bool TryParseConsoleInt (ICommandConsole console, string rawConsoleInt, out int i)
 Convert a console input to an int, automatically complaining if a console is given. More...
 
static bool TryParseConsoleFloat (ICommandConsole console, string rawConsoleInput, out float i)
 Convert a console input to a float, automatically complaining if a console is given. More...
 
static bool TryParseConsoleDouble (ICommandConsole console, string rawConsoleInput, out double i)
 Convert a console input to a double, automatically complaining if a console is given. More...
 
static bool TryParseConsoleNaturalInt (ICommandConsole console, string rawConsoleInt, out int i)
 Convert a console integer to a natural int, automatically complaining if a console is given. More...
 
static bool TryParseConsoleMinVector (string rawConsoleVector, out Vector3 vector)
 Convert a minimum vector input from the console to an OpenMetaverse.Vector3 More...
 
static bool TryParseConsoleMaxVector (string rawConsoleVector, out Vector3 vector)
 Convert a maximum vector input from the console to an OpenMetaverse.Vector3 More...
 
static bool TryParseConsoleVector (string rawConsoleVector, Func< string, string > blankComponentFunc, out Vector3 vector)
 Convert a vector input from the console to an OpenMetaverse.Vector3 More...
 
static bool TryParseConsole2DVector (string rawConsoleVector, Func< string, string > blankComponentFunc, out Vector2 vector)
 Convert a vector input from the console to an OpenMetaverse.Vector2 More...
 

Public Attributes

const int LocalIdNotFound = 0
 
const string CoordHelp
 Used by modules to display stock co-ordinate help, though possibly this should be under some general section rather than in each help summary. More...
 
const string MinRawConsoleVectorValue = "-~"
 
const string MaxRawConsoleVectorValue = "~"
 
const string VectorSeparator = ","
 

Static Public Attributes

static char[] VectorSeparatorChars = VectorSeparator.ToCharArray()
 

Detailed Description

Definition at line 38 of file ConsoleUtil.cs.

Member Function Documentation

static bool OpenSim.Framework.Console.ConsoleUtil.CheckFileDoesNotExist ( ICommandConsole  console,
string  path 
)
inlinestatic

Check if the given file path exists.

If not, warning is printed to the given console.

Returns
true if the file does not exist, false otherwise.
Parameters
console
path

Definition at line 74 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsole2DVector ( string  rawConsoleVector,
Func< string, string >  blankComponentFunc,
out Vector2  vector 
)
inlinestatic

Convert a vector input from the console to an OpenMetaverse.Vector2

Parameters
rawConsoleVectorA string in the form <x>,<y> where there is no space between values. Any component can be missing (e.g. ,40). blankComponentFunc is invoked to replace the blank with a suitable value Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40) The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue Other than that, component values must be numeric.
blankComponentFuncBehaviour if component is blank. If null then conversion fails on a blank component.
vector
Returns

Definition at line 321 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleBool ( ICommandConsole  console,
string  rawConsoleString,
out bool  b 
)
inlinestatic

Convert a console input to a bool, automatically complaining if a console is given.

Parameters
consoleCan be null if no console is available.
rawConsoleVector/param>
Parameters
vector
Returns

Definition at line 165 of file ConsoleUtil.cs.

Here is the caller graph for this function:

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleDouble ( ICommandConsole  console,
string  rawConsoleInput,
out double  i 
)
inlinestatic

Convert a console input to a double, automatically complaining if a console is given.

Parameters
consoleCan be null if no console is available.
rawConsoleInput/param>
Parameters
i
Returns

Definition at line 225 of file ConsoleUtil.cs.

Here is the caller graph for this function:

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleFloat ( ICommandConsole  console,
string  rawConsoleInput,
out float  i 
)
inlinestatic

Convert a console input to a float, automatically complaining if a console is given.

Parameters
consoleCan be null if no console is available.
rawConsoleInput/param>
Parameters
i
Returns

Definition at line 205 of file ConsoleUtil.cs.

Here is the caller graph for this function:

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleId ( ICommandConsole  console,
string  rawId,
out UUID  uuid,
out uint  localId 
)
inlinestatic

Tries to parse the input as either a UUID or a local ID.

Returns
true if parsing succeeded, false otherwise.
Parameters
console
rawId
uuid
localIdWill be set to ConsoleUtil.LocalIdNotFound if parsing result was a UUID or no parse succeeded.

Definition at line 139 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleInt ( ICommandConsole  console,
string  rawConsoleInt,
out int  i 
)
inlinestatic

Convert a console input to an int, automatically complaining if a console is given.

Parameters
consoleCan be null if no console is available.
rawConsoleInt/param>
Parameters
i
Returns

Definition at line 185 of file ConsoleUtil.cs.

Here is the caller graph for this function:

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleLocalId ( ICommandConsole  console,
string  rawLocalId,
out uint  localId 
)
inlinestatic

Definition at line 108 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleMaxVector ( string  rawConsoleVector,
out Vector3  vector 
)
inlinestatic

Convert a maximum vector input from the console to an OpenMetaverse.Vector3

Parameters
rawConsoleVector/param>
Parameters
vector
Returns

Definition at line 280 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleMinVector ( string  rawConsoleVector,
out Vector3  vector 
)
inlinestatic

Convert a minimum vector input from the console to an OpenMetaverse.Vector3

Parameters
rawConsoleVector/param>
Parameters
vector
Returns

Definition at line 269 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleNaturalInt ( ICommandConsole  console,
string  rawConsoleInt,
out int  i 
)
inlinestatic

Convert a console integer to a natural int, automatically complaining if a console is given.

Parameters
consoleCan be null if no console is available.
rawConsoleInt/param>
Parameters
i
Returns

Definition at line 245 of file ConsoleUtil.cs.

Here is the caller graph for this function:

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleUuid ( ICommandConsole  console,
string  rawUuid,
out UUID  uuid 
)
inlinestatic

Try to parse a console UUID from the console.

Will complain to the console if parsing fails.

Returns
Parameters
consoleIf null then no complaint is printed.
rawUuid
uuid

Definition at line 95 of file ConsoleUtil.cs.

static bool OpenSim.Framework.Console.ConsoleUtil.TryParseConsoleVector ( string  rawConsoleVector,
Func< string, string >  blankComponentFunc,
out Vector3  vector 
)
inlinestatic

Convert a vector input from the console to an OpenMetaverse.Vector3

Parameters
rawConsoleVectorA string in the form <x>,<y>,<z> where there is no space between values. Any component can be missing (e.g. ,,40). blankComponentFunc is invoked to replace the blank with a suitable value Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40,30 or 40) The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue Other than that, component values must be numeric.
blankComponentFuncBehaviour if component is blank. If null then conversion fails on a blank component.
vector
Returns

Definition at line 300 of file ConsoleUtil.cs.

Member Data Documentation

const string OpenSim.Framework.Console.ConsoleUtil.CoordHelp
Initial value:
= @"Each component of the coord is comma separated. There must be no spaces between the commas.
If you don't care about the z component you can simply omit it.
If you don't care about the x or y components then you can leave them blank (though a comma is still required)
If you want to specify the maximum value of a component then you can use ~ instead of a number
If you want to specify the minimum value of a component then you can use -~ instead of a number
e.g.
show object pos 20,20,20 to 40,40,40
delete object pos 20,20 to 40,40
show object pos ,20,20 to ,40,40
delete object pos ,,30 to ,,~
show object pos ,,-~ to ,,30"

Used by modules to display stock co-ordinate help, though possibly this should be under some general section rather than in each help summary.

Definition at line 49 of file ConsoleUtil.cs.

const int OpenSim.Framework.Console.ConsoleUtil.LocalIdNotFound = 0

Definition at line 42 of file ConsoleUtil.cs.

const string OpenSim.Framework.Console.ConsoleUtil.MaxRawConsoleVectorValue = "~"

Definition at line 62 of file ConsoleUtil.cs.

const string OpenSim.Framework.Console.ConsoleUtil.MinRawConsoleVectorValue = "-~"

Definition at line 61 of file ConsoleUtil.cs.

const string OpenSim.Framework.Console.ConsoleUtil.VectorSeparator = ","

Definition at line 64 of file ConsoleUtil.cs.

char [] OpenSim.Framework.Console.ConsoleUtil.VectorSeparatorChars = VectorSeparator.ToCharArray()
static

Definition at line 65 of file ConsoleUtil.cs.


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