yage.core.parse
Authors:
Eric Poggel
License:
LGPL v3
Miscellaneous function used for parsing.
- float[]
csvToFloat
(char[] csv);
- Convert a csv string of numbers to an array of floats
- char[]
floatToHex
(float[] vec);
- Convert an array of float color values (0-1) to hexadecimal.
- uint
hexToUint
(char[] hex);
- TODO:
Color has a constructor that deprecates this function.
Convert a hexadecimal string to an unsigned int.
Params:
char[] hex |
6 or 8 (includes alpha) character hexadecimal color. |
Throws:
Exception if hex contains an invalid hexadecimal character.
- bool
strToBool
(char[] word);
- Convert a string to 0 or 1.
"true
", "yes", "on", "y", and "1" will all return true
,
"false
", "no", "off", "n", and "0" will all return false
,
and an Exception is thrown for any other value.
- char[]
xmlEncode
(char[] src);
- Encode characters such as &, <, >, etc. as their xml/html equivalents
- char[]
xmlDecode
(char[] src);
- Convert xml-encoded special characters such as & back to &.
|