C# Class Ikayzo.SDL.SDLUtil

Various SDL related utility methods
ファイルを表示 Open project: ikayzo/SDL.NET

Public Methods

Method Description
CoerceOrFail ( Object obj ) : object

Coerce the type to a standard SDL type or throw an argument exception if no coercion is possible.

Format ( object obj ) : string

Create an SDL string representation for an object (note: Strings and Characters will be surrounded by quotes.)

Format ( object obj, bool addQuotes ) : string

Create an SDL string representation for an object

List ( String valueList ) : IList

Parse the string of values and return a list. The string is handled as if it is the values portion of an SDL tag.

Map ( string attributeString ) : object>.IDictionary

Parse a string representing the attributes portion of an SDL tag and return the results as a map.

ValidateIdentifier ( string identifier ) : string

Validates an SDL identifier String. SDL Identifiers must start with a Unicode letter or underscore (_) and contain only unicode letters, digits, underscores, and dashes.

Value ( String literal ) : Object

Get the value represented by a string containing an SDL literal.

Private Methods

Method Description
Escape ( char c ) : string
Escape ( string s ) : string

Method Details

CoerceOrFail() public static method

Coerce the type to a standard SDL type or throw an argument exception if no coercion is possible.
If no coercion is /// possible
public static CoerceOrFail ( Object obj ) : object
obj Object The object to coerce
return object

Format() public static method

Create an SDL string representation for an object (note: Strings and Characters will be surrounded by quotes.)
public static Format ( object obj ) : string
obj object The object to format
return string

Format() public static method

Create an SDL string representation for an object
public static Format ( object obj, bool addQuotes ) : string
obj object The object to format
addQuotes bool Quotes will be added to Strings and /// Characters if true
return string

List() public static method

Parse the string of values and return a list. The string is handled as if it is the values portion of an SDL tag.
(or subclass SDLParseException) If /// the string contains literals that cannot be parsed If valueList /// is null.
public static List ( String valueList ) : IList
valueList String A string of space separated SDL literals ///
return IList

Map() public static method

Parse a string representing the attributes portion of an SDL tag and return the results as a map.
(or subclass SDLParseException) If /// the string contains literals that cannot be parsed or the map is /// malformed If attributeString /// is null.
public static Map ( string attributeString ) : object>.IDictionary
attributeString string A string of space separated key=value /// pairs
return object>.IDictionary

ValidateIdentifier() public static method

Validates an SDL identifier String. SDL Identifiers must start with a Unicode letter or underscore (_) and contain only unicode letters, digits, underscores, and dashes.
If identifier is /// not a valid SDL identifier
public static ValidateIdentifier ( string identifier ) : string
identifier string
return string

Value() public static method

Get the value represented by a string containing an SDL literal.
(or subclass SDLParseException) If /// the string cannot be interpreted as an SDL literal If literal is null. ///
public static Value ( String literal ) : Object
literal String An SDL literal
return Object