VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Static Public Member Functions | Static Public Attributes
VisiMath.XMLHelper Class Reference

Static helper class for XML import / export. More...

List of all members.

## Static Public Member Functions
static float | FloatFromString (string str)
| Culture independent string / numeric conversion. Use bool FloatFromString(string str, out float) if you need to know if conversion was succesfull.
static bool | FloatFromString (string str, out float val)
| Culture independent string/numeric conversion.
static float | ReadAsFloat (XmlReader reader, bool throwonfailure=false)
| Tries to read float value from XML reader.
static int | ReadAsInt (XmlReader reader, bool throwonfailure=false)
| Tries to read Int value from XML reader.
static bool | ReadAsBool (XmlReader reader, bool throwonfailure=false)
| Read value in reader as bool.
static void | WriteFloat (XmlWriter writer, string RootNode, float val)
| Write float value to xml.
static void | WriteFloatAttribute (XmlWriter writer, string attr, float val)
| Write float as attribute.
static Vector3 | ReadVector3 (XmlReader reader)
| Read Vector3 from XML.
## Static Public Attributes
static readonly CultureInfo | CF = new CultureInfo("en-US")
| Default culture info.

## Detailed Description

Static helper class for XML import / export.

## Member Function Documentation

static float VisiMath.XMLHelper.FloatFromString | ( | string | str | ) | `[static]`

Culture independent string / numeric conversion. Use bool FloatFromString(string str, out float) if you need to know if conversion was succesfull.

Stupid NET and ToString() automatically using local globalization settings

Parameters:

  str | String to parse

Returns:
  Float value in string or 0

static bool VisiMath.XMLHelper.FloatFromString | ( | string | str,
|  | out float | val
| ) |  | `[static]`

Culture independent string/numeric conversion.

Parameters:

  str | String
  val | float value

Returns:
  True if conversion sucessful

static bool VisiMath.XMLHelper.ReadAsBool | ( | XmlReader | reader,
|  | bool | throwonfailure = `false`
| ) |  | `[static]`

Read value in reader as bool.

Parameters:

  reader | XML reader
  throwonfailure | If true, exception will be thrown on reading failure

Returns:
  Bool value

static float VisiMath.XMLHelper.ReadAsFloat | ( | XmlReader | reader,
|  | bool | throwonfailure = `false`
| ) |  | `[static]`

Tries to read float value from XML reader.

Parameters:

  reader | XML reader
  throwonfailure | If set to true, will throw exception if content is not float

Returns:
  Float value

static int VisiMath.XMLHelper.ReadAsInt | ( | XmlReader | reader,
|  | bool | throwonfailure = `false`
| ) |  | `[static]`

Tries to read Int value from XML reader.

Parameters:

  reader | XML reader
  throwonfailure | If set to true, will throw exception if content is not float

Returns:
  Int value

static Vector3 VisiMath.XMLHelper.ReadVector3 | ( | XmlReader | reader | ) | `[static]`

Read Vector3 from XML.

Parameters:

  reader | XML reader

Returns:
  Vector3 value

static void VisiMath.XMLHelper.WriteFloat | ( | XmlWriter | writer,
|  | string | RootNode,
|  | float | val
| ) |  | `[static]`

Write float value to xml.

Parameters:

  writer | xml writer
  RootNode | Node to write number
  val | Number to write

static void VisiMath.XMLHelper.WriteFloatAttribute | ( | XmlWriter | writer,
|  | string | attr,
|  | float | val
| ) |  | `[static]`

Write float as attribute.

Parameters:

  writer | XML writer
  attr | Attribute name
  val | Numeric value

## Member Data Documentation

readonly CultureInfo VisiMath.XMLHelper.CF = new CultureInfo("en-US")`[static]`

Default culture info.

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

- XMLHelper.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events